Skip to content
Home

Claude Code

Claude Code can connect directly through the OdiRouter compatible proxy. Set ANTHROPIC_BASE_URL and ANTHROPIC_AUTH_TOKEN, then start Claude Code.

RequirementValue
Claude CodeInstalled and working with its native setup
Anthropic Base URLhttps://www.odirouter.ai
Messages endpointhttps://www.odirouter.ai/v1/messages
Auth tokenOdiRouter API key
ModelA Claude Code model mapping supported by OdiRouter

Set these before starting Claude Code:

Окно терминала
export ANTHROPIC_BASE_URL="https://www.odirouter.ai"
export ANTHROPIC_AUTH_TOKEN="YOUR_API_KEY"

Do not commit a real API key to repository config. Keep it in your shell profile, local environment manager, or CI secrets.

If your Claude Code version reads ANTHROPIC_API_KEY instead of ANTHROPIC_AUTH_TOKEN, set both:

Окно терминала
export ANTHROPIC_API_KEY="${ANTHROPIC_AUTH_TOKEN}"
Окно терминала
cd /path/to/your/project
claude

Start with a read-only task:

Explain the repository structure. Do not edit files.

Claude Code uses the Anthropic-compatible Base URL. Claude Code appends the Anthropic API path, so do not paste /v1/messages here:

https://www.odirouter.ai

If you are calling the Anthropic Messages API from curl, an HTTP Request node, or another raw HTTP tool, use the full endpoint:

Окно терминала
curl -sS "https://www.odirouter.ai/v1/messages" \
-H "x-api-key: Bearer YOUR_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "Content-Type: application/json" \
-d '{
"model": "gpt-5.5",
"max_tokens": 1024,
"messages": [
{
"role": "user",
"content": "Reply with: Claude Code connected to OdiRouter"
}
]
}'
SymptomFix
Claude Code returns 401 or invalid keyCheck that ANTHROPIC_AUTH_TOKEN is a valid OdiRouter API key
Claude Code still calls official AnthropicConfirm ANTHROPIC_BASE_URL is set in the shell that starts claude
Model not foundUse a model name supported by OdiRouter or check the current proxy model mapping
Protocol or streaming errorsConfirm the Base URL is https://www.odirouter.ai, not the full /v1/messages endpoint