Skip to content

OpenCode Go

Rho supports OpenCode Go as a first-party provider. Go is a Zen subscription that serves curated open coding models from https://opencode.ai/zen/go/v1.

Provider details

SettingValue
Provideropencode-go
Authopencode-go-api-key
Environment overrideOPENCODE_API_KEY
API basehttps://opencode.ai/zen/go/v1
Model sourceOpenCode Go /models
Metadatamodels.dev opencode-go

Subscribe in the OpenCode Zen console, copy the API key, and store it with Rho. Rho sends the key as a Bearer token for Chat Completions and Responses, and as x-api-key for Anthropic Messages. Do not put the key in config.toml.

Interactive login

In the TUI, run:

text
/login opencode-go

Rho stores the key and refreshes the models available on the Go gateway. Select one with /model, for example:

text
/model opencode-go/kimi-k2.7-code

Remove the stored key with:

text
/logout opencode-go

Environment and automation

For CI or development, set OPENCODE_API_KEY. It overrides a stored key.

bash
export OPENCODE_API_KEY="<api-key>"
rho --provider opencode-go \
  --auth opencode-go-api-key \
  --model opencode-go/kimi-k2.7-code \
  run "review this project"

Models and wire shape

Use /config and choose Refresh model lists to fetch the current Go catalog. Rho does not ship a baked default model; the first cached /models id is used until you pick one.

Cost, context, and reasoning controls come from models.dev under opencode-go. The same catalog names the AI SDK package for each model. Rho uses that package to choose Chat Completions, OpenAI Responses, or Anthropic Messages. New Go models work after a models.dev refresh without a Rho update, as long as they use one of those packages.

All three adapters send Rho's user agent and the required x-opencode-session routing header. Rho uses the conversation's prompt cache key to keep routing stable across turns and resumed sessions. SDK callers without a prompt cache key get a stable ID per provider instance; supply a distinct prompt_cache_key for each conversation when sharing a provider.

Use /limits to inspect the rolling 5-hour, weekly, and monthly usage windows when you are logged in.

See OpenCode's Go documentation for subscription limits and the live model list.