# OpenCode Go Model Discovery (May 2026)

## Architecture Overview

There are **two separate API surfaces** for OpenCode Go models, and they behave differently:

| Access path | Endpoint | Auth source | Build agent support | Model naming |
|---|---|---|---|---|
| OpenCode CLI (built-in) | Internal (not user-configurable) | `auth.json` → `providers.opencode.apiKey` | Only `big-pickle` | `opencode/big-pickle` |
| Direct OpenAI-compatible API | `https://opencode.ai/zen/go/v1` | Same API key, Bearer token | N/A (not CLI) | `qwen3.6-plus` (no prefix) |

The built-in `opencode` provider and the direct Zen/Go API both use `@ai-sdk/openai-compatible` internally. The Go API at `https://opencode.ai/zen/go/v1` CAN be used directly as an OpenCode custom provider — the key requirement is **dual-auth provisioning** (see the "Adding Go Models via Custom Provider" section below). A 401 error usually means the API key is missing from one of the two required locations, not a server-side block.

## Go Subscription ($10/mo) — CLI

`opencode models opencode` or `opencode models | grep "^opencode/"` shows:

```
opencode/big-pickle              ← the ONLY Go subscription model the build agent accepts
opencode/deepseek-v4-flash-free  ← free tier (no subscription needed)
opencode/minimax-m2.5-free       ← free tier
opencode/nemotron-3-super-free   ← free tier
opencode/qwen3.6-plus-free       ← free tier
```

The build agent is server-side locked to only allow `big-pickle` for Go subscribers. The `-free` models are the free tier (no API key needed). Adding models to `provider.opencode.models` in `opencode.json` makes them appear in `opencode models` but the build agent rejects them with "Model not supported."

## Go Subscription — Direct API (via Hermes opencode-go provider)

The raw Go API at `https://opencode.ai/zen/go/v1/models` returns **15 models** that all work with Bearer token auth:

```
minimax-m2.7         ← confirmed working
minimax-m2.5
kimi-k2.6
kimi-k2.5
glm-5.1
glm-5
deepseek-v4-pro
deepseek-v4-flash
qwen3.6-plus
qwen3.5-plus
mimo-v2-pro
mimo-v2-omni
mimo-v2.5-pro
mimo-v2.5
hy3-preview          ← not in Hermes catalog (added manually)
```

Smoke-test with:

```bash
curl -s --max-time 10 -H "Authorization: Bearer $KEY" \
  "https://opencode.ai/zen/go/v1/models" | python3 -c \
  "import sys,json; [print(m['id']) for m in json.load(sys.stdin)['data']]"
```

## Adding Go Models via Custom Provider (OpenCode CLI)

The Go API at `https://opencode.ai/zen/go/v1` can be added as a custom provider in `opencode.json` so all 13+ Go subscription models are available via `opencode run --model opencode-go/<model-id>`.

**Critical: dual-auth provisioning required.** The API key must be in **two places**:

### 1. Auth.json entry
Add the provider name to `~/.local/share/opencode/auth.json`:
```json
{
  "providers": {
    "opencode": { "apiKey": "sk-..." },
    "opencode-go": { "apiKey": "sk-..." }
  }
}
```

### 2. Config options
In `~/.config/opencode/opencode.json`, the same key must appear in `options.apiKey`:
```json
{
  "provider": {
    "opencode-go": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "OpenCode Go",
      "options": {
        "baseURL": "https://opencode.ai/zen/go/v1",
        "apiKey": "sk-..."
      },
      "models": {
        "qwen3.6-plus": { "name": "Qwen 3.6 Plus", "limit": { "context": 128000, "output": 65536 } },
        "minimax-m2.7": { "name": "MiniMax M2.7", "limit": { "context": 128000, "output": 65536 } },
        "kimi-k2.6":    { "name": "Kimi K2.6",    "limit": { "context": 128000, "output": 65536 } },
        ...
      }
    }
  }
}
```

**Without BOTH entries:** Omitting the `auth.json` entry → `Missing API key`. Omitting `options.apiKey` → `Invalid API key`. Both must be present.

### Verification
```bash
opencode models | grep "^opencode-go/"
opencode run 'say OK' --model opencode-go/qwen3.6-plus
```

### Models discovered by OpenCode CLI (13 of 15)
When configured correctly, these models appear in `opencode models`:
`qwen3.6-plus`, `qwen3.5-plus`, `minimax-m2.7`, `minimax-m2.5`, `kimi-k2.6`, `kimi-k2.5`, `glm-5.1`, `glm-5`, `deepseek-v4-pro`, `deepseek-v4-flash`, `mimo-v2.5-pro`, `mimo-v2.5`, `hy3-preview`

