EN

Language

Our editions

Written for each audience, not translated word for word.

LLM APIs & Costs

Token prices, context windows and caching, with a cost calculator.

A data center aisle with streams of small orange data packets flowing between server racks

How LLM API pricing works

If you build software on a large language model, you pay for tokens, not for subscriptions. A token is the unit a model reads and writes, and every provider lists a price per million input tokens and a price per million output tokens. In our comparison of 16 current models from OpenAI, Anthropic, Google and DeepSeek, the list prices run from $0.10 input and $0.50 output per million tokens for the cheapest model to $10 and $50 for the most expensive. But those two numbers rarely predict the bill, and the guides in this section explain why and what to do about it.

Where to start

  1. LLM API pricing compared has a price table for the 16 models and a calculator that applies the rules each provider publishes: cached input, 50% batch discounts, long-prompt surcharges and the change to Anthropic's tokenizer. Its central example: two models that list the same $2 and $10 per million tokens can give monthly bills a few dollars apart or tens of dollars apart, depending on how the cache is priced and how many tokens the same text becomes.
  2. Prompt caching explained goes deeper into the biggest lever. It compares how OpenAI, Anthropic, Google and DeepSeek implement caching, with minimum lengths, lifetimes and read and write prices, and shows how to structure a prompt so the unchanged part comes first. In our own calculation, rereading a long document 10,000 times a month costs about 80% less when most of it is read from cache.
  3. Claude API pricing lists every Claude model's price, including Claude Haiku 5.5 and its higher rate for prompts over 100,000 tokens, and works through what one support workload costs on each model.
  4. OpenAI API pricing covers the GPT-6 models, the higher price above 272,000 prompt tokens and the Batch, Flex, Fast and Ultrafast tiers.
  5. Gemini API pricing explains what Google's free tier gives you and what it costs you in data, and the price increase for Gemini 3.8 Flash on January 1, 2027.
  6. DeepSeek API pricing covers V4.1 Flash and V4 Pro, the half-price off-peak hours, cache hits at 2% of the input price on Flash, and why DeepSeek is no longer the cheapest API per token on our sample workload.
  • Mistral API pricing lists every Mistral model, from Ministral 3 at $0.10 per million tokens to Medium 3.5 at $7.50 for output, the Mistral Large 4 sale price with no published end date, the batch and cache discounts, and the small print on preview models and aliases.
  • Batch API explained shows how to pay half for requests that can wait: the 50% discount at OpenAI, Anthropic, Google and Mistral, the 24-hour windows and the size limits of each.
  • Structured Outputs Explained: JSON Schema in Every API explains how to get valid JSON from OpenAI, Claude and Gemini with a schema, what each API supports and the mistakes that still break parsing.
  • API Rate Limits and 429 Errors: OpenAI, Claude, Gemini explains what counts toward rate limits at OpenAI, Anthropic and Google, why not every 429 is a rate limit and how to stop hitting it.
  • Chatbot cost per month prices a support chatbot on eight models at 1,000, 10,000 and 100,000 conversations a month and shows how much prompt caching saves.

If you are new to the unit behind all of this, read what a token is first: it also shows how many more tokens the same text needs in Spanish or French than in English.

The five things that move the bill

  • The model. The same task can cost two orders of magnitude more on a flagship model than on a small one. Test whether a smaller model does the job before you default to the largest.
  • Output tokens. They usually cost three to six times as much as input tokens, and reasoning models bill their hidden "thinking" as output. Long answers matter more than long prompts.
  • Caching. Repeated instructions, documents and tool definitions can be read from a cache at roughly a tenth of the input price on several providers. The catch is that only an identical prefix hits.
  • Batch processing. OpenAI, Anthropic and Google offer 50% off for work that can wait for an asynchronous result.
  • Context length. Some providers add a surcharge above a threshold, others do not. The size of the prompt itself is explained in what a context window is.

Subscription or API?

A subscription to an assistant charges a flat monthly price with usage limits. An API charges for every token and has no ceiling. For one person who works in the app, the subscription is usually simpler; for software that calls a model, the API is the only option. Our guides to ChatGPT pricing and Claude pricing show where the break-even sits for each, and a model on your own computer has no price per token at all, only the cost of the machine (see how much VRAM an LLM needs).

How we keep the prices honest

Prices change often, so these guides are reviewed monthly and each price is read from the provider's own pricing page on the date shown. The calculator's formula is covered by automated tests, and its notes say what it leaves out: cache writes, storage, long-context surcharges above 200,000 input tokens and anything that depends on your contract. We do not compare answer quality, speed or rate limits, because we have not measured them. Before you commit a budget, count the tokens of a sample of your real prompts with each provider's own tool, and add the cost of building, testing and reviewing your integration, which often exceeds the token bill.

If you are building an agent, our worked example in agents for business prices a support agent across seven models. If you are choosing how to give a model your documents, compare RAG and fine-tuning.

Other topics