LLM APIs & Costs
Token prices, context windows and caching, with a cost calculator.

Prices & updatesData checked
How much a chatbot costs per month: three traffic levels, eight models
What a support chatbot costs in API fees on eight models at 1,000, 10,000 and 100,000 conversations a month, and how much prompt caching saves.
ExplainerData checked
API rate limits explained: tiers, 429 errors and how to avoid them
How API rate limits work at OpenAI, Anthropic and Google: RPM, TPM, usage tiers, spend caps, what a 429 error means and how to stop hitting it.
Prices & updatesData checked
OpenAI API pricing: what GPT-6 costs per token and how to pay less
OpenAI API prices per million tokens for GPT-6 Astra, GPT-6.1 Sol, GPT-6.1 Terra and GPT-6 Luna, with caching, long prompts, Batch, Fast and tools.
ExplainerData checked
Structured outputs: getting valid JSON from a language model
How structured outputs force a model to return JSON that matches your schema in OpenAI, Claude, Gemini and Ollama, what JSON Schema they accept and the limits.
Prices & updatesData checked
Claude API pricing: what every model costs and how to pay less
Claude API prices per million tokens for Haiku 5.5, Sonnet 5.5, Opus 5.5 and Fable 5.1, with caching, batch, thinking and tool costs and a worked example.
Prices & updatesData checked
Gemini API pricing: what each model costs, the free tier and the 2027 increase
Gemini API prices per million tokens for 4 Argon, 3.1 Pro, 3.8 Flash and Flash-Lite, the free tier and its catches, paid tiers, grounding and the price rises.
Prices & updatesData checked
Mistral API pricing: what every model costs per million tokens
Mistral API pricing in October 2026: Large 4 at $1.36 and $4.18 per million tokens, plus Medium 3.5, Small 4, Ministral, Codestral, Voxtral and OCR.
ExplainerData checked
Batch APIs: how to pay half for model requests that can wait
How batch APIs work in OpenAI, Claude, Gemini and Mistral: the 50% discount, 24-hour windows, size limits, retention and when a batch is the wrong choice.
CalculatorData checked
LLM API pricing compared, with a cost calculator
API prices for OpenAI, Anthropic, Google and DeepSeek models per million tokens, plus a calculator with caching, batch discounts and tokenizer differences.
ExplainerData checked
Prompt caching explained: how it works and how much it saves
What prompt caching is, how OpenAI, Anthropic, Google and DeepSeek do it, minimum lengths, lifetimes, prices and how to structure prompts to cut your API bill.
Prices & updatesData checked
DeepSeek API pricing: what V4.1 Flash and V4 Pro cost, and when it is half price
DeepSeek API prices per million tokens for V4.1 Flash and V4 Pro, with cache hits, off-peak hours, thinking tokens and a real monthly cost example.
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
- 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.
- 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.
- 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.
- OpenAI API pricing covers the GPT-6 models, the higher price above 272,000 prompt tokens and the Batch, Flex, Fast and Ultrafast tiers.
- 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.
- 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.
What to read next
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

Assistants & Chatbots
16 guides

Agents & Automation
8 guides

Local Models & Hardware
11 guides

Language Models Explained
14 guides