Get an API key
Sign in to OpenCode and create or copy an API key for your Zen account. The account must have an active balance that can use the selected models.Configuration
Add OpenCode Zen in Settings > Models and paste the key, or set:opencode/ prefix and adds a recommended
set after connection. The preset can use inexpensive routed models for helper
work and stronger models for coding, planning, vision, and review.
Cost behavior
OpenCode applies the pricing rules shown for Zen and the routed model. Roomote records token usage and estimates cost from model metadata, while the OpenCode account balance and Zen documentation remain authoritative.Verify setup
- save
OPENCODE_API_KEY - confirm OpenCode models appear in Settings > Models
- apply a preset or assign an
opencode/...model manually - run a small task and confirm it appears in OpenCode usage
Common issues
- The key is rejected. Confirm it is an OpenCode service key rather than a key for one of the upstream model vendors.
- A routed model is unavailable. Check the model’s availability and your Zen balance, then select another model from the connected catalog.
- Costs differ by model. OpenCode routes multiple vendors; check the exact
opencode/...model rather than assuming one rate for the provider.