RavenRouter × Claude Code
Claude Code Integration
Point Claude Code at RavenRouter via the Anthropic Messages API (/v1/messages).
Before you start
- Create an API key in Console → API Keys.
- Pick a model from GET /v1/models that your plan allows.
API base URL: https://api.ravenrouter.aiClaude Code uses the Anthropic API; requests go to /v1/messages.
Setup steps
- Create an API token in the console.
- Set ANTHROPIC_BASE_URL to your RavenRouter API root (without /v1/messages).
- Set ANTHROPIC_AUTH_TOKEN or ANTHROPIC_API_KEY to your console token.
- Use a Claude model your account can access (e.g. claude-sonnet-4-20250514).
- Launch Claude Code; requests go to POST /v1/messages.
Connection summary
# Anthropic Messages API
Base URL: https://api.ravenrouter.ai
API Key: <YOUR_RAVENROUTER_TOKEN> (x-api-key header)
Model: claude-sonnet-4-20250514Configuration example
# macOS / Linux (~/.zshrc or ~/.bashrc)
export ANTHROPIC_BASE_URL="https://api.ravenrouter.ai"
export ANTHROPIC_AUTH_TOKEN="<YOUR_RAVENROUTER_TOKEN>"
# Optional: default model
export ANTHROPIC_MODEL="claude-sonnet-4-20250514"
# Windows PowerShell
$env:ANTHROPIC_BASE_URL="https://api.ravenrouter.ai"
$env:ANTHROPIC_AUTH_TOKEN="<YOUR_RAVENROUTER_TOKEN>"Notes
- RavenRouter accepts x-api-key and Bearer auth and fills in anthropic-version when missing.
- 401 responses use Anthropic error shape for Claude Code compatibility.
- Ensure your plan/channel supports the Claude model you choose.
