How LLM API pricing works
Providers charge per million tokens, with separate prices for input (your prompt) and output (the model's reply). Output usually costs about 4 to 8 times more than input, so long answers drive the bill.
Cost per request = input tokens × input price + output tokens × output price, with both prices divided by 1,000,000.
For example, 2,000 input tokens and 500 output tokens on a model priced at $2 input and $10 output costs (2,000 × $2 + 500 × $10) ÷ 1,000,000 = $0.009 per request, or $270 a month at 1,000 requests a day.
The calculator multiplies the per-request cost by your requests per day, and the daily cost by 30 for the monthly figure. Input tokens include everything you send each time: the system prompt, instructions, earlier turns of a conversation, tool definitions and any documents. In a chat app, history is resent with every message, so input per request grows as a conversation gets longer.
Comparing models at the same usage
With the default usage of 2,000 input and 500 output tokens, 1,000 times a day, the table (prices checked 2026-11-16) ranges from $12.00 a month for Gemini 2.5 Flash-Lite and $13.50 for Claude Haiku 5.5 and GPT-6 Luna, through $270 for Claude Sonnet 5.5, GPT-6.1 Sol and Gemini 4 Carbon, to $1,350 for GPT-6 Astra. That is more than a hundredfold spread for the same workload, which is why it pays to test whether a cheaper model is good enough for each task.
How prompt caching changes the cost
If many requests start with the same long prefix, such as a system prompt, few-shot examples or a reference document, providers can cache it and charge a reduced rate when it is read again. The Cached input (%) field splits your input tokens: that share is priced at the model's cached input rate and the rest at the normal input rate. Output is never discounted by caching.
Worked example on Claude Sonnet 5.5 ($2 input, $0.10 cached input, $10 output per million tokens), with 10,000 input and 500 output tokens per request and 1,000 requests a day:
| Cached input | Calculation | Per request | Per month |
|---|---|---|---|
| 0% | (10,000 × $2 + 500 × $10) ÷ 1M | $0.025 | $750 |
| 80% | (2,000 × $2 + 8,000 × $0.10 + 500 × $10) ÷ 1M | $0.0098 | $294 |
Cached-read discounts vary by model. In this table they range from half the input price (GPT-4o mini) to a fortieth (Claude Fable 5.2); a tenth or a twentieth is common. The Gemini models listed charge about a tenth of the input price for cached reads. Some Gemini models also charge an hourly storage fee for explicitly cached content, which the calculator does not include.
What the calculator does not include
- Cache writes: some providers charge extra the first time a prefix is written to the cache. These charges are not added.
- Batch discounts: prices are for the standard tier. Batch APIs, where work can wait up to 24 hours, usually cost about half.
- Long-prompt and priority pricing: some models charge more above a prompt length threshold or on faster tiers. For example, Claude Haiku 5.5 is listed at $0.50 input and $2.50 output for prompts over 100K tokens; the calculator shows this as a note but uses the standard rate.
- Non-text input and tool fees: images, audio, web search and similar extras are billed separately.
Scheduled price changes
Where a provider has announced a new price, the calculator switches to it automatically on that date and mentions it under the cost figures until then. Gemini 4 Carbon and Gemini 4 Argon change from $2 / $10 to $4 / $20 per million input / output tokens on 2026-12-01, and Gemini 3.8 Flash changes from $0.75 / $3.75 to $1.50 / $7.50 on 2027-01-01. At the default usage, Gemini 4 Carbon goes from $270 to $540 a month.
Ways to cut the cost
- Prompt caching: if many requests share a long system prompt or documents, put the shared part first so it can be cached. Cached reads cost a fraction of the normal input price.
- Batch APIs: work that can wait (up to 24 hours) usually costs about 50% less.
- Smaller models: route simple tasks such as classification to a cheaper model.
- Shorter outputs: ask for concise answers or structured output, and set a sensible max tokens.
- Trim the context: summarize or drop old conversation turns and send only the documents a request needs.
Common mistakes
- Estimating input from the user's message alone and forgetting the system prompt and history.
- Using average output length when a few requests produce very long answers; set a max tokens limit to cap the worst case.
- Comparing token prices across providers without allowing for different tokenizers: the same text can be a different number of tokens on each.