Aadhib
ENع

SYSTEM NOTE

LLM API pricing compared for 2027: Anthropic, OpenAI, Google and open models

Per-million-token API prices for Claude, GPT-6, Gemini 4 and DeepSeek, read off each vendor's own pricing page, with the caching, batch and long-context rules that change the bill and a worked monthly estimate for one realistic workload.

"How much will the API cost?" is the first question I get once a team decides to build something on a large language model, and the honest answer is never the number on the pricing page. That number is a price per million tokens. A bill is that price multiplied by how many tokens your application actually sends and receives, minus whatever caching and batching save you, plus whatever long prompts, reasoning and data residency add.

Most comparison pages stop at the first part. They list input and output prices side by side, which tells you the order of the vendors and not much else. This article does the rest: the current list prices from Anthropic, OpenAI, Google and DeepSeek, the rules that change them, and a worked monthly estimate for one realistic workload so you can see where the money goes.

Every price below was read off the vendor's own pricing page on the publish date shown above. All prices are in US dollars per million tokens unless I say otherwise. These pages change often, and three of the prices below already have published change dates, so check the sources before you sign a budget.

The short answer

TierModelInputOutputCache read
TopClaude Fable 5.2$8$40$0.20
TopGPT-6.2 Astra$8$40$0.40
TopGemini 4 Carbon (from 1 Dec)$4$20$0.20
StrongClaude Opus 5.5$4$20$0.20
StrongGemini 4 Neon$3$15$0.15
MidClaude Sonnet 5.5$2$10$0.10
MidGPT-6.2 Sol$2$10$0.10
MidGemini 4 Hydrogen$1.50$7.50$0.075
MidGPT-6.1 Terra$1$5$0.05
MidDeepSeek V4 Pro (peak)$1.32$3.96$0.044
SmallClaude Haiku 5.5 (prompts up to 100K)$0.10$0.50$0.01
SmallGPT-6 Luna$0.10$0.50$0.01
SmallDeepSeek Flash (peak)$0.30$1.20$0.006
  • Batch processing halves the price at Anthropic, OpenAI and Google, if you can wait for the answer.
  • Caching is the biggest lever for agents and chat assistants, because they resend the same instructions on every turn.
  • Long prompts can cost more per token. OpenAI charges more above 272K input tokens, and Claude Haiku 5.5 above 100K. Anthropic's other current models do not.
  • Token counts differ between vendors, so equal list prices do not mean equal bills.

The tiers are my grouping by price, not a ranking of quality. For how the flagship models compared when the current generation launched, see Claude Opus 5.5 and GPT-6 Sol.

Anthropic: Claude API prices

Anthropic's current line-up is Fable 5.2 at the top, then Opus 5.5, Sonnet 5.5 and Haiku 5.5. Its pricing page also lists Claude Mythos 5.2 at the same price as Fable 5.2, but marks it as limited availability for organisations verified through Anthropic's programmes, so most buyers can ignore it.

ModelInputOutput5-minute cache write1-hour cache writeCache read
Fable 5.2$8$40$10$16$0.20
Opus 5.5$4$20$5$8$0.20
Sonnet 5.5$2$10$2.50$4$0.10
Haiku 5.5, prompt up to 100K$0.10$0.50$0.125$0.20$0.01
Haiku 5.5, prompt over 100K$0.50$2.50$0.625$1$0.05

Four details on that page matter more than the table.

Cache reads are unusually cheap on the newest models. Anthropic's normal rule is that a cache hit costs a tenth of the input price. On Opus 5.5 and Sonnet 5.5 it is a twentieth, and on Fable 5.2 it is a fortieth. Writing to the cache costs 1.25 times the input price for a five-minute lifetime, or twice the input price for an hour.

The full 1M token context window is billed at standard rates on the current models except Haiku 5.5. Anthropic's own example is that a 900K token request is billed at the same per-token rate as a 9K token request. Haiku 5.5 is the exception: a prompt over 100,000 tokens pays five times the rate, and the whole request is priced that way even if part of it is a cache hit.

The tokenizer changed. Anthropic says Claude 4.7 and later models use a newer tokenizer that "produces approximately 30% more tokens for the same text." If you are comparing against an old invoice from an earlier Claude model, the same text now counts as more tokens.

US-only processing costs 10% more. Setting inference_geo to US-only applies a 1.1 times multiplier to every token category. The default global routing uses standard prices.

Batch processing is half price on both input and output, so Sonnet 5.5 in a batch costs $1 input and $5 output.

OpenAI: GPT-6 API prices

OpenAI's flagship rows on its pricing page are GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra and GPT-6 Luna, with the September GPT-6 models still listed.

ModelInputOutputCached inputInput over 272KOutput over 272K
GPT-6.2 Astra$8$40$0.40$16$60
GPT-6.2 Sol$2$10$0.10$4$15
GPT-6.1 Terra$1$5$0.05$2$7.50
GPT-6 Luna$0.10$0.50$0.01$0.20$0.75

