LLM API Cost Calculator

LLM API Cost Calculator

Growing AI Skill PRO

Enter Calculation

Custom price (optional)

Leave blank to use the published list price. Enter both to price a model that is not listed, or a negotiated rate.

Formula

Monthly cost=N×(1−c)TinPin+cTinPcache+ToutPout1000000\text{Monthly cost} = N \times \frac{(1-c)\,{{T_{in}}}\,P_{in} + c\,{{T_{in}}}\,P_{cache} + {{T_{out}}}\,P_{out}}{1\,000\,000}
Usage stats

Advertisement

Results

Estimated monthly cost
$90.00
Claude Sonnet 5.5 · 10,000 requests per month
Cost per request
$0.009
Cost per 1,000 requests
$9.00
Yearly cost
$1,080.00
Blended price per 1M tokens
$3.60
Monthly cost breakdown
Item Tokens per month Price per 1M tokens Cost
Input (not cached) 20,000,000 $2.00 $40.00
Output 5,000,000 $10.00 $50.00
Total 25,000,000 $90.00

Output tokens make up 55.6% of the bill.

Same workload on every listed model
# Model Input / output per 1M Per month
1 Gemini 2.5 Flash-Lite $0.10 / $0.40 $4.00
2 Claude Haiku 5.5 $0.10 / $0.50 $4.50
3 gpt-6-luna $0.10 / $0.50 $4.50
4 DeepSeek Flash (off-peak) $0.15 / $0.60 $6.00
5 deepseek-flash $0.30 / $1.20 $12.00
6 Mistral Large $0.50 / $1.50 $17.50
7 Gemini 3.5 Flash-Lite $0.30 / $2.50 $18.50
8 Gemini 2.5 Flash $0.30 / $2.50 $18.50
9 DeepSeek V4 Pro (off-peak) $0.66 / $1.98 $23.10
10 Gemini 3.8 Flash $0.75 / $3.75 $33.75
11 Claude Haiku 4.5 $1.00 / $5.00 $45.00
12 gpt-6.1-terra $1.00 / $5.00 $45.00
13 deepseek-v4-pro $1.32 / $3.96 $46.20
14 Gemini 2.5 Pro $1.25 / $10.00 $75.00
15 Claude Sonnet 5.5 $2.00 / $10.00 $90.00
16 gpt-6.1-sol $2.00 / $10.00 $90.00
17 Gemini 4 Argon $2.00 / $10.00 $90.00
18 Gemini 3.1 Pro Preview $2.00 / $12.00 $100.00
19 Claude Sonnet 4.6 $3.00 / $15.00 $135.00
20 Claude Opus 5.5 $4.00 / $20.00 $180.00
21 Claude Opus 5 $5.00 / $25.00 $225.00
22 Claude Fable 5.1 $10.00 / $50.00 $450.00
23 gpt-6-astra $10.00 / $50.00 $450.00

Cheapest for this workload: Gemini 2.5 Flash-Lite ($4.00). Price is one factor: quality, speed, context length and tokenizer differ between models.

List prices from the LiteLLM open price list (MIT), cross-checked against each provider's pricing page on 2026-11-02: LiteLLM · Anthropic · OpenAI · Google · Mistral AI · DeepSeek. US dollars, standard tier, text tokens, before tax.

Report an error on this page

What this calculator does

It turns a workload — tokens per request and requests per month — into a monthly API bill, using the current list prices of the major large language model providers: Anthropic (Claude), OpenAI (GPT), Google (Gemini), Mistral and DeepSeek. Pick one model for a detailed breakdown; the table below the result prices the same workload on every listed model, cheapest first.

How to use it

  1. Choose a model.
  2. Enter the input tokens (prompt, system prompt, documents, tool definitions) and output tokens (the answer) of a typical request. Your API responses report both.
  3. Enter requests per month.
  4. Optionally enter the share of input that is cached, tick Batch API for asynchronous jobs, or enter a custom price per 1M tokens for a negotiated rate or an unlisted model.

