Skip to main content
OpenCode loads the current Compose text-generation catalog dynamically from:
No models are hardcoded. The endpoint generates the model map from the live catalog on every request.

Setup

1. Copy-paste this config

~/.config/opencode/opencode.json:
No models and no API key are listed — models are fetched dynamically and the key is added via /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)

This creates a 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:
Select compose-market, then enter your Compose Key (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

Run /models and all Compose text-generation models appear in the picker.

How it works

  1. opencode auth login fetches /.well-known/opencode, which returns an auth field and a config field. The config field contains the provider definition (without apiKey) plus all text-generation models from the live catalog.
  2. OpenCode stores a wellknown-type auth entry in ~/.local/share/opencode/auth.json.
  3. On every startup, OpenCode re-fetches /.well-known/opencode and deep-merges the config as the base layer (lowest precedence). Your local opencode.json overrides it.
  4. The /connect-stored key is injected as options.apiKey at SDK resolution time, since the remote config does not include apiKey.
During a tool turn, OpenCode reconstructs each Responses function call by output-item ID and uses the separate 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.

Debug

If OpenCode starts but a model call fails, check the response headers:
They show which catalog row the request reached.