Skip to content

LLM API costs explained: tokens, caching and batch

By Zulu Calculator · Updated 19 October 2026 · AI & apps

Work it out with your own numbersLLM API cost calculator: Monthly AI API bill, with caching and batch, across models.Open the calculator →

AI model APIs charge per million tokens, with input (what you send) and output (what the model writes back) priced separately. Your monthly bill is input tokens × input price plus output tokens × output price, divided by 1,000,000. A support bot handling 1,000 chats a day for 30 days, with 1,000 input and 500 output tokens per chat, uses 30 million input and 15 million output tokens. On Claude Sonnet 5.5 ($2 / $10 per million) that is 30 × 2 + 15 × 10 = $210 a month. (Example 1 below is a different bot, with 2,000 input and 400 output tokens per chat: $240 a month, or $159 with prompt caching.) Model prices here were checked on 9 October 2026 (open-weight providers on 10 October 2026), and they change often.

This guide explains tokens, why output costs more, how caching and batch discounts work, and how to find the cheapest model for your workload. To run your own numbers, use the LLM API cost calculator.

What is a token, and how many words is it?

AI models do not read letters or whole words. They read tokens: chunks of text such as a short word, part of a longer word, a space or a punctuation mark. Each model family has its own tokenizer, so the same text gives slightly different counts on different models.

The rough rule for English is 1 token ≈ 4 characters ≈ ¾ of a word, and a page is about 500 words.

Tokens≈ Words≈ Characters≈ Pages
1,0007504,0001.5
8,0006,00032,00012
128,00096,000512,000192
1,000,000750,0004,000,0001,500

These are rules of thumb. Other languages often take 1.3 to 3 times as many tokens for the same meaning, and code, symbols and long numbers split into many small tokens. Chat messages also add a few tokens each for formatting, and system prompts and tool definitions count too. For a real count of your own text, paste it into the AI token counter. It counts OpenAI models exactly with the o200k_base tokenizer and estimates Claude and Gemini as characters ÷ 4, because Anthropic and Google do not publish their tokenizers for use in a web page.

Why does output cost more than input?

Every provider prices output several times higher than input. On most models in the table below it is five or six times higher. So a request with a short prompt and a long answer can cost more than one with a long prompt and a short answer.

Models that "think" before they answer bill those thinking tokens as output, even though you never see them. Take the support bot above and add 2,000 thinking tokens per chat. Output rises from 15 million to 75 million tokens a month, and the Sonnet 5.5 bill goes from $210 to 30 × 2 + 75 × 10 = $810. Asking for concise answers or a lower thinking effort often saves more than trimming the prompt.

How much do the main models cost?

Standard prices in US dollars per million tokens, for normal-length prompts, without batch or caching discounts:

ModelProviderInput / 1MOutput / 1MNote
Claude Haiku 5.5Anthropic$0.10$0.50$0.50 / $2.50 for prompts over 100K tokens
GPT-5.6 LunaOpenAI$0.20$1.20Prompts under 270K tokens
Gemini 3.5 Flash-LiteGoogle$0.30$2.50
Gemini 3.8 FlashGoogle$0.75$3.75Introductory; $1.50 / $7.50 after 31 Dec 2026
Claude Sonnet 5.5Anthropic$2$10
GPT-5.6 TerraOpenAI$2$12Prompts under 270K tokens
Gemini 3.1 Pro (preview)Google$2$12Up to 200K tokens; long prompts cost more
Claude Opus 5.5Anthropic$4$20
GPT-5.6 SolOpenAI$5$30Prompts under 270K tokens
Claude Fable 5.1Anthropic$10$50

Prices checked on 9 October 2026 against each provider's official pricing pages. They change often, so confirm with the provider before you commit to a budget.

How do I estimate my monthly API bill?

Work out how many tokens you use in a month, then price input and output separately.

requests a month = requests a day × days
input cost = input tokens × input price × (uncached share + cached share × 0.1) ÷ 1,000,000
output cost = (output + thinking tokens) × output price ÷ 1,000,000
monthly cost = input cost + output cost, × 0.5 if you use batch

Input tokens per request include everything you send: the system prompt, any documents, the chat history and the user's message. In a chat app the history grows with every turn, so later messages cost more than the first. Use 22 days instead of 30 if your tool only runs on weekdays.

How much does prompt caching save?