The long-context line is the one people miss. OpenAI defines short context as 272K input tokens or fewer. Above that, input doubles and output rises by half. If your application stuffs whole document sets into the prompt, model it on the second pair of columns.

OpenAI now charges for cache writes too. Its prompt caching guide says that for GPT-5.6 and later, a cache write costs 1.25 times the input rate for the default 30-minute lifetime, or 2.5 times for a 12-hour lifetime in the Responses API. Reads cost a twentieth of the input rate on GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Sol and GPT-6.1 Terra, and a tenth on most others. The minimum cacheable prompt is 1,024 tokens. The guide also makes a useful point about structure: with explicit breakpoints, content after the last breakpoint is billed at the normal input rate with no write charge, so you can avoid paying to cache the part of the prompt that changes every time.

There are more speed tiers than before. Batch is half price. For GPT-6.2 Astra, GPT-6.2 Sol, GPT-6.1 Terra and GPT-6 Luna, eligible background requests are 30% below standard with a two-hour completion window and 40% below with an eight-hour window. In the other direction, OpenAI renamed priority processing to Fast mode on 30 July 2026, and its Ultrafast tier for GPT-6.2 Astra and Sol costs three times standard through 28 February 2027 and six times from 1 March 2027.

Regional processing costs 10% more on models released on or after 5 March 2026, the same uplift as Anthropic's US-only option.

One dated item for anyone still on the older model: OpenAI's page says GPT-5.6 Sol's promotional pricing runs until 30 November 2026.

Google: Gemini API prices

Google's pricing page is the one to read most carefully this month, because two of its prices change within days of this article and a third early next year.

ModelInputOutputCache readChange already announced
Gemini 4 Carbon$2, then $4$10, then $20$0.10, then $0.20Doubles on 1 Dec 2026
Gemini 4 Argon$2, then $4$10, then $20$0.10, then $0.20Doubles on 1 Dec 2026
Gemini 4 Neon$3$15$0.15None listed
Gemini 4 Hydrogen$1.50$7.50$0.075None listed
Gemini 3.8 Flash$0.75, then $1.50$3.75, then $7.50$0.075, then $0.15Doubles on 1 Jan 2027
Gemini 3.5 Flash-Lite$0.30$2.50$0.03None listed

Output includes thinking. Google labels the output price "including thinking tokens" and states that every token the model processes is billed, including thinking tokens and the internal instructions added when you use grounding. A reasoning model that thinks for 5,000 tokens before writing a 300-token answer bills 5,300 output tokens.

Caching on Gemini 4 is implicit only. Google's page notes that explicit caching is not supported on the Gemini 4 models, so you get the discount when the service finds a repeated prefix rather than by declaring one. Gemini 3.8 Flash and 3.5 Flash-Lite also list a storage price per million tokens per hour for cached content.

Search grounding is billed separately. On Gemini 3 and newer models, the first 5,000 grounded search requests a month are free and then cost $14 per 1,000, and Google warns that one request to the model can trigger several searches.

The free tier is not for business data. Google's own summary of the free tier says content is "used to improve our products". The paid tier says it is not. Gemini 4 Carbon, Argon and Neon are not on the free tier at all.

Batch is half price here as well.

Open models: DeepSeek's API and self-hosting

"Open models" covers two different purchases: paying someone to run an open-weight model for you, or running it yourself. The cheapest first-party option I found is DeepSeek's own API. Its pricing page says the deepseek-flash model name is served by DeepSeek-V4.1-Flash, which is the MIT-licensed model I covered in the local LLM guide.

ModelInput, cache missInput, cache hitOutput
deepseek-flash, peak$0.30$0.006$1.20
deepseek-flash, off-peak$0.15$0.003$0.60
deepseek-v4-pro, peak$1.32$0.044$3.96
deepseek-v4-pro, off-peak$0.66$0.022$1.98

DeepSeek's pricing has a feature none of the others do: a time-of-day rate. Peak hours are 01:00 to 04:00 and 06:00 to 10:00 UTC, Monday to Friday, excluding Chinese public holidays, and every other hour is off-peak at half price. In Saudi time, which is UTC+3, peak is 04:00 to 07:00 and 09:00 to 13:00 on weekdays. A Gulf business doing its heaviest work in the afternoon and evening would mostly pay the off-peak rate.

Price is not the only question with any API vendor, and it matters more when the data is personal or commercially sensitive. Read the vendor's data terms and know where requests are processed before you send anything you would not want stored abroad. If the data cannot leave your building, the alternative is to run an open-weight model on your own hardware, where the cost is the machine and the electricity rather than tokens. I cover that in How to run an LLM locally.

What a real workload costs: a worked example

