Skip to content

OpenCode

OpenCode registers providers through opencode.json using the AI SDK. Add Routeplane as an OpenAI-compatible provider and the terminal agent routes across the whole registry.

  • Routeplane running — local proxy at http://127.0.0.1:4356. Routeplane Cloud is on the Phase D roadmap and not yet shipping; for now, self-host with your own provider keys.

  • OpenCode installed:

    Terminal window
    curl -fsSL https://opencode.ai/install | bash
    # or: npm install -g opencode-ai

Add a provider block to opencode.json (project root or ~/.config/opencode/opencode.json). baseURL points at the /v1 root; the model keys are the registry ids you want to expose.

{
"$schema": "https://opencode.ai/config.json",
"provider": {
"routeplane": {
"npm": "@ai-sdk/openai-compatible",
"name": "Routeplane",
"options": {
"baseURL": "http://127.0.0.1:4356/v1",
"apiKey": "any-placeholder" // local proxy ignores apiKey; Cloud is on the Phase D roadmap
},
"models": {
"openai/gpt-4o": { "name": "GPT-4o via Routeplane" },
"anthropic/claude-sonnet-4-6": { "name": "Claude Sonnet 4.6 via Routeplane" }
}
}
}
}
Terminal window
opencode
**No key for the local proxy** — `apiKey` can be any placeholder. Routeplane Cloud is on the Phase D roadmap; the cloud endpoint is not yet shipping.

Each key under models is a registry id in provider/model form, optionally with a :cost / :latency variant. Select one in the TUI, or run opencode run --model routeplane/openai/gpt-4o. See Models.