English
Documentation
Console
Harnesses
Claude Code

Claude Code

Use OpenCode Console models from Claude Code.

Claude Code speaks the Anthropic Messages API. Point it at Console with two environment variables and use any paid or Go model, including GPT, Gemini, and open models. Console translates the request for models that don't accept Anthropic Messages.

Note: The Console CLI sets up Claude Code with one command, including the workspace's policies, MCP servers, skills and instructions. Run npx @opencode/console setup claude-code. The steps below set it up by hand.

export ANTHROPIC_BASE_URL="https://opencode.ai/inference/anthropic"
export ANTHROPIC_AUTH_TOKEN="oc_sk_..."
claude --model claude-sonnet-5-5

Replace oc_sk_... with a personal API key.

Configure

Set the variables in ~/.claude/settings.json to use Console in every session. Map the opus, sonnet, and haiku aliases to Console models so /model and background tasks use them.

~/.claude/settings.json
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://opencode.ai/inference/anthropic",
    "ANTHROPIC_AUTH_TOKEN": "oc_sk_...",
    "ANTHROPIC_DEFAULT_OPUS_MODEL": "claude-opus-5-5",
    "ANTHROPIC_DEFAULT_SONNET_MODEL": "claude-sonnet-5-5",
    "ANTHROPIC_DEFAULT_HAIKU_MODEL": "claude-haiku-5-5"
  }
}

Claude Code appends /v1/messages to the base URL, so leave that path off. Run /status to confirm the base URL and token are active.

Note: Use ANTHROPIC_AUTH_TOKEN, not ANTHROPIC_API_KEY. If you are signed in to a Claude account, run /logout first so Claude Code doesn't send that login to Console.

Models

Use any model ID from the Console table. Switch models in a session with /model, or pick one for a single run.

claude --model gpt-6.1-sol

Console MCP

Add the Console MCP server for all your projects.

claude mcp add --transport http --scope user opencode-console https://opencode.ai/console/mcp

Run /mcp in Claude Code, select opencode-console, and sign in from the browser.