Cheapest LLM APIs for 2027
If the task is simple and the volume is high — chat, classification, extraction, sub-agents — start at the bottom of the price list:
- Claude Haiku 5.5 — $0.10 input / $0.50 output per 1M tokens for prompts up to 100K tokens; above that the whole request is billed at $0.50/$2.50.
- DeepSeek V4.1 Flash — $0.30/$1.20 at peak hours and $0.15/$0.60 off-peak; cache hits cost $0.006.
- Qwen 3 Coder Flash — $0.30/$1.50 for prompts up to 32K tokens; larger prompts move to higher bands.
- Gemini 3.8 Flash — $0.75/$3.75 through December 31, 2026, then $1.50/$7.50 from January 1, 2027.
Output tokens cost 3–6× more than input tokens on every model in the table. A model that answers in 300 tokens instead of 900 often saves more than a lower input price.
Best value for coding and agents
The $2/$10 tier is where price and capability meet in 2027: Claude Sonnet 5.5 and GPT-6.2 Sol. On Terminal-Bench 4.1 (read on November 27, 2026) Claude Code scores 63.9% with Sonnet 5.5 and 65.8% with Opus 5.5 — a 1.9-point gap for twice the price. Codex scores 61.5% with GPT-6.2 Sol and 62.1% with GPT-6.2 Astra — a 0.6-point gap for four times the price. The confidence intervals are about ±3 points, so the cheaper model is the sensible default.
The same agent workload on different models — 40K input tokens, 2.5K output tokens, 85% prompt-cache hits, 300 requests a day (9,000 a month):
| Model | Cost per request | Cost per month |
|---|---|---|
| Claude Haiku 5.5 | $0.0022 | $19.71 |
| DeepSeek V4.1 Flash | $0.0050 | $45.04 |
| DeepSeek V4 Pro | $0.0193 | $173.84 |
| Claude Sonnet 5.5 | $0.0404 | $363.60 |
| GPT-6.2 Sol | $0.0404 | $363.60 |
| Claude Opus 5.5 | $0.0808 | $727.20 |
| GPT-6.2 Astra | $0.1616 | $1,454.40 |
Agents spend most of their tokens on tool descriptions and tool results, so the set of connected tools matters as much as the model — see the MCP directory for servers worth keeping enabled.
Frontier vs open-weight models
Frontier models — Claude Opus 5.5 ($4/$20), GPT-6.2 Astra ($8/$40), Claude Fable 5.2 ($8/$40) and Gemini 4 Carbon ($4/$20 from December 1, 2026) — earn their price on long agent runs, difficult debugging and review of large changes. Watch the long-context rules: Claude keeps one price across the full 1M-token window, while GPT-6.2 Astra moves to $16/$60 once a prompt passes 272K tokens.
Open-weight models give you a second option: rent the API or run the weights yourself. Kimi K3 costs $3/$15 by API; the Qwen family starts at $0.30/$1.50. On your own hardware the limit is memory, not price per token: a 32B model at Q4_K_M needs about 21.4 GiB of VRAM (a tight fit for a 24 GB RTX 4090), a 70B model about 43.4 GiB. Check your card in the VRAM calculator.
Subscription vs API: the breakeven math
Claude subscriptions that include Claude Code cost $20 (Pro), $100 (Max) and $200 (Ultra) per month. At API list prices one agent request from the table above costs $0.0404 on Claude Sonnet 5.5, so $20 equals about 495 such requests, $100 about 2,475 and $200 about 4,950 — roughly 17, 83 and 165 requests a day.
- Below the breakeven — occasional use, spiky workloads, automation in CI — pay-as-you-go API is cheaper.
- Above it — a developer who works with an agent all day — a subscription wins, as long as the work fits its usage limits.
- For a product you still need API keys: a subscription is a seat for one person in the vendor’s own apps.
Which tool to put the seat in is a separate question — see Claude Code vs Cursor.
How to choose in 2027, and how this table was built
- Measure your traffic: tokens per request, requests per day, share of the prompt that repeats.
- Start with the $2/$10 tier and test it on your own tasks before paying frontier rates.
- Route simple calls down to Claude Haiku 5.5 or DeepSeek V4.1 Flash.
- Cache stable prefixes: cached input on Claude Sonnet 5.5 costs $0.10 instead of $2.
- Check the long-context tier before sending very large prompts: 100K tokens for Claude Haiku 5.5, 200K for Gemini 3.1 Pro, 272K for GPT-6.2.
- Check billing in your country: from Russia, DeepSeek and Qwen work without foreign billing; Anthropic, OpenAI and Google require it.
Method: every price is the vendor’s public list price per 1M tokens, read from the official pricing pages and re-checked on November 27, 2026. Taxes, batch discounts, cache-write fees and regional surcharges are left out. Benchmark figures come from the public Terminal-Bench 4.1 leaderboard. Author: Zhemal Khamidun — Head of AI at Alpina Digital, academic supervisor of the Tech Entrepreneurship Department at MIPT, creator of AlpinaGPT.
Frequently asked questions
What is the best LLM for coding in 2027?
For most teams it is Claude Sonnet 5.5: $2/$10 per 1M tokens, a 1M-token context and 63.9% on Terminal-Bench 4.1 inside Claude Code — 1.9 points behind Claude Opus 5.5 (65.8%) at half the price. GPT-6.2 Sol costs the same and scores 61.5% in Codex. Keep Claude Opus 5.5 or GPT-6.2 Astra for the hardest tasks.
Which LLM API is the cheapest in 2027?
Claude Haiku 5.5 at $0.10 per 1M input tokens and $0.50 per 1M output tokens (prompts up to 100K tokens). DeepSeek V4.1 Flash follows at $0.30/$1.20 with a −50% off-peak rate, then Qwen 3 Coder Flash at $0.30/$1.50 for prompts up to 32K tokens.
How much do 1 million tokens cost in 2027?
From $0.10 to $8 for input and from $0.50 to $40 for output, depending on the model. The mid-tier — Claude Sonnet 5.5 and GPT-6.2 Sol — costs $2 for input and $10 for output, and cached input is about 95% cheaper.
Is a subscription cheaper than paying for the API?
It depends on volume. A $200 subscription equals about 4,950 agent requests a month at Claude Sonnet 5.5 API prices (40K input tokens, 2.5K output tokens, 85% cache hits), or roughly 165 a day. Below that the API is cheaper; above it the subscription wins if you stay within its usage limits. A product still needs API keys.
Which LLM APIs work from Russia?
DeepSeek and Alibaba’s Qwen work without foreign billing: the DeepSeek API does not block Russian users, and open-weight Qwen models can be self-hosted or run on Russian clouds billed in rubles. Anthropic, OpenAI and Google do not officially serve Russia and require foreign billing; we do not recommend workarounds. A proven setup is the Hermes + DeepSeek agent.
The AI brief engineers actually read
The day’s most important AI stories — models, tools, prices and agents — in five minutes. Free, unsubscribe in one click.
