OpenCode Zen in Codex — Pay-Per-Use Models with Codex Router
OpenCode Zen in Codex means routing the pay-per-use half of the opencode platform into the Codex model picker through Codex Router. It shares one stored key with the flat-rate Go subscription but draws from the larger Zen catalog, including GPT models.
One provider family, two billing endpoints
opencode publishes two endpoints under one account. Codex Router treats them as a single selectable family with one key (OPENCODE_API_KEY or OPENCODE_GO_API_KEY):
| Endpoint | Billing | Base URL | Catalog |
|---|---|---|---|
| Go | Flat-rate subscription | https://opencode.ai/zen/go/v1 | Tested models ship in the registry |
| Zen | Pay-per-use | https://opencode.ai/zen/v1 | Larger live catalog, including GPT models |
There is no separate “Zen key”. One opencode account key covers both, and the OpenCode Go guide covers the subscription side in depth.
Set up Zen in Codex
Install Codex Router first (see the install guide), then store the key and enable the family:
./bin/model-router codex provider-key opencode-go set
./bin/model-router codex providers enable opencode-go
The key comes from your opencode account at opencode.ai/auth. It is stored in a protected per-user file and sent only to opencode’s own endpoints. On Windows use ./model-router.ps1 codex with the same commands, then fully quit and reopen Codex.
Curate the Zen catalog
Zen ships no preselected models, so you build the list yourself from what the account can currently see:
./bin/curate-models opencode-zen
Curation lists the models Zen advertises, lets you toggle the ones you want, and stores them in protected state. Set OPENCODE_ZEN_BASE_URL only when you need to point at a different endpoint.
Provider IDs behind one key
The catalog is split internally across several provider ids by endpoint and by the protocol each model speaks upstream:
| Provider id | Protocol | Examples |
|---|---|---|
opencode-go | Chat Completions | GLM, Kimi, DeepSeek, MiMo |
opencode-go-messages | Anthropic Messages | MiniMax and Qwen models |
opencode-go-responses | Responses | Grok 4.5 and 4.6, GPT 5.6 Luna |
opencode-zen | Zen (pay-per-use) | Curated Zen models |
They share one key and toggle together. This is why a Go selection and a Zen selection can look like different providers in the registry even though they are one credential.
Curated Zen models are split the same way. Claude lands on opencode-zen-messages, while GPT, Grok and Muse models land on opencode-zen-responses; Gemini is refused because Zen serves no matching wire for it. The variants share Go’s key and selection toggle but keep Zen’s separately billed cooldown scope. Re-curate with ./bin/curate-models opencode-zen to move existing Chat entries onto the matching wire.
The anonymous free gateway
The separate opencode-free gateway also uses the Zen endpoint, but it asks for no key. Its catalog is provider-controlled and filtered to free IDs — big-pickle and model IDs ending in -free. Availability and limits can change without notice, so treat it as a try rather than a dependency.
./bin/model-router codex providers enable opencode-free
./bin/curate-models opencode-free
Verify the integration
./bin/model-router codex doctor
./bin/model-router codex providers
./bin/test-model 'opencode-zen/MODEL_ID' --live --yes
The provider must report SHOW and ready. Fully quit Codex, reopen it, create a new task, and check the picker. For missing entries, see models missing from the picker.
FAQ
What is OpenCode Zen in Codex? OpenCode Zen is opencode’s pay-per-use endpoint. Codex Router’s opencode-zen provider routes models you curate from Zen’s live catalog into the Codex picker using the same stored key as the Go subscription.
Does Codex Router preselect Zen models? No. The Zen endpoint ships no preselected models. You curate the ones you want from its live catalog with ./bin/curate-models opencode-zen.
Are Go and Zen the same credential? Yes. Both endpoints share one stored key, and the router splits them across provider ids internally. Enabling or disabling any of them toggles the whole family together.
Related: models overview, OpenCode Go guide, installation, troubleshooting.