If the same long system prompt or document goes out with every request, the provider can keep it in a prompt cache. Input read from the cache costs about a tenth of the normal input price with all three providers. Our calculators use exactly 0.1; real cache prices differ a little between models.

So with 75% of input cached, you pay 0.25 + 0.75 × 0.1 = 0.325, or 32.5%, of the normal input cost. Caching only touches input, so it helps most when prompts are long and answers short. Anthropic also charges 1.25× the input price the first time a prompt is written to its 5-minute cache; our calculator leaves that out. The prompt caching savings calculator looks at this in more detail.

Is the batch API cheaper?

Yes. Work sent through the batch APIs costs half price, and the results come back within 24 hours. It suits anything that does not need an instant answer: tagging, translating or summarising a backlog, or overnight reports. It does not suit live chat. Batch halves both input and output, and you can combine it with caching.

What is a context window, and does it change the cost?

The context window is the most tokens a model can take in at once. Your system prompt, documents, images, the chat so far and, for most models, the reply all have to fit. A 128K window holds about 96,000 English words, or 192 pages; 1 million tokens is about 1,500 pages.

You pay for the tokens you send, not for the size of the window. But two things make very long prompts dear. First, every token costs money, so a prompt that fills a big window is expensive on every request. Second, some models charge a higher rate above a certain length: Claude Haiku 5.5 moves to $0.50 / $2.50 for prompts over 100K tokens, and Gemini 3.1 Pro's long prompts cost more. Models can also miss details in the middle of very long inputs, so send only what the task needs. The context window calculator shows how much fits.

Worked examples

Example 1: a chatbot with a cached system prompt

1,000 chats a day for 30 days. Each chat sends 2,000 input tokens, of which 1,500 are the same system prompt (75% cached), and gets 400 output tokens back. Model: Claude Sonnet 5.5 ($2 / $10).

  • Requests: 1,000 × 30 = 30,000 a month
  • Tokens: 30,000 × 2,000 = 60 million input; 30,000 × 400 = 12 million output
  • Without caching: 60 × 2 + 12 × 10 = 120 + 120 = $240.00
  • With 75% cached: input 60 × 2 × 0.325 = $39.00, output $120.00
  • Total: $159.00 a month, or $0.0053 a chat and $1,908 a year

If the bot's questions are simple enough for Claude Haiku 5.5 ($0.10 / $0.50), the same cached workload costs 60 × 0.10 × 0.325 + 12 × 0.50 = 1.95 + 6.00 = $7.95 a month.

Example 2: summarising long documents

100 documents a day on 22 working days. Each one is 120,000 tokens (about 90,000 words, or 180 pages), and each summary is 1,000 tokens.

  • Requests: 100 × 22 = 2,200 a month
  • Tokens: 2,200 × 120,000 = 264 million input; 2,200 × 1,000 = 2.2 million output
  • GPT-5.6 Luna ($0.20 / $1.20): 264 × 0.20 + 2.2 × 1.20 = 52.80 + 2.64 = $55.44 a month
  • Claude Haiku 5.5: the prompts are over 100K tokens, so the $0.50 / $2.50 rate applies: 264 × 0.50 + 2.2 × 2.50 = 132.00 + 5.50 = $137.50
  • Claude Sonnet 5.5 ($2 / $10): 264 × 2 + 2.2 × 10 = 528.00 + 22.00 = $550.00

Here almost all the cost is input, so the input price decides the winner. At its short-prompt price Haiku would have been the cheapest, but the long-prompt rate pushes it behind Luna. Each document plus a 1,000-token summary uses 121,000 tokens, or 94.5% of a 128K window, so it fits, but only just.

Example 3: an overnight batch job

50,000 customer reviews a day to tag by topic, every day for 30 days. Each request is 300 input and 50 output tokens. Results are not needed until the next morning, so the batch API is fine.

  • Requests: 50,000 × 30 = 1.5 million a month
  • Tokens: 1.5 million × 300 = 450 million input; 1.5 million × 50 = 75 million output
  • GPT-5.6 Luna, standard: 450 × 0.20 + 75 × 1.20 = 90 + 90 = $180.00
  • GPT-5.6 Luna, batch: $180.00 × 0.5 = $90.00 a month, or $0.00006 a review
  • Claude Haiku 5.5, batch: (450 × 0.10 + 75 × 0.50) × 0.5 = (45.00 + 37.50) × 0.5 = $41.25

