OpenCode
Run Claude Code's roles on OpenCode's DeepSeek, GLM, Kimi, Qwen and MiniMax models. You need an OpenCode API key.
Do this for me on this machine: connect my OpenCode subscription to sc with my API key, add a profile that uses one of its models, and check it with sc profiles. This is superclaude's own guide. Read all of it as raw Markdown first, without summarizing it: curl -fsSL "https://superclaude.io/docs/provider-opencode.md" Then: 1. Tell me in a few lines what you are going to change. 2. Do every step yourself: run the commands, edit the files, check each result. 3. Stop only for what needs me: a browser sign-in, a choice between options, a secret to paste. 4. Finish by showing it works, and tell me the one command I will use from now on. Other superclaude pages, if you need them: https://superclaude.io/llms.txt
OpenCode’s subscription serves open-weight models from several vendors behind one OpenAI-compatible URL, https://opencode.ai/zen/go. sc reaches it as the opencode endpoint with your API key, and the gateway translates each request.
-
Save your OpenCode key
printf '%s\n' '<your-opencode-key>' > ~/.opencode-go chmod 600 ~/.opencode-goThe gateway reads
~/.opencode-goon every request, so a changed key needs no restart. -
Add a profile
[profiles.flash] opus = { slug = "opencode/deepseek-v4.1-flash", reasoning = { effort = "high" } }The model id is the part of the slug after
opencode/. Theconfig.tomlthatsc systemwrites on first run already has theopencodeendpoint, so add the profile to it. -
Check the routing
sc profiles flashThe listing shows one row per role, with the model it is sent to.
-
Launch with it
sc -u flash <project> <agent>Claude Code starts with the
opusrole on DeepSeek.
This flash profile is a full gateway: every role runs on DeepSeek and your Claude login is not used (what changes). To keep Claude on the main loop and send only subagents to OpenCode, use the recommended profile, whose sonnet and haiku rows point at opencode/deepseek-v4.1-flash.
Use a profile that is already in my config
The first-run config.toml has four profiles that use the opencode endpoint, named claude-flash (the recommended one), fast, coding and research. Run sc profiles to list them, then launch one by name, for example sc -u claude-flash <project> <agent>. Edit an existing table rather than adding a second one with the same name.
My config has no opencode endpoint
Add the endpoint next to your profiles:
[endpoints.opencode]
url = "https://opencode.ai/zen/go"
format = "openai-compat"
auth = "bearer"
key_file = "~/.opencode-go"Pick a model id
OpenCode publishes its live list:
curl -s https://opencode.ai/zen/go/v1/modelsMost models use openai-compat. The Qwen *-max models need the Anthropic wire, so their row sets format = "anthropic-messages" and auth = "x-api-key" (per-model overrides). The gateway sends a thinking field for DeepSeek, GLM, Kimi, Qwen, MiniMax and MiMo ids, and none for other ids (reasoning by model).
Read the key from the environment
Replace key_file with key_csv = "${OPENCODE_API_KEY}", and keep only one of the two: a key_file that cannot be read fails the launch even when key_csv is set. The daemon expands the variable in its own environment (details).
Tell whether my key is wrong
OpenCode’s model list is public, so the launch check cannot reject a wrong key. A bad key surfaces as a 401 on the first request that reaches OpenCode.
See my OpenCode usage
sc does not meter OpenCode. sc usage lists the endpoint as usage not queryable via API key — see opencode.ai console, and the status line shows no dollar figure for it, because the endpoint has no rates table. Check your plan’s usage on opencode.ai.
Use OpenCode Zen
OpenCode Zen, the pay-as-you-go API with a different catalog, lives at https://opencode.ai/zen. Declare it as a second endpoint under another name, such as [endpoints.opencode-zen], with the same format.