Can I use OpenCode Zen with Claude Code?
Not with a documented setup: OpenCode's Zen docs, now titled OpenCode Console, give no Claude Code configuration, though Zen serves Claude models on an Anthropic Messages endpoint under opencode.ai/inference that answered our test requests on October 13, 2026. OpenCode Go lists Claude Code as a validated client, but Go carries open-weight models only.
# Not documented by OpenCode. The endpoint answered our test requests
# in Anthropic's format on Oct 13, 2026; we did not run a session.
export ANTHROPIC_BASE_URL=https://opencode.ai/inference/anthropic
export ANTHROPIC_AUTH_TOKEN=YOUR_OPENCODE_KEY
export ANTHROPIC_API_KEY=""
export ANTHROPIC_MODEL=claude-sonnet-5-5
claude
Shell exports last for one terminal; put the same values in the env block of ~/.claude/settings.json to keep them. Run /status in Claude Code to check the base URL.
What OpenCode documents
| Zen (OpenCode Console) | OpenCode Go | |
|---|---|---|
| Claude Code setup | None | Listed as a validated client, no config given |
| Messages endpoint | Documented for Claude and Qwen models | Documented for its Messages-format models |
| Claude models | Yes, pay-as-you-go | No |
| Required headers | Your key | Your key, a client user agent and a session ID; Go recognizes Claude Code's own |
| Our test, October 13 | Anthropic-format errors, Bearer and x-api-key both read | Asked for a session ID, then answered in Anthropic format |
From OpenCode's Console models, inference API and Go docs, October 13, 2026. Our tests used no key or a fake key; we did not run a Claude Code session.
What a request would cost
Claude Code sessions are mostly cached reads, so Zen's cache price matters more than its headline rates. On Opus 5.5, Zen matches Anthropic's list price.
If you try it anyway
- Use the Zen model IDs from opencode.ai/zen/v1/models, such as claude-sonnet-5-5, in ANTHROPIC_MODEL; Claude Code's default names may not match.
- Set a workspace or user budget in the Console first. At the budget, new requests fail with HTTP 429 and running ones finish; at a zero balance, paid requests fail with HTTP 402.
- OpenCode's terms limit use to your own internal use, not on behalf of a third party, so agencies should check before running client work through it.
- Expect it to change without notice: an undocumented path is not a supported integration.
The catch
Zen is built and priced for OpenCode. If OpenCode is your agent, use Zen there, where it is documented; if Claude Code is your agent, a gateway that documents Claude Code will cost you fewer surprises.
Where Standard Compute fits
Standard Compute documents Claude Code on /v1/messages and keeps Claude Code's own model names, routing routine steps to efficient models inside a plan from $19 that stops at its budget. The same key works in OpenCode through models.dev. Inside OpenCode, with pay-as-you-go at cost, Zen remains a good choice.
FAQ
Does OpenCode Zen support the Anthropic Messages API?
Yes, for Claude and Qwen models: OpenCode's docs list /inference/anthropic/v1/messages and say Claude and Qwen models use the Messages API. It documents no Claude Code setup on top of it.
Can I use OpenCode Go in Claude Code?
OpenCode's Go docs list Claude Code as a validated client and say Go recognizes its native session header. Go includes open-weight models only, so Claude Code would run on those, not on Claude.
Is OpenCode Zen cheaper than the Anthropic API for Claude Code?
Not for Claude Sonnet 5.5: Zen's input and output prices match Anthropic's, but its cached-read price is $0.20 per million against Anthropic's $0.10, plus a card fee on top-ups. Opus 5.5 matches list price.
What is OpenCode Console?
The new name in OpenCode's docs for Zen, its pay-as-you-go model service; opencode.ai/docs/zen now redirects to the Console docs. The marketing page at opencode.ai/zen still uses the Zen name.