In short
The Claude API is pay-per-token, not a subscription. A claude.ai subscription doesn't give you an API key, and the reverse is true as well: these are two separate products.
Getting a key directly from Anthropic requires a foreign bank card. Through altrouter you get a key in a minute, pay with a Russian bank card, SBP (Russia's Faster Payments System) or crypto, and call Claude with the regular openai library — only base_url and the key change.
The real decision isn't "how do I get a key" but which model to use: the same request costs about six times more on Opus than on Haiku.
What the Claude API is and why you need it
The Claude API is programmatic access to Anthropic's models: you send an HTTP request with text, get the model's response back and pay for tokens. It isn't a web chat or a subscription. There's no interface and no "messages per day" cap — just a counter of tokens spent, and your code.
The difference is fundamental. A claude.ai subscription is a person's access to a chat. The Claude API is your application's access to the model: a support bot, product descriptions, email triage, code review in CI. Neither replaces or includes the other: the subscription doesn't come with an API key, and the key doesn't come with the web chat.
Below: how to get a key, what the models actually cost, a working Python example, and how Opus differs from Sonnet and Haiku.
How to get a Claude API key
The classic route is the Anthropic Console: sign up, attach a card, create a key. There's exactly one problem, and anyone who has tried it from Russia knows it: you need a foreign card, and payment is the one step you can't get past by being careful.
The second route is altrouter. We give you one OpenAI-compatible key for every Claude model at once, paid with a Russian bank card, SBP or crypto — no foreign card required.
- Sign up: /login?mode=signup — Google, Telegram or email. Through the @altrouter_bot bot it's a single step.
- Create a key in your dashboard. It looks like
ar-.... - Confirm your Telegram — that adds $1 to your balance. It's enough to run your first requests and make sure everything works before you pay anything.
- Put the key and base URL into your code (example below).
Headers and authentication are covered in the authentication docs.
A separate word on the common "claude api free" question: a completely free Claude API doesn't exist, neither at Anthropic nor with us. Tokens cost money. The starting $1 is a test drive, not a plan.
Claude API pricing
Pricing is per 1M tokens, separately for input (what you send) and output (what the model generates). Output always costs more than input — about five times more.
| Model | Input, $/1M | Output, $/1M | Context | Discount vs official |
|---|---|---|---|---|
| claude-haiku-4-5 | 0.77 | 4.00 | 200K | −20% |
| claude-sonnet-5 | 1.69 | 8.50 | 200K | −15% |
| claude-sonnet-4-5 | 2.68 | 13.50 | 200K | −10% |
| claude-sonnet-4-6 | 2.68 | 13.50 | 200K | −10% |
| claude-opus-4-5 | 3.74 | 18.75 | 200K | −25% |
| claude-opus-4-6 | 3.99 | 20.00 | 200K | −20% |
| claude-opus-4-7 | 3.99 | 20.00 | 200K | −20% |
| claude-opus-4-8 | 4.50 | 22.50 | 200K | −10% |
| claude-fable-5 | 8.50 | 42.50 | 200K | −15% |
These are our prices: they're lower than the official ones, and the discount differs from model to model. Prices change, so the source of truth is the model catalog, not this page. A model's own page, for example claude-opus-4-8, always shows the current numbers and parameters.
Let's do the math, because "$4.50 per million" is hard to picture. Take a typical request: 2,000 input tokens, 500 output tokens.
claude-opus-4-8: 0.002 × 4.50 + 0.0005 × 22.50 = $0.020claude-haiku-4-5: 0.002 × 0.77 + 0.0005 × 4.00 = $0.0035
That's almost a sixfold difference.

That gap is the reason to read the next section instead of defaulting to Opus.
Working example: Claude API in Python
On our side, Claude models run through an OpenAI-compatible endpoint. That means the regular openai library works — you swap base_url and api_key, nothing else:
from openai import OpenAI client = OpenAI( base_url="https://api.altrouter.ai/v1", api_key="ar-...", ) r = client.chat.completions.create( model="claude-opus-4-8", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content)
To switch models you change one line: model="claude-haiku-4-5" — and the same code suddenly costs six times less. Keep the key in an environment variable, of course, not in the repository.
The same trick works in JS: the openai library, the same two fields. Token-by-token streaming is described in the streaming docs, parameters like temperature and max_tokens in the API reference, and error codes in the errors docs.
The endpoints that actually exist: POST /v1/chat/completions (text), POST /v1/images/generations (images), POST /v1/videos (video) and GET /v1/models (model list). For Claude only the first one applies — Anthropic doesn't make images or video.
Opus, Sonnet, Haiku: which to choose
Claude's three lines aren't "good, average and bad". They're three points on a curve of price versus depth of reasoning. The context is the same for all of them: 200K tokens.
Haiku (claude-haiku-4-5, $0.77 / $4.00) is fast and cheap. Use it for volume where the task can be formalized: ticket classification, extracting fields from text, short answers that follow instructions, moderation, tagging. If you run hundreds of thousands of requests a day, Haiku is the only row in the table that won't ruin you.
Sonnet (claude-sonnet-5 at $1.69 / $8.50, claude-sonnet-4-5 and 4-6 at $2.68 / $13.50) is the workhorse. Meaningful text generation, user-facing dialogue, work on mid-size code, summarizing long documents. In most product scenarios Sonnet is the right default: unless the task needs a long chain of reasoning, Opus stands out more in price than in results. Note the claude-sonnet-5 row — it's newer and yet almost half the price of the previous Sonnets.
Opus (claude-opus-4-5, 4-6, 4-7, 4-8, from $3.74 to $4.50 input) is maximum quality. Complex refactoring, analyzing a large codebase, analytics with multi-step reasoning, tasks where a mistake costs more than the tokens.
Within the line, 4-8 is the newest and the most expensive, while 4-5 is cheaper and discounted by 25%. If your particular task doesn't degrade on it, that's the best price for Opus-class quality in the table.
Fable (claude-fable-5, $8.50 / $42.50) is the most expensive row in the catalog and a separate branch of the family, not "Opus, but better". It makes sense once you've already hit the Opus ceiling on your task and can measure it.
How to choose without guessing
A practical method: take 20 real requests from your task and run them from the bottom up.
- Start with Haiku. If it holds up, you've just saved sixfold.
- If it breaks, move up to Sonnet and repeat.
- Get to Opus deliberately, not out of respect for the name.

You can run this comparison in the playground in your dashboard without writing a single line of code.
All Anthropic models in the catalog are on the Anthropic provider page.
Claude Code, honestly
Next to "claude api" in search there's always "claude code api key". The straight answer: Claude Code connects through altrouter as of October 27, 2026. It needs an Anthropic-compatible /v1/messages endpoint, and we have one: set ANTHROPIC_BASE_URL=https://api.altrouter.ai, put your ar-... key in ANTHROPIC_AUTH_TOKEN and the model in ANTHROPIC_MODEL, for example claude-sonnet-5.5.
Anything that can talk to an OpenAI-compatible API (the vast majority of libraries, frameworks and home-grown scripts) works with us by changing two lines, and tools built on the Anthropic format work through /v1/messages.
The bottom line
The Claude API is tokens and HTTP, not a subscription. You get a key in a minute, the starting $1 for a confirmed Telegram lets you test your idea before paying, and from there everything comes down to model choice: on the same request, Haiku and Opus differ sixfold in cost.
One ar-... key opens not only Claude but also OpenAI and Google models — switching between them takes exactly one model= line. Current prices and limits are in the model catalog and the limits docs.
FAQ
How do I get a Claude API key from Russia?
Directly in the Anthropic Console you need a foreign card — that's the one step you can't get past by being careful. Through a gateway with an OpenAI-compatible API, the key is issued in a minute, you pay with a Russian bank card, SBP or crypto, and you call Claude with the regular openai library — only base_url and the key change.
How much does the Claude API cost?
Per 1M tokens, input and output: Haiku 4.5 — $0.77 and $4.00, Sonnet 5 — $1.69 and $8.50, Opus — from $3.74 to $4.50 input, Fable 5 — $8.50 and $42.50. Every model in the family has a 200,000-token context. The same request costs about six times more on Opus than on Haiku.
Does a claude.ai subscription include API access?
No. A subscription pays for a person's access to the web chat; the API is your application's access to the model, billed per token. They're two separate products with separate bills: the subscription doesn't give you a key, and the key doesn't give you the web chat.
Which Claude model should I use?
Haiku — for volume where the task can be formalized: classification, field extraction, moderation, tagging. Sonnet 5 — the right default for most product scenarios. Opus — where you need a long chain of reasoning and a mistake costs more than the tokens. Fable — when you've measurably hit the Opus ceiling. All of them are listed in the Anthropic catalog.
How is Claude Sonnet 5 different from earlier Sonnet models?
It's newer and yet almost half the price: $1.69 per 1M input tokens versus $2.68 for claude-sonnet-4-5 and claude-sonnet-4-6. If you aren't tied to a specific version, Sonnet 5 is the one to start with.
Does Claude Code work through your API?
Yes, as of October 27, 2026. Claude Code calls the Anthropic-compatible /v1/messages endpoint, and we have it: set ANTHROPIC_BASE_URL=https://api.altrouter.ai and your altrouter key in ANTHROPIC_AUTH_TOKEN. The full walkthrough is in Claude Code in Russia.