Claude Code
Agentic coding CLI · Messages API
Claude Code speaks the Anthropic Messages protocol natively — KoRouter serves it on the Anthropic-compatible endpoint, so the whole setup is one settings block.
Base URL · Anthropic-native
https://korouter.ai
Plus an API key from Keys and a bare model ID from Models. Every price on the catalog sits below the provider's official rate — pay as you go.
Setup
Add the block below to ~/.claude/settings.json (Windows: %USERPROFILE%\.claude\settings.json). The same keys also work as environment variables.
{
"env": {
"ANTHROPIC_BASE_URL": "https://korouter.ai",
"ANTHROPIC_AUTH_TOKEN": "sk-your-key",
"ANTHROPIC_MODEL": "claude-fable-5",
"CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1",
"CLAUDE_CODE_ATTRIBUTION_HEADER": "0"
}
}claude -p "Reply with OK"If it fails
- 401 — the key belongs in
ANTHROPIC_AUTH_TOKEN, notANTHROPIC_API_KEY. - model errors —
ANTHROPIC_MODELtakes a bare ID from Models, e.g.claude-fable-5.
Troubleshooting
The failures below account for nearly every unsuccessful first connection, whatever the tool.
| Status | Symptom | Fix |
|---|---|---|
| 401 | Key missing, mistyped, or deleted | Re-copy the key from Keys and confirm which header your tool sends — Authorization: Bearer or x-api-key. |
| 403 | No credits on the account (INSUFFICIENT_BALANCE) | Add credits first. Verify buttons and test prompts inside tools fire real requests. |
| 404 | Model not found | Send the bare model ID exactly as listed on Models — no provider/ prefix in the request body. |
| 429 | Concurrency or key spend limit reached | Lower parallel requests, or raise the key's spend limit, then retry with backoff. |
The full status-code table, retry guidance, and error envelopes are in Errors & limits. Still stuck? Email support@korouter.ai with the tool name, the model ID, and the exact error text.
Other tools
Free to sign up, no monthly fee — pay as you go with credits.