> ## Documentation Index
> Fetch the complete documentation index at: https://gomodel-docs-benchmark-writeup-and-tooling.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# OpenCode Go

> Configure OpenCode Zen (Go subscription) in GoModel using an OpenAI-compatible endpoint.

[OpenCode Zen](https://opencode.ai/docs/zen/) exposes its "Go" subscription
models behind an OpenAI-compatible API. GoModel ships a native `opencode_go`
provider that defaults the base URL, so you only need an API key.

## Configure

```bash theme={null}
OPENCODE_GO_API_KEY=sk-...
```

Or in `config.yaml`:

```yaml theme={null}
providers:
  opencode_go:
    type: opencode_go
    api_key: "${OPENCODE_GO_API_KEY}"
    # Optional: override the default endpoint.
    # base_url: "https://opencode.ai/zen/go/v1"
```

The default base URL is `https://opencode.ai/zen/go/v1`. Authentication uses
`Authorization: Bearer <api_key>` with the key generated in the OpenCode Zen
console.

## Models

`GET /v1/models` proxies OpenCode Zen's model list, exposing IDs such as
`glm-5.1`, `kimi-k2.7-code`, `deepseek-v4-pro`, and `mimo-v2.5-pro`. Restrict the
advertised set with a configured list when you only want a subset:

```bash theme={null}
OPENCODE_GO_MODELS=glm-5.1,kimi-k2.7-code,deepseek-v4-pro
```

## Endpoints

OpenCode Zen serves most models on OpenAI-style `/chat/completions` (Bearer
auth) and a few models only on the Anthropic-native `/messages` endpoint
(`x-api-key` auth). GoModel routes per model:

* **OpenAI-style models** (GLM, Kimi, DeepSeek, MiMo, MiniMax, most Qwen) go to
  `/chat/completions`. `/models` and `/v1/responses` (translated to chat
  completions) use the same path.
* **Anthropic-only models** are translated to the Anthropic Messages dialect and
  sent to `/messages`, mirroring how GoModel already serves native Anthropic.
  Both paths normalize to the same OpenAI-compatible response, so clients see
  one consistent surface regardless of which model they pick — whether they call
  `/v1/chat/completions` or `/v1/messages`.

The set of `/messages`-only models is currently maintained manually (default:
`qwen3.7-max`) because OpenCode Zen does not yet expose per-model endpoint
metadata. Override it when needed:

```bash theme={null}
OPENCODE_GO_MESSAGES_MODELS=qwen3.7-max
```

<Note>
  This manual split is temporary and will be replaced by metadata-driven routing
  once the upstream model list distinguishes endpoints.
</Note>

## Not supported

* Embeddings (returns `invalid_request_error`).
