Integrations
Opencode
Point opencode's terminal agent at Roteo and run open-weight models from your wallet.
opencode is a terminal coding agent. It speaks the Chat Completions wire through an OpenAI-compatible provider, so it connects to Roteo with a provider block and an API key. Two minutes, no proxy.
Install
Pick whichever you already have:
Connect
Run opencode, then /connect. Scroll to Other, enter roteo as the provider id, and paste your Roteo key.
/connect only stores the id and the key. The endpoint and the model list live in the config file, which is the second half of the setup.
Configure
Add the provider to ~/.config/opencode/opencode.json (opencode.jsonc works too, and a project-level opencode.json overrides it).
This block carries the five open-weight models verified for opencode, each with its real context window, so /models shows the full list instead of the two you happened to type:
All five are verified to run real tool calls through opencode. glm-5.3-flash is the cheapest and has the largest window of the group; see Pricing for the rates.
Use roteo, lowercase, both for the key under provider and for name. It must match exactly what you typed at the /connect prompt, because that string is the only link between your stored key and this block.
After editing the file, quit and relaunch opencode, then pick the model again with /models. opencode reads the file at startup, so a running session keeps the old list and the old model.
Point the small model somewhere cheap
Add this at the top level of the same file, beside provider:
opencode makes side calls you never see, such as naming and summarising the session, and when small_model is unset they fall back to your main model. The title call also carries its own internal retries, so a two or three word title can mean several extra calls against your chosen model, running at the same time as your real request.
Sending those to glm-5.3-flash is strictly better: it is the cheapest model on the endpoint, and it keeps your main model's budget for actual work. The format is provider/model-id, so the roteo/ prefix matters.
Keep the key out of the file
/connect already holds the key, and a literal key in a config is a key that gets committed by accident.
If you would rather skip /connect and keep everything in the file, opencode interpolates secrets instead of storing them in plain text: add "apiKey": "{env:ROTEO_API_KEY}" next to baseURL (a {file:~/.secrets/roteo} form works too). Use one or the other, not both.
Switch models
The block above already lists everything usable, so /models has them all. To add a new id later, put it in the models map, restart, and pick it again.
The open-weight ids from Models are the set we recommend and verify for opencode. GPT ids also work but are not yet verified with opencode. Claude ids are refused, because agent frameworks cannot be served on Claude models; for Claude, use Claude Code. The full support matrix is in Agents & OpenAI-compatible clients.
If the key reads as missing
- Capitals in the provider id. A
Roteoin the config will not match theroteothat/connectstored. - A renamed provider. Change
roteotoroteo-localand the stored key stays filed under the old name. Run/connectagain with the new id. - A second provider. A block for a different base URL does not inherit the first block's key. Run
/connectagain and type the new id.