Claude Code

Connect Claude Code through its native Messages gateway settings.

Install and prepare

  1. Install Claude Code with the native installer below; on Windows, use the PowerShell commands below. Reopen your terminal and run claude --version.
  2. In the routerra.ai console, create an API key and copy an allowed Claude model ID. A Claude subscription login does not supply this gateway key. The selected model must support streamed Messages and tool calls.
curl -fsSL https://claude.ai/install.sh | bash
claude --version

For Windows PowerShell:

irm https://claude.ai/install.ps1 | iex
claude --version

Configure Claude settings

  1. Merge this env object into ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json), keeping your other settings. Replace both placeholders. ANTHROPIC_BASE_URL is the root, without /v1; Claude Code adds the Messages path. ANTHROPIC_AUTH_TOKEN supplies bearer authentication.
  2. Quit running Claude Code sessions, launch claude, and run /status to inspect authentication. Use /model YOUR_CLAUDE_MODEL_ID to change the model explicitly; avoid aliases that could select an unavailable model.
{
  "env": {
    "ANTHROPIC_BASE_URL": "https://routerra.ai",
    "ANTHROPIC_AUTH_TOKEN": "YOUR_API_KEY",
    "ANTHROPIC_MODEL": "YOUR_CLAUDE_MODEL_ID"
  }
}

Check the connection

Send a short prompt, then ask Claude Code to list project files to check tool use. A 401 usually means a stale token or an inherited ANTHROPIC_API_KEY; remove conflicting credentials and restart. A path 404 warrants checking for duplicated /v1. This gateway has no /v1/messages/count_tokens: /context counts may be approximate or unavailable. That limitation is separate from streaming or tool-call support.