In short
Three families handle production coding work today: Claude, GPT-5.x and Gemini. The short answer by task:
- everyday work (write a function, tests, review a diff) →
claude-sonnet-5; - complex refactoring and non-obvious bugs →
claude-opus-4-5, orclaude-opus-4-8if it struggles; - questions about the whole codebase at once →
gemini-3-prowith a 1M-token context; - bulk mechanical work →
gemini-3.1-flash-lite.
Set your expectations up front: we provide an API, not an IDE plugin. Claude Code connects through our Anthropic-compatible /v1/messages; we haven't tested Cursor. Details are in "What we DON'T provide" below. Read it before you create a key.
Which AI for coding actually works
There are dozens of models that "can code" today. Only three families really hold up on production tasks: Claude from Anthropic, GPT-5.x from OpenAI and Gemini from Google. The rest are either noticeably weaker on real code or niche.
This is not a ranking with abstract scores. It's about how the models differ in practice, what they cost and how to connect an AI for coding to your project through an API.
Coding models: prices and strengths
| Model | Provider | Input, $/1M | Output, $/1M | Context |
|---|---|---|---|---|
| claude-haiku-4-5 | Anthropic | 0.77 | 4.00 | 200K |
| claude-sonnet-5 | Anthropic | 1.69 | 8.50 | 200K |
| claude-sonnet-4-5 | Anthropic | 2.68 | 13.50 | 200K |
| claude-sonnet-4-6 | Anthropic | 2.68 | 13.50 | 200K |
| claude-opus-4-5 | Anthropic | 3.74 | 18.75 | 200K |
| claude-opus-4-7 | Anthropic | 3.99 | 20.00 | 200K |
| claude-opus-4-8 | Anthropic | 4.50 | 22.50 | 200K |
| gpt-5.6-mini | OpenAI | 0.85 | 5.10 | 400K |
| gpt-5.2 | OpenAI | 1.40 | 11.20 | 400K |
| gpt-5.4 | OpenAI | 1.49 | 12.75 | 400K |
| gpt-5.6 | OpenAI | 2.13 | 12.75 | 400K |
| gpt-5.5 | OpenAI | 4.16 | 25.50 | 400K |
| gemini-3-pro | 0.75 | 5.25 | 1M | |
| gemini-3.1-pro | 1.46 | 10.20 | 1M | |
| gemini-3.1-flash-lite | 0.22 | 1.35 | 1M |
These are our prices, below the official ones, per 1M tokens. They change, and the current ones are always in the model catalog.
Claude Opus (claude-opus-4-8, claude-opus-4-7, claude-opus-4-5) is the top tier for code. This is where tasks go when the chain of reasoning matters: refactoring across several files, hunting down a non-obvious bug, making sense of an unfamiliar codebase. It's expensive: $4.50 input for 4-8. Take a look at claude-opus-4-5: $3.74 at a −25% discount, and if your task doesn't degrade on it, it's the cheapest way into the Opus class.
Claude Sonnet (claude-sonnet-5, claude-sonnet-4-6, claude-sonnet-4-5) is the workhorse and the right default for most people. On typical tasks (writing a function, covering it with tests, explaining someone else's module, reviewing a diff) the difference from Opus shows up in the bill more often than in the result. Start with claude-sonnet-5: it's newer than the previous Sonnets and almost half the price ($1.69 vs $2.68).
GPT-5.x (gpt-5.2, gpt-5.4, gpt-5.6, gpt-5.5) are strong all-rounders with a 400K context. gpt-5.2 is cheaper than Sonnet 4.x on input ($1.40), a good default candidate if you count every cent. gpt-5.6 ($2.13) is the current generation. gpt-5.5 ($4.16) is the heavy artillery for hard tasks.
Gemini 3 Pro (gemini-3-pro) costs $0.75 input with a 1M-token context, and that's its killer feature for code. A million tokens is literally the entire codebase of a mid-sized service in one request.
When the question is "where in these forty files does the invariant break", Gemini sees the links between modules, not a single file. gemini-3.1-pro ($1.46) follows the same logic but is more capable.
claude-haiku-4-5 and gemini-3.1-flash-lite handle the cheap small stuff: filling in docstrings, tagging code by category, generating batches of near-identical tests. Don't call them in for architecture.
What to pick for the task
- Write a function, tests, make sense of someone else's module →
claude-sonnet-5orgpt-5.2. - Complex refactoring, non-obvious bug →
claude-opus-4-5, and if it struggles,claude-opus-4-8. - Questions about the entire codebase →
gemini-3-pro(1M context). - Bulk mechanical code processing →
gemini-3.1-flash-liteorclaude-haiku-4-5. - Not sure → start with Sonnet and move up to Opus only where you see concrete failures.
There's no universal "best" here: on the same request, Haiku and Opus differ sixfold in price, and half the tasks are honestly solved by the cheap model. You can compare models on your own prompts in the dashboard playground without writing a single line of code.
How to connect an AI for coding to your project
All models are available through one OpenAI-compatible API and one key. Take the regular openai library and swap base_url and api_key:
from openai import OpenAI client = OpenAI( base_url="https://api.altrouter.ai/v1", api_key="ar-...", ) r = client.chat.completions.create( model="claude-sonnet-4-6", messages=[{"role": "user", "content": "Hello"}], ) print(r.choices[0].message.content)
For code it looks like this: the same client with a meaningful prompt.
diff = open("changes.patch").read() r = client.chat.completions.create( model="claude-sonnet-4-6", messages=[ {"role": "system", "content": "You are a code reviewer. Look for bugs, not style. Be brief."}, {"role": "user", "content": f"Review this diff:\n\n{diff}"}, ], max_tokens=1000, ) print(r.choices[0].message.content)
Switching models is one line: model=. That's the whole point of a single key. Running a task through Sonnet, Opus and gemini-3-pro and comparing the results takes three runs, not three sign-ups with three cards.
Where teams plug this in: diff review in CI, test generation from code, explaining legacy code in an internal bot, parsing stack traces from Sentry, converting schemas and migrations. Anywhere you already write a script, the model becomes one more function call.
To start, sign up with Google, Telegram or email. You create the ar-... key in the dashboard, and a confirmed Telegram puts $1 on your balance, enough to test everything before you pay. Payment is by Russian bank card, SBP (Russia's Faster Payments System) or crypto, with no foreign card required. How to pass the key: authentication. Parameters like max_tokens: API reference. Streaming: streaming docs.
What we DON'T provide, honestly
This section is here so you don't waste your evening.
We're not an IDE plugin. Autocomplete in the editor, "complete the line on Tab", an "explain the selection" button: that's not us. We're an API, which means you write code that calls the model.
Claude Code connects. It needs an Anthropic-compatible /v1/messages endpoint, and we've had one since October 27, 2026: 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. The full setup is in Claude Code in Russia.
We haven't tested Cursor with our API.
What works: anything that talks to an OpenAI-compatible API, which covers most libraries, frameworks and your own scripts. The rule is simple: if a tool lets you set base_url and a key, it will work after you change two lines. Tools built on the Anthropic format can use our /v1/messages.
What it costs in practice
Reviewing one 3,000-token diff with an 800-token answer:
claude-sonnet-5: 0.003 × 1.69 + 0.0008 × 8.50 = $0.012, so a hundred diffs a month cost $1.2;claude-sonnet-4-6: 0.003 × 2.68 + 0.0008 × 13.50 = $0.019;claude-opus-4-8: 0.003 × 4.50 + 0.0008 × 22.50 = $0.031.
Using top models for routine tasks multiplies the cost without a matching gain in quality. Three ways to avoid a surprise bill:
- Set
max_tokensexplicitly. Output costs 5–8 times more than input. If you don't pass the parameter, we substitute 4096. That's a safety fuse, not a setting tuned to your task. - Don't send more than you need. The whole repository in every request is input you pay for again on every call. Even with Gemini's 1M context.
- Start at the bottom. If it doesn't break on Sonnet, you don't need Opus.
Spend per key is visible in the dashboard logs, broken down by model.
Bottom line
AI for coding isn't one product. It's a choice among a dozen models for a specific task: Sonnet as the default, Opus for the hard stuff, gemini-3-pro when you need a million-token context, flash-lite for bulk work. One ar-... key opens all of them, switching costs one line, and the starting $1 for a confirmed Telegram lets you compare them on your own tasks before you pay anything.
Current prices are in the model catalog. Models by provider: Anthropic, OpenAI, Google.
FAQ
What is the best AI for coding?
Three families handle production tasks today: Claude, GPT-5.x and Gemini. Claude Opus is for tasks with a long chain of reasoning, Claude Sonnet 5 is the right default for most, GPT-5.x are strong all-rounders with a 400K context, and Gemini 3 Pro is for when you need to cover the whole codebase at once.
How much does AI for coding cost?
Per 1M input tokens: gemini-3-pro $0.75, gpt-5.2 $1.40, claude-sonnet-5 $1.69, gpt-5.6 $2.13, claude-opus-4-5 $3.74, claude-opus-4-8 $4.50. On typical tasks, the difference between the default and the flagship shows up in the bill more often than in the result. Current prices are always in the model catalog.
Why use a model with a 1M context window for code?
A million tokens is the entire codebase of a mid-sized service in one request. When the question is "where in these forty files does the invariant break", the model sees the links between modules, not a single file. On gemini-3-pro that context costs $0.75 per 1M input tokens.
Does Claude Code or Cursor work with your API?
Claude Code does: it calls an Anthropic-compatible /v1/messages, and we've had one since October 27, 2026. Set ANTHROPIC_BASE_URL=https://api.altrouter.ai and put your altrouter key in ANTHROPIC_AUTH_TOKEN; the Claude Code setup guide has the details. We haven't tested Cursor with our API.
Do you offer code autocomplete in the editor?
No, we're not an IDE plugin. Tab autocomplete and an "explain the selection" button belong to editors and their extensions. We provide an API: you write code that calls the model, or connect a tool that lets you set an OpenAI-compatible address.
Which coding model should I start with if I don't want to choose?
Start with claude-sonnet-5: it's newer than the previous Sonnets and almost half the price, $1.69 vs $2.68. Bring in Opus for what Sonnet can't handle, and leave the cheap Haiku and Flash Lite for mechanical work like docstrings and near-identical tests.