Files
openclaw/docs/providers/opencode.md
Peter Steinberger 63d9c69c11 fix(opencode): discover Zen and Go models on demand (#129831)
* fix(opencode): discover provider models on demand

* fix(opencode): honor provider-scoped catalog discovery

* fix(opencode): scope Go models to authenticated catalogs

* test(opencode): verify dynamic Go models efficiently
2026-08-25 23:38:11 -07:00

6.9 KiB

summary, read_when, title
summary read_when title
Use OpenCode Zen and Go catalogs with OpenClaw
You want OpenCode-hosted model access
You want to pick between the Zen and Go catalogs
OpenCode

OpenCode exposes two hosted catalogs in OpenClaw:

Catalog Prefix Runtime provider
Zen opencode/... opencode
Go opencode-go/... opencode-go

Both catalogs use the same OpenCode API key infrastructure (OPENCODE_API_KEY, alias OPENCODE_ZEN_API_KEY). Go still requires its own paid subscription; having a Zen key does not by itself grant Go access. OpenClaw keeps the runtime provider ids split so upstream per-model routing stays correct.

Getting started

**Best for:** the curated OpenCode multi-model proxy (Claude, GPT, Gemini, GLM, DeepSeek, Kimi, MiniMax, Qwen).
<Steps>
  <Step title="Run onboarding">
    ```bash
    openclaw onboard --auth-choice opencode-zen
    ```

    Or pass the key directly:

    ```bash
    openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY"
    ```
  </Step>
  <Step title="Set a Zen model as the default">
    ```bash
    openclaw config set agents.defaults.model.primary "opencode/gpt-5.6-sol"
    ```
  </Step>
  <Step title="Verify models are available">
    ```bash
    openclaw models list --provider opencode
    ```
  </Step>
</Steps>
**Best for:** the separately subscribed Go lineup across DeepSeek, GLM, GPT, Grok, Hy3, Kimi, MiMo, MiniMax, and Qwen.
<Steps>
  <Step title="Use the bundled Go catalog">
    OpenCode Go is included with OpenClaw for this release, so no separate
    plugin installation or Gateway restart is required.
  </Step>
  <Step title="Run onboarding">
    ```bash
    openclaw onboard --auth-choice opencode-go
    ```

    Or pass the key directly:

    ```bash
    openclaw onboard --opencode-go-api-key "$OPENCODE_API_KEY"
    ```
  </Step>
  <Step title="Set a Go model as the default">
    ```bash
    openclaw config set agents.defaults.model.primary "opencode-go/kimi-k3"
    ```
  </Step>
  <Step title="Verify models are available">
    ```bash
    openclaw models list --provider opencode-go
    ```
  </Step>
</Steps>

Config example

{
  env: { vars: { OPENCODE_API_KEY: "sk-..." } },
  agents: { defaults: { model: { primary: "opencode/gpt-5.6-sol" } } },
}

Provider catalogs

Zen

Property Value
Runtime provider opencode
Example models opencode/gpt-5.6-sol, opencode/kimi-k3, opencode/gemini-3.6-flash, opencode/minimax-m3, opencode/big-pickle, opencode/x-preview-f-free

Run openclaw models list --provider opencode for the current active list, which also includes the promoted free-tier rows opencode/big-pickle, opencode/deepseek-v4-flash-free, opencode/laguna-s-2.1-free, opencode/ling-3.0-tiny-free, opencode/longcat-2.0-free, opencode/mimo-v2.5-free, opencode/nemotron-3-ultra-free, opencode/north-mini-code-free, and opencode/x-preview-f-free (Ox Alpha Free).

Live discovery combines the models available to your OpenCode account with authoritative model metadata from https://models.opencode.ai/api.json. OpenClaw fetches and caches that catalog only when OpenCode Zen or Go is configured or explicitly selected with OpenCode credentials; startup and unrelated providers never download it. New upstream models become available without an OpenClaw update. A key-scoped response can omit models unavailable to that workspace. Deprecated explicit refs remain resolvable for existing configurations but are not shown as current recommendations.

Ox Alpha Free is available for a limited time. OpenCode says this model has zero data retention and is not used for model training; see the current OpenCode Zen pricing and policy.

Go

Property Value
Runtime provider opencode-go
Example models opencode-go/kimi-k3, opencode-go/gpt-5.6-luna, opencode-go/qwen3.8-max, opencode-go/ox-alpha-free

See OpenCode Go for the full Go model table.

Advanced configuration

`OPENCODE_ZEN_API_KEY` is also accepted as an alias for `OPENCODE_API_KEY`. Entering one OpenCode key during setup can store credentials for both runtime providers. It does not create a Go subscription or grant Go entitlement; subscribe to Go in the OpenCode console before using it. Create an OpenCode account and generate an API key at [opencode.ai/auth](https://opencode.ai/auth). Billing and catalog availability are managed from the OpenCode dashboard. Gemini-backed OpenCode refs stay on the proxy-Gemini path, so OpenClaw keeps Gemini thought-signature sanitation there without enabling native Gemini replay validation or bootstrap rewrites. Non-Gemini OpenCode refs keep the minimal OpenAI-compatible replay policy. Billing, retention, and training policies are model-specific. Check the current [OpenCode Zen pricing and policy](https://opencode.ai/docs/zen/) before selecting a route. Free models may be temporary feedback programs. Full Go catalog reference. Choosing providers, model refs, and failover behavior. Full config reference for agents, models, and providers.