Claude Code
Connect Claude Code through its native Messages gateway settings.
Install and prepare
- Install Claude Code with the native installer below; on Windows, use the PowerShell commands below. Reopen your terminal and run
claude --version. - 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
- Merge this
envobject into~/.claude/settings.json(Windows:%USERPROFILE%\.claude\settings.json), keeping your other settings. Replace both placeholders.ANTHROPIC_BASE_URLis the root, without/v1; Claude Code adds the Messages path.ANTHROPIC_AUTH_TOKENsupplies bearer authentication. - Quit running Claude Code sessions, launch
claude, and run/statusto inspect authentication. Use/model YOUR_CLAUDE_MODEL_IDto 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.