How do I pick the cheapest model for my workload?

  1. Measure your mix. Count typical input and output tokens per request. A model with cheap input and dear output wins for long prompts and short replies, and loses for short prompts and long replies.
  2. Try the smallest model first. Send simple tasks to a small, cheap model and keep the larger ones for hard questions. In Example 1, Sonnet 5.5 costs 20 times as much as Haiku 5.5.
  3. Check long-prompt rates if your prompts run past 100K tokens.
  4. Look at open-weight models. Models such as DeepSeek, Llama, Qwen and Kimi can be run by anyone, so several companies sell the same model at different prices. For the 1,000-chats-a-day workload (30 million input, 15 million output), DeepSeek V4 Pro (0813) cost $78.00 a month on DeepInfra against $99.00 on DeepSeek's own API at peak price (prices checked 10 October 2026). The cheapest AI API calculator ranks the providers for your own mix.
  5. Check more than price. Some providers serve compressed versions that can answer slightly differently, and context length, speed, rate limits and data handling differ.

Common mistakes

  • Pricing only the user's message. The system prompt, documents and chat history are input too, and are often most of it.
  • Forgetting thinking tokens. They are billed as output, the dearer side.
  • Using one blended price. Input and output are priced separately; your own mix decides the cost.
  • Treating words as tokens. 1,000 words is about 1,333 tokens, and more in other languages or code.
  • Missing a price change. Introductory prices end (Gemini 3.8 Flash doubles after 31 December 2026), and long prompts can move to a higher rate.
  • Paying full price for work that can wait. Batch halves the bill.

What to do before you commit to a budget

  1. Run a small test and read the real token usage the provider's API reports for each request. Our counts for Claude and Gemini are estimates.
  2. Put your real numbers into the calculator, including thinking tokens and the share you can cache.
  3. Check the provider's current pricing page. Prices change often, and cache prices differ a little from the 0.1 rule.
  4. Set a monthly budget and see how many requests it pays for. The calculator's Advanced mode shows this.

Quick summary

  • APIs charge per million tokens; input and output are priced separately.
  • 1 token ≈ 4 characters ≈ ¾ of an English word.
  • Output, including thinking tokens, usually costs several times more than input.
  • Cached input costs about a tenth of the normal price; batch is half price, within 24 hours.
  • You pay for the tokens you send, not the window size, but some models charge more for long prompts.
  • Prices change often: these were checked on 9 and 10 October 2026.

Work out your own bill with the LLM API cost calculator, count your text with the AI token counter, or compare providers of open-weight models with the cheapest AI API calculator.

Prices checked against each provider's official pricing pages, as used by our calculators (closed models checked 9 October 2026, open-weight providers 10 October 2026).

Common questions

How much does 1 million tokens cost?

It depends on the model and on whether the tokens are input or output. With prices checked on 9 October 2026, input ranged from $0.10 per million (Claude Haiku 5.5) to $10 per million (Claude Fable 5.1), and output from $0.50 to $50 per million. Prices change often, so check the provider before you budget.

How many words is 1,000 tokens?

About 750 English words. A token is roughly 4 characters or ¾ of a word, so 1,000 tokens is about 4,000 characters, or 1½ pages at 500 words a page. Other languages and code usually take more tokens for the same text.

Why do output tokens cost more than input tokens?

Providers price output several times higher than input, usually five or six times on the models we list. Thinking (reasoning) tokens are billed as output too, even though you do not see them. That is why shorter answers and less thinking often save more than a shorter prompt.

How much does prompt caching save?

Input read from the prompt cache costs about a tenth of the normal input price with Anthropic, OpenAI and Google. If 75% of your input is a repeated system prompt, your input bill drops to 32.5% of what it was. Anthropic also charges 1.25× the input price the first time a prompt is written to its 5-minute cache.

Is the batch API really half price?

Yes. Work sent through the providers’ batch APIs costs 50% less, with results within 24 hours. It suits jobs that do not need an instant answer, such as tagging or summarising a backlog overnight.

Does a bigger context window cost more?

You pay for the tokens you actually send, not for the size of the window. But filling a big window is expensive, and some models charge a higher price per token for very long prompts, for example Claude Haiku 5.5 above 100K tokens.

This guide explains the rules in plain English for planning. It is not legal, financial or flight-operations advice; check your contract, the official source linked above, your employer or your operator.