Skip to main content

OpenCode Zen

OpenCode Zen is a curated list of models recommended by the OpenCode team for coding agents. It is an optional hosted model access path using the opencode provider. Zen is currently in beta.

Prerequisites

  • An OpenCode account at opencode.ai
  • An API key from the OpenCode dashboard

Quick setup

1. Get an API key

Sign in to the OpenCode dashboard, add billing details, and copy your API key. Store it on the gateway host:
echo 'OPENCODE_API_KEY=sk-...' >> ~/.openclaw/.env

2. Run onboarding

openclaw onboard --auth-choice opencode-zen
Or non-interactive:
openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY"

3. Configure

{
  models: {
    providers: {
      opencode: {
        apiKey: "OPENCODE_API_KEY", // references the env var
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "opencode/claude-opus-4-6" },
    },
  },
}
apiKey is the name of the environment variable, not the key value itself. Keep secrets in .env, not in committed config files.
Both OPENCODE_API_KEY and OPENCODE_ZEN_API_KEY are supported — either env var will be picked up automatically.

Provider settings

SettingValue
Provider IDopencode
Auth env varOPENCODE_API_KEY or OPENCODE_ZEN_API_KEY
BillingPer-request via OpenCode dashboard

Available models

Model availability is curated by the OpenCode team and may change. Prefix any model with opencode/:
openclaw models list --provider opencode

Verification

openclaw models status --probe-provider opencode

Troubleshooting

Verify your API key is active in the OpenCode dashboard and that OPENCODE_API_KEY is set in ~/.openclaw/.env.
The Zen model catalog is curated and may not include every model. Run openclaw models list --provider opencode to see current availability.