> ## Documentation Index
> Fetch the complete documentation index at: https://docs.wednesdayai.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode Zen

> Connect WednesdayAI to OpenCode Zen — a curated selection of coding-optimised models.

# 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](https://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:

```bash theme={"dark"}
echo 'OPENCODE_API_KEY=sk-...' >> ~/.openclaw/.env
```

### 2. Run onboarding

```bash theme={"dark"}
openclaw onboard --auth-choice opencode-zen
```

Or non-interactive:

```bash theme={"dark"}
openclaw onboard --opencode-zen-api-key "$OPENCODE_API_KEY"
```

### 3. Configure

```json5 theme={"dark"}
{
  models: {
    providers: {
      opencode: {
        apiKey: "OPENCODE_API_KEY", // references the env var
      },
    },
  },
  agents: {
    defaults: {
      model: { primary: "opencode/claude-opus-4-6" },
    },
  },
}
```

<Note>
  `apiKey` is the name of the environment variable, not the key value itself. Keep secrets in `.env`, not in committed config files.
</Note>

<Note>
  Both `OPENCODE_API_KEY` and `OPENCODE_ZEN_API_KEY` are supported — either env var will be picked up automatically.
</Note>

## Provider settings

| Setting      | Value                                        |
| ------------ | -------------------------------------------- |
| Provider ID  | `opencode`                                   |
| Auth env var | `OPENCODE_API_KEY` or `OPENCODE_ZEN_API_KEY` |
| Billing      | Per-request via OpenCode dashboard           |

## Available models

Model availability is curated by the OpenCode team and may change. Prefix any model with `opencode/`:

```bash theme={"dark"}
openclaw models list --provider opencode
```

## Verification

```bash theme={"dark"}
openclaw models status --probe-provider opencode
```

## Troubleshooting

<AccordionGroup>
  <Accordion title="401 Unauthorized">
    Verify your API key is active in the OpenCode dashboard and that `OPENCODE_API_KEY` is set in `~/.openclaw/.env`.
  </Accordion>

  <Accordion title="Model not found">
    The Zen model catalog is curated and may not include every model. Run `openclaw models list --provider opencode` to see current availability.
  </Accordion>
</AccordionGroup>

## Related

* [AI providers overview](/admin/providers/index)
* [Reference: config](/reference/config)