List prices only become useful once you multiply them out. Here is a hypothetical but typical shape: an internal assistant or customer-facing agent handling 50,000 requests a month. Each request carries an 8,000-token fixed prefix (system prompt, tool definitions and reference text), 2,000 tokens of fresh input (the question and recent conversation), and produces 600 output tokens. These are illustrative figures I chose to show the arithmetic, not measurements from any system.

That gives, per month:

  • 400M prefix tokens (50,000 × 8,000)
  • 100M fresh input tokens (50,000 × 2,000)
  • 30M output tokens (50,000 × 600)

Without caching, on Claude Sonnet 5.5 or GPT-6.2 Sol: 500M input tokens at $2 is $1,000, and 30M output tokens at $10 is $300. Total $1,300 a month.

With caching, assuming traffic is steady enough to keep the prefix warm so nearly every request is a cache hit: 400M cached tokens at $0.10 is $40, 100M fresh tokens at $2 is $200, and output is still $300. Total $540 a month. A single cache write of the 8,000-token prefix costs $0.02 on Sonnet 5.5's five-minute rate, so writes are a rounding error unless your traffic is so sparse the cache keeps expiring.

The same workload, cached, across the line-up:

ModelCached prefixFresh inputOutputMonthly total
Claude Fable 5.2$80$800$1,200$2,080
GPT-6.2 Astra$160$800$1,200$2,160
Claude Opus 5.5$80$400$600$1,080
Gemini 4 Carbon (from 1 Dec)$80$400$600$1,080
Gemini 4 Neon$60$300$450$810
Claude Sonnet 5.5$40$200$300$540
GPT-6.2 Sol$40$200$300$540
Gemini 4 Hydrogen$30$150$225$405
GPT-6.1 Terra$20$100$150$270
deepseek-v4-pro, peak$17.60$132$118.80$268.40
deepseek-flash, peak$2.40$30$36$68.40
Claude Haiku 5.5$4$10$15$29
GPT-6 Luna$4$10$15$29

Three things stand out.

Output is most of the bill. On every model from Sonnet 5.5 upwards, output tokens cost more than all the input combined, even though there are far fewer of them. A model that reasons at length, or a prompt that invites long answers, moves the total more than any input saving. Set a sensible output limit and an effort level that suits the task.

Caching more than halves the mid-tier bill, from $1,300 to $540 in this example. That only happens if the fixed part of the prompt comes first and stays byte-for-byte identical between requests. Put the timestamp, the user's name and anything else that changes after it.

The spread is enormous. The same workload costs $29 on the small models and over $2,000 on the top tier. The money is not in choosing the cheapest vendor. It is in sending each task to the cheapest model that does it well enough, which is what model routing is for. I explain how agents are put together in What is an AI agent?.

Two caveats on the table. First, it assumes each vendor counts the same text as the same number of tokens, which is not true: tokenizers differ, and Anthropic says its own newer tokenizer produces about 30% more tokens than its older one. Second, it ignores reasoning tokens, which can multiply the output column on hard tasks. Treat it as a way to compare the shape of the costs, not as a quote.

How I would estimate and choose

  1. Price the task, not the token. Pick 50 to 100 real requests, anonymised, run them through each candidate model, and read the input, cached, output and reasoning token counts from the usage data each API returns. Multiply by the prices above. That number is worth more than any comparison table, including this one.
  2. Start from the mid tier. Sonnet 5.5 and GPT-6.2 Sol share a price, so test both on quality and pick on results. Move a task type up to Opus, Fable or Astra only where your own tests show the cheaper model failing, and down to Haiku, Luna or Terra where it succeeds easily.
  3. Design for caching from day one. Fixed content first, variable content last, and check the cache hit rate in the usage data after launch.
  4. Batch anything that can wait. Overnight summaries, document classification and evaluation runs do not need an answer in seconds, and half price is half price.
  5. Budget on the later price. Where a vendor has published a price change, as Google has for Gemini 4 Carbon, Argon and 3.8 Flash, plan on the new rate. Add 10% if you need regional or US-only processing.
  6. Decide where the data may go before you compare prices. For companies in the Gulf the cheapest API is irrelevant if the data cannot leave the country. See AI tools for businesses in Saudi Arabia in 2027 for in-Kingdom options, and the best AI tools for 2027 if what you need is a subscription rather than an API.

None of this is a reason to delay a project. It is a reason to spend a day measuring before you commit. A cost estimate built on your own usage data is the difference between a budget that holds and one that needs explaining in month three.

If you are planning an agent or AI feature and want the architecture, model routing and cost model worked out before you build, that is what I do in AI agent development.

Sources

  1. 01PricingAnthropic
  2. 02API pricingOpenAI
  3. 03Prompt cachingOpenAI
  4. 04Gemini Developer API pricingGoogle
  5. 05Models and pricingDeepSeek

If this was useful, follow what I’m building.

All notes →

Projects and case studies

All notes