Claude Code with NekoRouter
Connect Claude Code to NekoRouter in two minutes: set ANTHROPIC_BASE_URL and your API key via environment variables or settings.json. Pay with USDT/USDC.
Claude Code is Anthropic's terminal coding agent: it reads and edits your project, runs commands and works with git. By default it talks to Anthropic directly; you can point it at NekoRouter by overriding the base URL and token.
Tested and working with ANTHROPIC_BASE_URL=https://nekorouter.cc. No Claude/Anthropic account is needed — a NekoRouter key is enough.
Before you start
- Claude Code installed (see Anthropic's official install guide).
- A NekoRouter API key — see Quickstart.
Option A: environment variables (one session)
export ANTHROPIC_BASE_URL="https://nekorouter.cc"
export ANTHROPIC_AUTH_TOKEN="YOUR_NEKO_KEY"
claude
Windows PowerShell:
$env:ANTHROPIC_BASE_URL="https://nekorouter.cc"
$env:ANTHROPIC_AUTH_TOKEN="YOUR_NEKO_KEY"
claude
Option B: settings.json (permanent)
Edit ~/.claude/settings.json (create it if missing) and merge in the env block:
{
"env": {
"ANTHROPIC_BASE_URL": "https://nekorouter.cc",
"ANTHROPIC_AUTH_TOKEN": "YOUR_NEKO_KEY"
}
}
Restart claude afterwards.
Users in Russia can also try the Russia node: ANTHROPIC_BASE_URL=https://ru.nekorouter.cc. If something doesn't work, switch back to https://nekorouter.cc.
Choosing a model
Inside Claude Code run /model, or set a default:
{ "env": { "ANTHROPIC_MODEL": "claude-sonnet-5-5" } }
Claude Code works with Claude models (e.g. claude-sonnet-5-5). Claude models currently work only in Claude Code; in SDKs and other clients choose a different model. Full list of IDs: https://nekorouter.cc/pricing.
Pricing
| Model | Input | Output | Cache read | Cache write |
|---|---|---|---|---|
| claude-opus-5-5 | 1.52 | 7.6 | 0.076 | 1.9 |
| claude-sonnet-5-5 | 0.76 | 3.8 | 0.076 | 0.95 |
| claude-haiku-4-5 | 0.38 | 1.9 | 0.038 | 0.475 |
Prices in USD per 1M tokens, as of 2026-10-29 (https://nekorouter.cc/pricing). "—" means not applicable.
Check that it works
Run claude and ask something simple. The request should appear in your NekoRouter usage log (Logs → Usage Logs).
Troubleshooting
- 401 / invalid key — check for spaces or line breaks in the key; we recommend
ANTHROPIC_AUTH_TOKEN(sent as a Bearer header); if you also have an oldANTHROPIC_API_KEYset, remove it to avoid conflicts. The error looks like{"error":{"code":"invalid_api_key","message":"Invalid token",...}}. - Asked to log in to Anthropic — the env variables weren't picked up; check settings.json syntax and restart the terminal.
- Insufficient balance — top up with USDT/USDC.
- Model not found — use the exact ID from the models page.
Still stuck? Telegram: @nekorouter_cc.