LLM API cost calculator
Enter token usage and request volume to compare estimated API token costs. Prices do not measure task quality or retries.
| Model | Provider | Per request | Monthly cost |
|---|
List prices per 1M tokens; catalog updated 2026-10-12. DeepSeek peak/off-peak and published long-context rates are applied. Estimates exclude image/audio tokens, cache-write fees, cache storage, batch/Flex/Fast adjustments and free tiers. Gemini 3.8 Flash uses the displayed promotional rates through December 31, 2026; input/output/cache-read rates double January 1, 2027.
Compare Haiku 5.5 vs Opus 5.5 costs and tasks. Opus estimates use Standard mode. Fixed token usage does not imply equal task quality or retries.
Haiku 5.5 switches to 5× token rates above 100,000 input tokens per request, including cache reads. This calculator excludes cache writes and Batch. See both bands and boundary examples.
Mistral Large 4 (Le Chonk) estimates use current Standard sale rates, verified October 7, 2026. The promotion end date is not published. See sale and original prices.
How to estimate your LLM API cost
Every token-based API bills you twice: once for the input (everything you send — the prompt, system message and any context or documents) and once for the output (what the model writes back). Output is usually 2–5× more expensive than input, so the single biggest lever on your bill is how much the model generates.
The formula is simple:
monthly cost = requests × ((input_tokens × input_price) + (output_tokens × output_price)) / 1,000,000
- Cap output length. Setting a sensible
max_tokensstops runaway generations from blowing the budget. - Use prompt caching. If you resend the same system prompt or document every call, caching can cut that input cost by 75–90%. Toggle it above to see the effect.
- Right-size the model. A cheap model that succeeds is better than an expensive one — but a cheap model that fails and forces a retry costs more. Measure success rate, not just sticker price.
- Batch when you can. Most providers offer a Batch API at roughly half price for non-urgent jobs.
Want the per-model numbers without the math? See the full LLM API price comparison or the cheapest LLM APIs guide.