OpenClaw Reference (Mirrored)

OpenCode

Mirrored from OpenClaw (MIT)
This mirror is provided for convenience. OpenClawdBots is not affiliated with or endorsed by OpenClaw.

OpenCode

OpenCode exposes two hosted catalogs in OpenClaw:

CatalogPrefixRuntime provider
Zenopencode/...opencode
Goopencode-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

Zen catalog

Best for: the curated OpenCode multi-model proxy (Claude, GPT, Gemini).

  1. Run onboarding
    openclaw onboard --auth-choice opencode-zen
    

    Or pass the key directly:

    openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY"
    
  2. Set a Zen model as the default
    openclaw config set agents.defaults.model.primary "opencode/claude-opus-4-6"
    
  3. Verify models are available
    openclaw models list --provider opencode
    
Go catalog

Best for: the OpenCode-hosted Kimi, GLM, and MiniMax lineup.

  1. Run onboarding
    openclaw onboard --auth-choice opencode-go
    

    Or pass the key directly:

    openclaw onboard --opencode-go-api-key "$OPENCODE_API_KEY"
    
  2. Set a Go model as the default
    openclaw config set agents.defaults.model.primary "opencode-go/kimi-k2.5"
    
  3. Verify models are available
    openclaw models list --provider opencode-go
    

Config example

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

Catalogs

Zen

PropertyValue
Runtime provideropencode
Example modelsopencode/claude-opus-4-6, opencode/gpt-5.4, opencode/gemini-3-pro

Go

PropertyValue
Runtime provideropencode-go
Example modelsopencode-go/kimi-k2.5, opencode-go/glm-5, opencode-go/minimax-m2.5

Advanced notes

API key aliases

OPENCODE_ZEN_API_KEY is also supported as an alias for OPENCODE_API_KEY.

Shared credentials

Entering one OpenCode key during setup stores credentials for both runtime providers. You do not need to onboard each catalog separately.

Billing and dashboard

You sign in to OpenCode, add billing details, and copy your API key. Billing and catalog availability are managed from the OpenCode dashboard.

Gemini replay behavior

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 replay behavior

Non-Gemini OpenCode refs keep the minimal OpenAI-compatible replay policy.

TIP

Entering one OpenCode key during setup stores credentials for both the Zen and Go runtime providers, so you only need to onboard once.