Files
openclaw/docs/providers/opencode.md
mushuiyu886 891096926e fix(opencode): restore Zen model catalog (#92495)
* fix(opencode): restore Zen model catalog

* fix(opencode): restore Zen transport routing

* fix(opencode): broaden Zen fallback catalog

* fix(opencode): correct Zen family routing

* fix(opencode): route Zen MiniMax through Anthropic

* fix(opencode): filter Zen live-only catalog rows

* fix(opencode): route MiniMax through Zen chat completions

* fix(opencode): omit unverified Zen model costs

* fix(opencode): align sampled Zen costs

* fix(opencode): keep Zen cost metadata required

* fix(opencode): keep Zen docs examples resolvable

* fix(opencode): move Zen catalog to provider discovery

* test(opencode): cover Zen discovery cache isolation

* fix(opencode): add Zen GLM-5.2 catalog coverage

* test(opencode): detect Zen catalog drift

Signed-off-by: sallyom <somalley@redhat.com>

---------

Signed-off-by: sallyom <somalley@redhat.com>
Co-authored-by: sallyom <somalley@redhat.com>
2026-06-28 12:32:44 -04:00

4.6 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. OpenClaw keeps the runtime provider ids split so upstream per-model routing stays correct, but onboarding and docs treat them as one OpenCode setup.

Getting started

**Best for:** the curated OpenCode multi-model proxy (Claude, GPT, Gemini, GLM).
<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/claude-opus-4-6"
    ```
  </Step>
  <Step title="Verify models are available">
    ```bash
    openclaw models list --provider opencode
    ```
  </Step>
</Steps>
**Best for:** the OpenCode-hosted Kimi, GLM, and MiniMax lineup.
<Steps>
  <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-k2.6"
    ```
  </Step>
  <Step title="Verify models are available">
    ```bash
    openclaw models list --provider opencode-go
    ```
  </Step>
</Steps>

Config example

{
  env: { OPENCODE_API_KEY: "sk-..." },
  agents: { defaults: { model: { primary: "opencode/claude-opus-4-6" } } },
}

Built-in catalogs

Zen

Property Value
Runtime provider opencode
Example models opencode/claude-opus-4-6, opencode/gpt-5.5, opencode/gemini-3.1-pro, opencode/glm-5.2

Go

Property Value
Runtime provider opencode-go
Example models opencode-go/kimi-k2.6, opencode-go/glm-5, opencode-go/minimax-m2.5

Advanced configuration

`OPENCODE_ZEN_API_KEY` is also supported as an alias for `OPENCODE_API_KEY`. Entering one OpenCode key during setup stores credentials for both runtime providers. You do not need to onboard each catalog separately. You sign in to OpenCode, add billing details, and copy your API key. 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. Entering one OpenCode key during setup stores credentials for both the Zen and Go runtime providers, so you only need to onboard once. Choosing providers, model refs, and failover behavior. Full config reference for agents, models, and providers.