Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.routing.run/llms.txt

Use this file to discover all available pages before exploring further.

OpenCode is an open-source terminal AI coding agent. It includes routing.run as a login provider, so you can authenticate with a dashboard rk_ key and use any model id that starts with route/. Official references:

Install OpenCode

Pick one install path, then confirm the binary is on your PATH:
curl -fsSL https://opencode.ai/install | bash
On macOS or Linux with Homebrew, the OpenCode tap tracks releases closely:
brew install anomalyco/tap/opencode
With Bun:
bun install -g opencode-ai
Then run opencode --help (or opencode) from a project directory.

Connect routing.run

1

Get your API key

Create an API key at app.routing.run. Copy the full secret — it starts with rk_.
2

Register the credential

Run opencode auth login, select routing.run, and paste your rk_… key.
3

Select a model and go

Use /models in the TUI to pick a route/… model. Chat traffic goes to routing.run with your rk_ credential. OpenCode displays models as routing.run/route/....

Login command

opencode auth login
Select routing.run from the provider list, then enter your routing.run API key when prompted. You do not need to edit opencode.json for the standard routing.run setup.
If list calls work but chat fails, confirm the model id includes the route/ prefix and matches a published routing.run model. In OpenCode model selectors and -m, use the full provider/model form, for example routing.run/route/kimi-k2.6.

Verify

After logging in, you can verify that the endpoint is reachable:
curl -sS https://api.routing.run/v1/models \
  -H "Authorization: Bearer rk_REPLACE_ME" | head -c 800

Troubleshooting

  • Wrong host or 401 — Run opencode auth login, select routing.run, and enter a valid rk_ key from the dashboard.
  • Unknown model — Use ids from the models catalog or dashboard; typos in route/… ids return INVALID_MODEL from the API.
  • Credential not found — Run opencode auth list to check if the routing.run credential is stored. If not, run opencode auth login again.
Published model IDs are listed on the models page. Exact access depends on your plan tier and the dashboard; common picks:
ModelUse case
route/step-3.5-flashBest StepFun model for fast agent work
route/step-3.5-flash-2603StepFun fallback or alternate release
route/kimi-k2.6Best default for agentic and tool-heavy flows
route/kimi-k2.6-precisionHigher-precision Kimi choice
route/glm-5.1Strong GLM default
route/glm-5.1-precisionStrongest GLM reasoning-first choice