LLM API Cost Calculator
Enter your usage profile and instantly compare what every major LLM provider would charge — per request and per month. The default scenario below is real, server-rendered output; change any field to recalculate live.
Estimated cost — per month
Shown in USD. Pricing last verified 2026-06-19.
API price = the provider's list price per 1M tokens (input → output). Your cost = estimate for the usage profile you set on the left (4,000 in + 1,000 out per request).
Tip: click a column header to sort, or filter by category above. Sorted by cost per request by default.
| Provider / Model | Context | API price / 1M in → out | Your cost / request | Your cost / month | Links |
|---|---|---|---|---|---|
| Anthropic Claude 3 Haiku fast cheapest cache batch | 200K | $0.2500 → $1.25 | $0.002250 | $2.25 | Visit Review |
| Anthropic Claude 3.5 Haiku fast cache batch | 200K | $0.8000 → $4.00 | $0.007200 ×3.2 | $7.20 | Visit Review |
| Anthropic Claude Haiku 4.5 balanced cache batch | 200K | $1.00 → $5.00 | $0.009000 ×4.0 | $9.00 | Visit Review |
| Anthropic Claude Sonnet 4.6 frontier cache batch | 1M | $3.00 → $15.00 | $0.0270 ×12.0 | $27.00 | Visit Review |
| Anthropic Claude Sonnet 4.5 frontier cache batch | 1M | $3.00 → $15.00 | $0.0270 ×12.0 | $27.00 | Visit Review |
| Anthropic Claude Sonnet 4 frontier cache batch | 1M | $3.00 → $15.00 | $0.0270 ×12.0 | $27.00 | Visit Review |
| Anthropic Claude Opus 4.8 frontier cache batch | 1M | $5.00 → $25.00 | $0.0450 ×20.0 | $45.00 | Visit Review |
| Anthropic Claude Opus 4.7 frontier cache batch | 1M | $5.00 → $25.00 | $0.0450 ×20.0 | $45.00 | Visit Review |
| Anthropic Claude Opus 4.6 frontier cache batch | 1M | $5.00 → $25.00 | $0.0450 ×20.0 | $45.00 | Visit Review |
| Anthropic Claude Opus 4.5 frontier cache batch | 200K | $5.00 → $25.00 | $0.0450 ×20.0 | $45.00 | Visit Review |
| Anthropic Claude Fable 5 frontier cache batch | 1M | $10.00 → $50.00 | $0.0900 ×40.0 | $90.00 | Visit Review |
| Anthropic Claude Opus 4.1 frontier cache batch | 200K | $15.00 → $75.00 | $0.1350 ×60.0 | $135.00 | Visit Review |
| Anthropic Claude Opus 4 frontier cache batch | 200K | $15.00 → $75.00 | $0.1350 ×60.0 | $135.00 | Visit Review |
Estimates only. Actual bills depend on exact token counts, tier pricing and provider changes. Always confirm on the provider's pricing page.
How LLM API pricing works
Every major LLM provider bills by the token — a chunk of text roughly ¾ of a word in English. You pay separately for input tokens (everything you send: system prompt, retrieved context and the user message) and output tokens (what the model writes back). Output is typically priced two to five times higher than input, which is why concise responses save real money at scale.
The formula
cost_per_request = (input_tokens / 1,000,000) × input_price_per_M
+ (output_tokens / 1,000,000) × output_price_per_M
cost_per_period = cost_per_request × requests_in_period
What moves the number
- Prompt caching. If you reuse a long prefix (a big system prompt, a fixed knowledge base), many providers bill those cached tokens at a fraction of the normal input price.
- Batch mode. Non-interactive workloads submitted in bulk often get a flat discount (commonly 0.5×) in exchange for slower, asynchronous delivery.
- Context tiers. Some providers raise the per-token price once a request exceeds a context threshold. The dataset supports tiered pricing for exactly this case.
- Self-hosting. Open-weight models on your own GPUs change the equation entirely: you trade per-token fees for fixed infrastructure cost and operational work. See our self-hosted cost breakdown.
Frequently asked questions
How are LLM API costs calculated?
Providers bill per million tokens, separately for input (your prompt) and output (the model's response). Cost per request = (input tokens / 1,000,000 × input price) + (output tokens / 1,000,000 × output price). Multiply by your request volume for the period.
What is the difference between input and output tokens?
Input tokens are everything you send to the model — system prompt, context and user message. Output tokens are what the model generates. Output is usually priced several times higher than input, so response length matters a lot for cost.
Does prompt caching reduce cost?
Yes, where supported. Repeated prompt prefixes (e.g. a long system prompt) can be billed at a steep discount. The calculator lets you set what share of input tokens are cached.
Why do prices vary so much between providers?
Model size, hardware efficiency, context window, and business strategy all play a part. Frontier reasoning models cost the most; fast/cheap and open-weight self-hosted options can be orders of magnitude cheaper for suitable tasks.