Dev tools
LLM API Pricing Compared: OpenAI, Anthropic, Google
LLM API pricing compared for OpenAI, Anthropic and Google: prices per million tokens, caching and batch discounts, and what a real workload costs.
LLM API pricing decides whether an AI feature makes money or loses it. Every request to a model from OpenAI, Anthropic or Google is billed by the token, with separate prices for the text you send and the text the model writes back. Prices vary by more than a hundred times between the smallest and largest models, and discounts for caching and batch processing can cut a bill in half or more.
This guide compares current API prices from the three biggest providers, explains how billing works, and shows what a realistic workload costs on each model. Prices are as listed on each provider's official pricing page in November 2026, for standard requests. They change often, so treat the numbers as a snapshot and check the official pages before you budget. If tokens are new to you, our guide to LLM tokens explains what they are and how to count them.
How LLM API Pricing Works
Almost every provider uses the same basic model:
- Input tokens: everything you send, including the system prompt, conversation history, documents and tool definitions.
- Output tokens: everything the model writes, including any reasoning tokens on models that think before answering. Output usually costs five to eight times more than input.
- Price per million tokens: prices are quoted per million tokens (often written "per 1M"). A million tokens is roughly 750,000 English words.
- Cached input: repeated input that the provider has stored can be billed at a small fraction of the normal rate.
- Batch processing: requests that can wait, typically up to 24 hours, are billed at around half price.
Some models also charge more for very long prompts, above a threshold such as 200,000 tokens, and extra features like web search or code execution can carry their own fees.
LLM API Pricing at a Glance
The tables below show standard prices in US dollars per million tokens.
Anthropic (Claude)
| Model | Input | Output | Typical use |
|---|---|---|---|
| Claude Fable 5.2 | $8.00 | $40.00 | The hardest reasoning and long agent tasks |
| Claude Opus 5.5 | $4.00 | $20.00 | Complex coding, analysis and agents |
| Claude Sonnet 5.5 | $2.00 | $10.00 | Strong all-round model for most products |
| Claude Haiku 5.5 | $0.10 | $0.50 | Fast, high-volume tasks |
Claude Haiku 5.5's prices apply to prompts up to 100,000 tokens; longer prompts cost $0.50 input and $2.50 output.
OpenAI
| Model | Input | Cached input | Output |
|---|---|---|---|
| gpt-6.2-astra | $8.00 | $0.40 | $40.00 |
| gpt-6.2-sol | $2.00 | $0.10 | $10.00 |
| gpt-6.1-terra | $1.00 | $0.05 | $5.00 |
| gpt-5.4-mini | $0.75 | $0.075 | $4.50 |
| gpt-6-luna | $0.10 | $0.01 | $0.50 |
These are OpenAI's standard prices for prompts up to 272,000 tokens.
Google (Gemini)
| Model | Input | Output | Free tier |
|---|---|---|---|
| Gemini 3.1 Pro (preview) | $2.00 | $12.00 | No |
| Gemini 3.8 Flash | $0.75 | $3.75 | Yes |
| Gemini 3.5 Flash-Lite | $0.30 | $2.50 | Yes |
Gemini 3.1 Pro's prices apply to prompts up to 200,000 tokens. Gemini 3.8 Flash has an introductory price until December 31, 2026, rising to $1.50 input and $7.50 output from January 1, 2027. Google's free tier lets you experiment with some models within rate limits, but data on the free tier may be used to improve Google's products, so check the terms before sending anything sensitive.
Comparing the Tiers
The providers line up in similar tiers:
- Frontier models (Claude Fable 5.2, gpt-6.2-astra): around $8 input and $40 output. Use them only where their extra capability clearly pays off.
- Flagship workhorses (Claude Opus 5.5, Claude Sonnet 5.5, gpt-6.2-sol, Gemini 3.1 Pro): $2 to $4 input and $10 to $20 output. Most serious products run on this tier.
- Mid-range models (gpt-6.1-terra, gpt-5.4-mini, Gemini 3.8 Flash): under $1 input and around $4 to $5 output, often fast enough for interactive features.
- Small, cheap models (Claude Haiku 5.5, gpt-6-luna, Gemini 3.5 Flash-Lite): $0.10 to $0.30 input. Ideal for classification, extraction, routing and simple chat at high volume.
Price alone doesn't tell you which is cheapest for your task. A cheaper model that needs longer prompts, more retries or more output tokens can end up costing more than a pricier one that gets it right first time. Always test on your own examples.
Cheapest LLM API Options
If cost is your main concern, the cheapest LLM API choices right now are the small models:
- Claude Haiku 5.5 and gpt-6-luna both cost $0.10 per million input tokens and $0.50 per million output tokens.
- Gemini 3.5 Flash-Lite costs $0.30 input and $2.50 output, with a free tier for experimenting.
For very simple, very high-volume work, a small open model running on your own hardware can be cheaper still once you account for scale. Our guide to small language models covers when that makes sense.
What a Real Workload Costs
Imagine a customer support assistant that handles 1,000 conversations a day. Each request sends 2,000 input tokens (instructions, history and a little retrieved context) and receives 500 output tokens. Over 30 days, that's 60 million input tokens and 15 million output tokens.
| Model | Monthly input cost | Monthly output cost | Total per month |
|---|---|---|---|
| Claude Fable 5.2 | $480 | $600 | $1,080 |
| gpt-6.2-astra | $480 | $600 | $1,080 |
| Claude Opus 5.5 | $240 | $300 | $540 |
| Gemini 3.1 Pro (preview) | $120 | $180 | $300 |
| Claude Sonnet 5.5 | $120 | $150 | $270 |
| gpt-6.2-sol | $120 | $150 | $270 |
| gpt-6.1-terra | $60 | $75 | $135 |
| gpt-5.4-mini | $45 | $67.50 | $112.50 |
| Gemini 3.8 Flash (introductory price) | $45 | $56.25 | $101.25 |
| Gemini 3.5 Flash-Lite | $18 | $37.50 | $55.50 |
| Claude Haiku 5.5 | $6 | $7.50 | $13.50 |
| gpt-6-luna | $6 | $7.50 | $13.50 |
These figures are before any caching or batch discounts, and they don't include reasoning tokens, which can add significantly to output on models that think before answering. The spread is the point: the same workload can cost under $15 or over $1,000 a month depending on the model.
Prompt Caching: The Biggest Discount Most Teams Miss
Prompt caching lets the provider store the start of a prompt that you send repeatedly, such as long instructions, tool definitions or a reference document. When the next request starts with the same content, those tokens are read from the cache at a much lower price:
- OpenAI bills cached input at about 5% of the normal input price, for example $0.40 instead of $8.00 on gpt-6.2-astra.
- Anthropic bills cache reads at about 5% of the input price, for example $0.20 per million on Claude Opus 5.5, with a small premium for writing content to the cache.
- Google bills cached input on Gemini 3.1 Pro at $0.20 per million, a tenth of the normal input price.
To benefit, put stable content at the start of the prompt and changing content, like the user's question, at the end. In our support example, if 1,500 of the 2,000 input tokens are fixed instructions, caching can cut the input bill by most of that share.
Batch API: Half Price for Work That Can Wait
All three providers offer a batch API: you submit many requests at once, and results come back within a set window, typically up to 24 hours, at around half the standard price. Batch processing suits work where nobody is waiting for an answer:
- Classifying or tagging large sets of documents.
- Generating product descriptions or summaries in bulk.
- Running evaluations on test sets.
- Overnight data processing and enrichment.
How to Estimate Your Own Costs
You can estimate any workload in a few minutes:
- Measure a typical request. Log the input and output token counts from a handful of real requests; the API response reports both.
- Estimate monthly volume. Multiply requests per day by 30.
- Calculate input cost: monthly input tokens divided by one million, times the input price.
- Calculate output cost the same way with the output price, including reasoning tokens if the model uses them.
- Apply discounts: subtract savings from cached input and from any work you can move to batch.
- Add a safety margin of 20% to 30% for retries, longer conversations and growth.
Repeat the calculation for two or three candidate models, then run the same test set through each. The cheapest option is the one that gives acceptable quality at the lowest cost per task, not the lowest price per token.
Batch and caching discounts can often be combined, which makes large offline jobs dramatically cheaper than running them one request at a time.
Hidden Costs to Watch
- Reasoning tokens: models that think before answering bill that thinking as output tokens, sometimes many times the length of the visible answer.
- Long conversations: chat apps resend the whole history each turn, so input tokens grow with every message.
- Tool definitions and retrieved context: large tool lists and many retrieved documents add input tokens to every request.
- Retries and failures: errors, timeouts and invalid outputs that you retry are billed too.
- Long-context surcharges: some models charge more once a prompt passes a size threshold.
- Extra features: web search, code execution and other built-in tools may be billed separately.
How to Cut Your LLM API Bill
- Route by difficulty: send simple requests to a small model and only hard ones to a large model.
- Cache stable prompt content and keep it at the start of the prompt.
- Use batch processing for anything that doesn't need an immediate answer.
- Trim prompts: remove unnecessary instructions, examples and history.
- Limit output length with clear instructions and maximum token settings.
- Measure cost per task, not just per token, so you can compare models fairly.
Our guide on how to reduce LLM costs covers these techniques in more depth.
Choosing a Provider on More Than Price
Price matters, but it's rarely the only factor:
- Quality on your task: run the same test set through several models and compare results, not benchmarks.
- Speed: time to first token and tokens per second matter for chat and voice products.
- Rate limits: check how many requests and tokens per minute your account allows as you grow.
- Data handling: review retention, training and regional processing options, especially on free tiers.
- Features: structured output, tool use, long context, file handling and batch support differ between providers.
- Availability: some teams use two providers so one outage doesn't take their product down.
FAQ
How is LLM API pricing calculated?
Providers charge per token, with separate prices for input tokens you send and output tokens the model generates. Prices are quoted per million tokens. Discounts apply to cached input and batch requests, and some models charge more for very long prompts.
Which is the cheapest LLM API?
As of November 2026, Claude Haiku 5.5 and OpenAI's gpt-6-luna are among the cheapest major models at $0.10 per million input tokens and $0.50 per million output tokens. Gemini 3.5 Flash-Lite is also inexpensive and has a free tier.
Why are output tokens more expensive than input tokens?
Generating text requires the model to produce tokens one at a time, which uses more computing work than reading input. Providers therefore charge several times more for output, typically five to eight times the input price.
What is prompt caching?
Prompt caching stores the repeated beginning of a prompt, such as instructions or documents, so later requests that reuse it are billed at a much lower rate, often 5% to 10% of the normal input price. It also tends to make responses faster.
Is the batch API worth using?
Yes, for any work that doesn't need an immediate answer. Batch requests typically cost about half the standard price, with results returned within hours, which suits bulk processing, evaluations and overnight jobs.