Claude Code · API key

Claude Code API key and custom base URL

Create an account, top up your balance and point Claude Code at LLM Router with one command or two environment variables. You do not need an Anthropic account; requests are billed per token.

ANTHROPIC_BASE_URLplus your llmr_ key
from $3SBP, cards, crypto
15models in the catalog
Install
$ curl -fsSL https://llm-router.org/i/cc.sh | bash
PS> irm https://llm-router.org/i/cc.ps1 | iex

The installer asks for your API key, installs Claude Code if needed and writes ~/.claude/settings.json. It needs Node.js LTS.

Setup

2

Top up your balance

From $3. You are billed only for the tokens you use.

Top up from $3 →
3

Create a key and run the installer

Create the key in the dashboard (it starts with llmr_), then run the installer and paste it. If Claude Code is already installed, only its config is updated.

macOS / Linux

curl -fsSL https://llm-router.org/i/cc.sh | bash

Windows

irm https://llm-router.org/i/cc.ps1 | iex
4

Or set the variables yourself

Same result without the installer.

macOS / Linux

export ANTHROPIC_BASE_URL="https://llm-router.org"
export ANTHROPIC_API_KEY="llmr_YOUR_KEY"

Windows

$env:ANTHROPIC_BASE_URL="https://llm-router.org"
$env:ANTHROPIC_API_KEY="llmr_YOUR_KEY"
5

Start Claude Code

Use /model inside a session to switch models.

claude

Payment

The balance is kept in US dollars and charged per token. Minimum top-up: $3. For payments in rubles the rate is shown on the top-up page before you pay.

SBP

QR code · credited in seconds

RU cards

Visa · Mastercard · MIR

International cards

Visa · Mastercard · issued outside RU

Cryptocurrency

USDT and others

Top up from $3 →

What the installer writes

The gateway address and your key go into Claude Code’s settings. The installer also fills in the default model variables; the documentation lists them.

~/.claude/settings.json

{
  "env": {
    "ANTHROPIC_BASE_URL": "https://llm-router.org",
    "ANTHROPIC_API_KEY": "llmr_YOUR_KEY"
  }
}

Worth knowing

Extended thinking

Put think, think hard, think harder or ultrathink in a prompt to raise the thinking budget.

Applying variables

After editing ~/.zshrc or ~/.bashrc, run source on it instead of reopening the terminal.

Prices

Per 1M tokens, USD. The full list is on the pricing page.

OpenAI GPT

8 models
gpt-6-astra $4.00 in · $20.00 out
gpt-5.6-sol $1.60 in · $8.00 out
gpt-5.6-terra $0.80 in · $4.80 out

Google Gemini

3 models
gemini-3.5-flash $0.60 in · $3.60 out
gemini-3.8-flash $0.33 in · $1.65 out
gemini-3-flash $0.20 in · $1.20 out
All models and prices →

Troubleshooting

command not found: claude

Node.js LTS is missing. Install it and run the installer again.

401

The key is wrong or disabled. Copy it again from the dashboard.

402

Insufficient balance. Top up in the dashboard and retry.

Model not found

Use an id from the pricing page, or pick one with /model.

Questions

Do I need an Anthropic account to use Claude Code?

No. You register with LLM Router and use its key. Claude Code only needs the base URL and that key.

How do I pay for Claude Code usage?

Top up the balance by SBP, a Russian card (Visa, Mastercard, MIR), an international card or crypto. The minimum is $3, and usage is charged per token.

What happens when the balance runs out?

Requests are rejected with a 402 error until you top up. There is no subscription and no automatic charge.

Does Claude Code work with a custom base URL?

Yes. Set ANTHROPIC_BASE_URL to the LLM Router address and use your key; LLM Router exposes the Anthropic Messages API that Claude Code already speaks.

Do you store my prompts and code?

No. We log metadata only: model, tokens and latency. Prompt content is not stored or used for training.

See also

Create an account, top up, run one command

Registration needs an email and a password. The key is created in the dashboard once you are in.

Create an account → Top up from $3