Share feedback
Answers are generated based on the documentation.

OpenCode Zen

Use OpenCode Zen models with docker-agent.

Overview

OpenCode Zen is a curated gateway of tested and verified AI models provided by the OpenCode team. It offers pay-per-use access to a wide range of models — from GPT and Claude to open-source models — all through a single API key. Several free models are also available.

docker-agent includes built-in support for OpenCode Zen as an alias provider for OpenAI-compatible models. Anthropic and Google models are supported via custom provider definitions.

Setup

  1. Sign in to OpenCode Zen, add billing information, and copy your API key

  2. Set the environment variable:

    export OPENCODE_API_KEY=your-api-key
  3. Verify available models:

    curl https://opencode.ai/zen/v1/models

Usage

Inline Syntax

The simplest way to use OpenCode Zen with a free model:

agents:
  root:
    model: opencode-zen/deepseek-v4-flash-free
    description: Assistant using OpenCode Zen (free)
    instruction: You are a helpful assistant.

Named Model

For more control over parameters:

models:
  zen_model:
    provider: opencode-zen
    model: gpt-5.5
    temperature: 0.7
    max_tokens: 16384

agents:
  root:
    model: zen_model
    description: Assistant using OpenCode Zen
    instruction: You are a helpful assistant.

Available Models

Free Models

These models are available at no cost:

ModelDescription
deepseek-v4-flash-freeFree DeepSeek V4 Flash
mimo-v2.5-freeFree MiMo V2.5 model
qwen3.6-plus-freeFree Qwen 3.6 Plus model
minimax-m3-freeFree MiniMax M3 model
nemotron-3-ultra-freeFree Nemotron 3 Ultra model
north-mini-code-freeFree North Mini Code model
big-pickleFree stealth model

OpenAI-Compatible (Chat Completions)

These models use the /v1/chat/completions endpoint and work directly with the opencode-zen alias:

ModelDescription
deepseek-v4-proDeepSeek V4 Pro model
deepseek-v4-flashFast DeepSeek V4 model
glm-5.2GLM 5.2 model
glm-5.1GLM 5.1 model
glm-5GLM 5 model
kimi-k2.6Kimi K2.6 model
kimi-k2.5Kimi K2.5 model
minimax-m2.7MiniMax M2.7 model
minimax-m2.5MiniMax M2.5 model
grok-build-0.1Grok Build 0.1 model

OpenAI-Compatible (Responses API)

These models use the /v1/responses endpoint and are auto-detected by docker-agent based on the model name:

ModelDescription
gpt-5.5Latest GPT model
gpt-5.5-proGPT 5.5 Pro, highest capability
gpt-5.4GPT 5.4 model
gpt-5.4-proGPT 5.4 Pro model
gpt-5.4-miniGPT 5.4 Mini model
gpt-5.4-nanoGPT 5.4 Nano, fastest
gpt-5.3-codexGPT 5.3 Codex for coding
gpt-5.3-codex-sparkGPT 5.3 Codex Spark
gpt-5.2GPT 5.2 model
gpt-5.2-codexGPT 5.2 Codex
gpt-5.1GPT 5.1 model
gpt-5.1-codexGPT 5.1 Codex
gpt-5.1-codex-maxGPT 5.1 Codex Max
gpt-5.1-codex-miniGPT 5.1 Codex Mini
gpt-5GPT 5 model
gpt-5-codexGPT 5 Codex
gpt-5-nanoGPT 5 Nano

Anthropic-Compatible (Messages API)

These models use the /v1/messages endpoint and require a custom provider definition:

ModelDescription
claude-fable-5Claude Fable 5 model
claude-opus-4-8Claude Opus 4.8 model
claude-opus-4-7Claude Opus 4.7 model
claude-opus-4-6Claude Opus 4.6 model
claude-opus-4-5Claude Opus 4.5 model
claude-opus-4-1Claude Opus 4.1 model
claude-sonnet-4-6Claude Sonnet 4.6 model
claude-sonnet-4-5Claude Sonnet 4.5 model
claude-sonnet-4Claude Sonnet 4 model
claude-haiku-4-5Claude Haiku 4.5 model
qwen3.7-maxQwen 3.7 Max model
qwen3.7-plusQwen 3.7 Plus model
qwen3.6-plusQwen 3.6 Plus model
qwen3.5-plusQwen 3.5 Plus model

To use an Anthropic-compatible model:

providers:
  opencode-zen-claude:
    provider: anthropic
    base_url: https://opencode.ai/zen
    token_key: OPENCODE_API_KEY

models:
  claude:
    provider: opencode-zen-claude
    model: claude-sonnet-4-5

agents:
  root:
    model: claude
    description: Assistant using Claude through OpenCode Zen
    instruction: You are a helpful assistant.

Google-Compatible

These models require a custom provider definition with a Google-compatible client:

ModelDescription
gemini-3.5-flashGemini 3.5 Flash model
gemini-3.1-proGemini 3.1 Pro model
gemini-3-flashGemini 3 Flash model

To use a Google model:

providers:
  opencode-zen-gemini:
    provider: google
    base_url: https://opencode.ai/zen
    token_key: OPENCODE_API_KEY

models:
  gemini:
    provider: opencode-zen-gemini
    model: gemini-3.5-flash

agents:
  root:
    model: gemini
    description: Assistant using Gemini through OpenCode Zen
    instruction: You are a helpful assistant.

How It Works

OpenCode Zen is implemented as a built-in alias in docker-agent:

  • API Type: OpenAI-compatible (auto-detects Responses API for GPT models, Chat Completions for others)
  • Base URL: https://opencode.ai/zen/v1
  • Token Variable: OPENCODE_API_KEY

The same API key works for both OpenCode Go and OpenCode Zen — they are part of the same platform. Zen uses a pay-per-use billing model, while Go uses a fixed subscription.

For Anthropic-compatible models, docker-agent uses a custom provider pointing to the Anthropic client at https://opencode.ai/zen with the same token. For Google models, a custom provider points to the Google client at https://opencode.ai/zen (the Google SDK appends its own /v1beta/models/... path segment).

Differences from OpenCode Go

AspectOpenCode ZenOpenCode Go
BillingPay-per-use$10/month subscription
ModelsGPT-5.x, Claude, Gemini, open-sourceOpen-source only
Free modelsYes (7 models)No
Base URLhttps://opencode.ai/zen/v1https://opencode.ai/zen/go/v1

Usage Limits and Pricing

OpenCode Zen uses a pay-per-use model. See the OpenCode Zen documentation for current pricing. Automatic top-up and monthly usage limits are available from the console.

You can retrieve the full model catalog at any time:

curl https://opencode.ai/zen/v1/models