Integrations
Opencode
Run Claude, open-weight and GPT models in opencode through Roteo.
opencode is a terminal coding agent. It reaches Roteo two ways:
Claude models
opencode's Claude Agent mode drives the official Claude Code CLI as its model client, and Claude Code sends each request to Roteo with your key. No Claude login is needed.
1. Install
- opencode 2.2.3 or newer. Download it from opencode's releases and check with
opencode --version. Theopencode-ainpm package is still on 1.x, which has no Claude Agent mode. - Claude Code, installed but not logged in: see Claude Code.
2. Point Claude Agent at Roteo
Add this to ~/.config/opencode/opencode.json, next to anything already there:
The key is options. A settings block looks similar but is ignored, and the first request then fails with "Not logged in".
The Roteo setup stays inside opencode: your own Claude Code keeps its usual login. A Roteo setup in Claude Code's ~/.claude/settings.json does not carry over either, because opencode starts Claude Code with its settings file off.
3. Set your key and turn telemetry off
Set your Roteo key, and switch off Claude Code's own telemetry and error reports. The two telemetry lines are required: Roteo keeps your identity away from the model provider, and they stop Claude Code reporting from your machine. They also make your own Claude Code quieter; its auto-updates keep working.
That sets them for the current terminal. To keep them, add the export lines to your shell profile (~/.zshrc, ~/.bashrc), or on Windows run setx ROTEO_API_KEY "sk_your_key", setx DISABLE_TELEMETRY 1 and setx DISABLE_ERROR_REPORTING 1 once, then open a new terminal.
4. Connect and pick a model
In opencode, run /connect and choose Claude Agent. Within a minute /models lists the Claude Agent models:
Pick one and work as usual: tool calls and file edits go through Claude Code, and every request is billed to your Roteo balance. All four are supported, Fable 5.1 included. As everywhere else, Fable's own safeguards turn down cybersecurity-related requests, so use another model for those (see below).
After you change anything
opencode 2 keeps a background service that holds the environment it started with. After setting or changing the key, the telemetry lines or opencode.json, run:
from a terminal that has the new values.
If it fails
Without opencode.json
You can skip step 2 and set Claude Code's two variables instead, in the same place as step 3:
Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY: in this mode an API key reads as "Not logged in". Set for your whole account (setx, a shell profile), these two send your own Claude Code through Roteo as well, which is why the opencode.json setup above comes first.
Open-weight and GPT models
opencode also 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. This works on opencode 1.x and 2.x.
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. deepseek-v4-flash-0731 and glm-5.3-flash are the cheapest 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 one of the cheapest models 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 on this provider; for Claude, use the Claude Agent mode above. 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.