The formula

Providers bill input tokens (what you send) and output tokens (what the model writes) at separate rates, quoted per million tokens. Cached input — a prompt prefix the provider has already stored — is billed at a much lower rate. For one request:

$$\text{Cost} = \frac{(1-c)\,T_{in}\,P_{in} + c\,T_{in}\,P_{cache} + T_{out}\,P_{out} }{1\,000\,000}$$

where \(T_{in}\) and \(T_{out}\) are input and output tokens per request, \(c\) is the share of input served from the cache, and \(P\) are the prices per 1M tokens. The monthly cost is the cost of one request times the number of requests per month. The Batch API option replaces \(P_{in}\) and \(P_{out}\) with the provider's batch prices.

Advertisement
Diagram showing input and output token counts each divided by 1000, multiplied by their per-1K prices, then summed to a total cost
Cost combines input and output tokens, each scaled by their per-1K-token price.

Worked example

A support bot sends 2,000 input tokens and receives 500 output tokens per request, 10,000 times a month, on a model priced at 2 USD per 1M input tokens and 10 USD per 1M output tokens:

  • Input: 2,000 × 2 ÷ 1,000,000 = 0.004 USD
  • Output: 500 × 10 ÷ 1,000,000 = 0.005 USD
  • Per request: 0.009 USD; per month: 0.009 × 10,000 = 90 USD

Output is only 20% of the tokens but 56% of the bill — trimming long answers usually saves more than trimming prompts. If half of the input were a cached system prompt billed at 0.10 USD per 1M, the input part would fall from 40 USD to 21 USD a month.

What changes the bill

  • Output length. Output tokens cost several times more than input tokens on every listed model.
  • Prompt caching. A long, repeated system prompt or document can be read from the cache at a fraction of the input price. Writing to the cache costs extra on some providers, which this calculator does not add.
  • Batch processing. Asynchronous batch jobs cost about half on providers that offer them.
  • Long prompts. Some models charge more once a prompt passes a size threshold (for example 100,000 or 200,000 tokens); the calculator picks the right tier from your input tokens.
  • Reasoning tokens. Models that "think" before answering bill those hidden tokens as output; Google's pricing page says so explicitly. Measure them in your own logs.
  • Tokenizers differ. The same text is a different number of tokens on different models — Anthropic notes that its newer models produce about 30% more tokens for the same text. Compare models on token counts measured with each model.
Advertisement
Bar chart comparing per-request cost scaling up to total cost across many requests
A small per-request cost multiplies into total spend across many requests.

Where the prices come from

Prices come from LiteLLM's open model price list (model_prices_and_context_window.json, MIT licence), pinned to a dated commit, and every model is cross-checked by hand against the provider's own pricing page; the check date and links to both are printed under the result. Where the two disagree, the calculator uses the provider's page. Prices LiteLLM does not carry — announced future changes such as Google's new Gemini prices from 1 December 2026, and DeepSeek's off-peak rates — come from the provider's page and switch over automatically on their date. The list is refreshed weekly, and a large price change is held for a human check before it goes live. Prices are list prices for the standard (pay-as-you-go) tier in US dollars, before tax; enterprise discounts, regional-endpoint surcharges and priority tiers are not included. If a price looks different from the provider's page today, use the custom price fields and tell us.

FAQ

Is the cheapest model the best choice?
No. Price per token is one factor; quality, speed, context length and how many tokens a model needs for the same task all change the real cost per finished task. Use the comparison to shortlist, then test.
Why does my invoice differ from the estimate?
Invoices count every token actually processed: retries, tool definitions, system prompts, reasoning tokens and cache writes. Taxes and regional surcharges also apply. Start from token counts reported in your API responses for the most accurate estimate.
How do I convert a price per 1K tokens?
Multiply by 1,000: 0.002 USD per 1K tokens is 2 USD per 1M tokens.

Sources & References

Last updated:

Most popular in Digital Life

View all Digital Life calculators