Two API models (`mimo-v2-pro`, `mimo-v2-omni`) are listed in the API but don't appear in `opencode models` due to OpenCode's internal model discovery filtering.

## Model Name Mapping: CLI vs Direct API

| CLI name | Direct API name | Status |
|---|---|---|
| `opencode/big-pickle` | ❌ not on API | Use via `opencode run` |
| `opencode/qwen3.6-plus-free` | `qwen3.6-plus` | ✅ works via Hermes |
| `opencode/minimax-m2.5-free` | `minimax-m2.7` | ✅ works via Hermes |
| `opencode/deepseek-v4-flash-free` | ❌ not on API | Free tier, not Go sub |
| `opencode/nemotron-3-super-free` | ❌ not on API | Free tier, not Go sub |
| (not in CLI) | `kimi-k2.6`, `glm-5.1`, etc. | ✅ Go sub, Hermes only |

**Key rule:** Model names with the `opencode/` prefix are CLI-only. Short bare names are API-only. Never use the `opencode/` prefix when hitting the direct API.

## Hermes Integration

The `opencode-go` provider in Hermes taps the same Go subscription via `https://opencode.ai/zen/go/v1`. To configure:

```bash
# 1. Copy key from OpenCode's auth store
export KEY=$(python3 -c "import json; print(json.load(open('$HOME/.local/share/opencode/auth.json'))['providers']['opencode']['apiKey'])")

# 2. Add to Hermes .env
sed -i '/^OPENROUTER_API_KEY=/a OPENCODE_GO_API_KEY='"$KEY" ~/.hermes/.env

# 3. Register provider in config.yaml
#    providers:
#      opencode-go:
#        api_key_env: OPENCODE_GO_API_KEY
#        base_url: https://opencode.ai/zen/go/v1

# 4. Use in-session
hermes chat -q "test" --provider opencode-go -m qwen3.6-plus
```

## Zen Free Models (No Subscription Required)

The Zen API at `https://opencode.ai/zen/v1` also hosts **3 free models** that don't require any Go subscription — just the same OpenCode API key:

- `deepseek-v4-flash-free` ✅
- `minimax-m2.5-free` ✅
- `nemotron-3-super-free` ✅

Other models listed at the Zen endpoint (`ring-2.6-1t-free`, `trinity-large-preview-free`, `qwen3.6-plus-free`) are either defunct or require Go credits. Only the 3 above work as true free models as of May 2026.

### Adding Zen Free Models as a Custom Provider (OpenCode CLI)

Same dual-auth pattern as the Go provider:

**auth.json:**
```json
{
  "providers": {
    "opencode-zen": { "apiKey": "sk-..." }
  }
}
```

**opencode.json:**
```json
{
  "provider": {
    "opencode-zen": {
      "npm": "@ai-sdk/openai-compatible",
      "name": "OpenCode Zen (Free)",
      "options": {
        "baseURL": "https://opencode.ai/zen/v1",
        "apiKey": "sk-..."
      },
      "models": {
        "deepseek-v4-flash-free": { "name": "DeepSeek V4 Flash (Free)", "limit": { "context": 128000, "output": 65536 } },
        "minimax-m2.5-free":     { "name": "MiniMax M2.5 (Free)",     "limit": { "context": 128000, "output": 65536 } },
        "nemotron-3-super-free": { "name": "Nemotron 3 Super (Free)", "limit": { "context": 128000, "output": 65536 } }
      }
    }
  }
}
```

**Use:** `opencode run "..." --model opencode-zen/deepseek-v4-flash-free`

### Adding Zen Free Models as a Hermes Custom Provider

**In config.yaml, under `custom_providers:`:**
```yaml
- base_url: https://opencode.ai/zen/v1
  api_key_env: OPENCODE_ZEN_API_KEY
  models:
    deepseek-v4-flash-free:
      context_length: 128000
    minimax-m2.5-free:
      context_length: 128000
    nemotron-3-super-free:
      context_length: 128000
  name: zen-free
```

**In .env:**
```
OPENCODE_ZEN_API_KEY=sk-...
```

**Use in Hermes:** `/model custom:zen-free/deepseek-v4-flash-free`

**Important:** Do NOT register `opencode-zen` as a standard provider in the `providers:` section — that pulls in Hermes' built-in catalog which lists paid Go/Zen models the user doesn't want in the picker. Use `custom_providers` with an explicit model list to keep only the free ones.

## Recommendation

| Use case | Path | Model |
|---|---|---|
| Multi-file refactors, PRs | `opencode run -m opencode/big-pickle` | `big-pickle` (CLI-only) |
| Chat, quick tasks, tool use | `/model opencode-go/qwen3.6-plus` | Any Go API model |
| Premium cloud models | `openrouter/~anthropic/claude-sonnet-latest` | OpenRouter
