Setup
1. Copy-paste this config
~/.config/opencode/opencode.json:
/connect. The provider uses @ai-sdk/openai which routes requests through the OpenAI Responses API (/v1/responses), matching Compose’s native streaming inference pipeline.
The generated remote config marks parallelToolCalls: true only on models whose compiled catalog semantics declare parallel tool support. Models without that capability are not advertised as parallel-capable.
2. Authenticate (one-time)
wellknown auth entry that tells OpenCode to fetch the remote config from /.well-known/opencode on every startup. The command does not store your Compose Key — it only registers the endpoint for dynamic model discovery.
3. Add your Compose Key
In the OpenCode TUI, run:compose-...). The key is stored in ~/.local/share/opencode/auth.json and injected automatically on every request.
When a key expires, run /connect again and enter a new key — no re-auth needed.
4. Start OpenCode
/models and all Compose text-generation models appear in the picker.
How it works
opencode auth loginfetches/.well-known/opencode, which returns anauthfield and aconfigfield. Theconfigfield contains the provider definition (withoutapiKey) plus all text-generation models from the live catalog.- OpenCode stores a
wellknown-type auth entry in~/.local/share/opencode/auth.json. - On every startup, OpenCode re-fetches
/.well-known/opencodeand deep-merges the config as the base layer (lowest precedence). Your localopencode.jsonoverrides it. - The
/connect-stored key is injected asoptions.apiKeyat SDK resolution time, since the remote config does not includeapiKey.
call_id when it returns the tool result. Compose preserves both identities and the complete terminal output, so multiple calls can execute concurrently and continue in one follow-up turn.
See OpenCode config precedence for details.