The opencode-go backend provides a single public backend name for OpenCode Go while routing requests internally across two upstream protocol flavors:
- OpenAI-compatible chat completions for most supported models
- Anthropic-compatible messages for the Minimax models that require it
This keeps client-side routing simple. You select opencode-go, and the proxy chooses the correct upstream protocol based on the model id.
OpenCode Go service details and upstream usage documentation:
Configure the backend with your OpenCode API key:
export OPENCODE_GO_API_KEY="..."You can also configure numbered variants to create conventional backend instances automatically:
export OPENCODE_GO_API_KEY_1="..."
export OPENCODE_GO_API_KEY_2="..."When numbered variants are present, the proxy discovers backend instances such as opencode-go.1 and opencode-go.2.
backends:
opencode-go:
api_key: "${OPENCODE_GO_API_KEY}"
api_url: "https://opencode.ai/zen/go/v1"
extra:
model_protocol_overrides:
# Optional escape hatch for future upstream protocol changes.
# custom-model: anthropicUse the backend with canonical model identifiers in the form:
opencode-go/opencode-model-idfor advertised model namesopencode-go:<model-id>when selecting the backend explicitly in request model strings
Examples:
opencode-go/glm-5opencode-go/glm-5.1opencode-go/kimi-k2.5opencode-go/mimo-v2-proopencode-go/mimo-v2-omniopencode-go/minimax-m2.5opencode-go/minimax-m2.7
The proxy currently routes these models through the OpenAI-compatible upstream path:
glm-5glm-5.1kimi-k2.5mimo-v2-promimo-v2-omni
The proxy currently routes these models through the Anthropic-compatible upstream path:
minimax-m2.5minimax-m2.7
If OpenCode changes protocol assignments later, you can override the built-in mapping with backends.opencode-go.extra.model_protocol_overrides.
If you provide numbered environment variables such as OPENCODE_GO_API_KEY_1 and OPENCODE_GO_API_KEY_2, the proxy creates conventional backend instances:
opencode-go.1opencode-go.2
This matches the project's standard backend-instance discovery behavior for multi-key backends. You can then target those specific instances with selectors like opencode-go.1:glm-5.1.
Example request through the OpenAI Chat Completions frontend:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "opencode-go:glm-5.1",
"messages": [{"role": "user", "content": "Explain this code."}],
"stream": true
}'Example request targeting a model that the proxy routes through the Anthropic-compatible upstream path:
curl -X POST http://localhost:8000/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "opencode-go:minimax-m2.7",
"messages": [{"role": "user", "content": "Summarize the design tradeoffs."}]
}'