OpenCode
Browser CORS + self-hosted only
OpenCode does not allow browser-origin requests, so it requires the proxy, which only exists on self-hosted deployments. On the hosted instance there is no proxy and OpenCode can't be reached. See Compatibility and Configuration.
OpenCode offers two access lanes with different pricing and endpoints:
- OpenCode Zen: the pay-per-use gateway. Deposit a balance and pay per token; there is no monthly fee. Endpoint:
https://opencode.ai/zen/v1. - OpenCode Go: the subscription lane. A flat monthly fee with rolling usage caps. Endpoint:
https://opencode.ai/zen/go/v1.
Both lanes expose models through three different protocols, so there is no single preset; configure it per model through the Custom preset instead. The official model list, including the endpoint protocol each model expects, lives at https://opencode.ai/docs/zen/ for OpenCode Zen and at https://opencode.ai/docs/go/ for OpenCode Go.
Setup (self-hosted only):
- Preset: Custom
- Provider: pick the protocol the model speaks:
- OpenAI Compatible for models served over
/responsesor/chat/completions(e.g. DeepSeek, GLM, Kimi) - Anthropic Claude for models served over
/messages(e.g. Qwen, MiniMax)
- OpenAI Compatible for models served over
- Endpoint URL:
https://opencode.ai/zen/v1(Zen) orhttps://opencode.ai/zen/go/v1(Go), base URL only; the provider appends the path - API key: create one at https://opencode.ai/auth
- Model: type the model id (e.g.
qwen3.8-max). If the model list doesn't load, a free-text field appears. - Advanced → enable Proxy API requests through this server (OpenCode does not allow browser-origin requests)
- For OpenAI Compatible models served over
/chat/completions, enable Use old /chat/completions endpoint in Advanced. - Advanced → Custom Headers: add
x-opencode-sessionwith value$SESSION_ID. - Test Connection, Apply
The x-opencode-session header is required
You must add the x-opencode-session: $SESSION_ID custom header. OpenCode uses it to identify the conversation and enable prompt caching across your requests. Without it, requests may fail.