LLM API Cost Calculator: Compare Token Prices Across Models
Enter the price per million input, output and cached tokens for up to three models, and your requests and token counts. You will see the cost per request, day, month and year, and how many times dearer each model is than the cheapest.
Last reviewed
Cheapest: Claude Haiku 5.5
$135.00 a month
$0.00045 a request; 600.0M input and 150.0M output tokens a month
| Model | Per request | A day | A month | A year |
|---|---|---|---|---|
| Claude Opus 5.540.0× the cheapest | $0.01800 | $180.00 | $5,400.00 | $64,800 |
| Claude Sonnet 5.520.0× the cheapest | $0.00900 | $90.00 | $2,700.00 | $32,400 |
| Claude Haiku 5.5cheapest | $0.00045 | $4.50 | $135.00 | $1,620 |
- Output share of first model’s cost
- 55.6%
- First model per 1,000 requests
- $18.00
Cost is not quality: the cheapest model may need more attempts or longer prompts. Cache writes, tool calls, long-context tiers and taxes are not included. Check the vendor’s current price list.
How language model APIs are priced
Language models are billed by the token, a chunk of text that is often a word or part of one. Providers quote a price per million tokens (MTok). They charge more for output tokens, the text the model writes, than for input tokens, the text you send. Most also offer a lower price for input tokens that are read from a cache, which helps when many requests start with the same long prompt, and some offer a discount for work that can wait, such as a batch tier.
Anthropic’s pricing page shows all of this. It lists a base input price, cache write prices, a cache hit price and an output price per million tokens for each model, and its Batch API gives a 50% discount on both input and output tokens. Because these prices change, the calculator does not hold any price of its own. The three models in the boxes when the page opens use the figures on that page on 18 October 2026, as examples. Replace them with the current prices of whichever models you compare, from any vendor.
The calculation
For one request:
cost = (uncached input tokens × input price + cached input tokens × cached price + output tokens × output price) ÷ 1,000,000 × (1 − discount)
The cached tokens are the cached share of the input tokens. A day costs one request’s cost times the requests a day, a month is the day times the days in the month, and the year is twelve months.
Worked example
An application makes 10,000 requests a day, each with 2,000 input tokens and 500 output tokens, over 30 days. That is 600 million input tokens and 150 million output tokens a month. These are the example prices: 4 input, 20 output and 0.20 cached for the first model, 2 / 10 / 0.10 for the second and 0.10 / 0.50 / 0.01 for the third.
- First model: (2,000 × 4 + 500 × 20) ÷ 1,000,000 = 0.018 per request, which is 180.00 a day and 5,400.00 a month. Output tokens make up 10,000 of its 18,000 units of cost, or 55.6%.
- Second model: (2,000 × 2 + 500 × 10) ÷ 1,000,000 = 0.009 per request, 2,700.00 a month, which is half the first model.
- Third model: (2,000 × 0.10 + 500 × 0.50) ÷ 1,000,000 = 0.00045 per request, 135.00 a month. It costs one fortieth of the first model and one twentieth of the second.
With a batch discount. A 50% discount takes the second model from 2,700.00 to 1,350.00 a month.
How caching changes the first model’s bill
Same traffic as above, with a share of the 2,000 input tokens read from the cache at 0.20 instead of 4.
| Input read from cache | Cost per request | Cost a month |
|---|---|---|
| 0% | 0.0180 | 5,400.00 |
| 25% | 0.0161 | 4,830.00 |
| 50% | 0.0142 | 4,260.00 |
| 75% | 0.0123 | 3,690.00 |
| 90% | 0.0112 | 3,348.00 |
Caching saves less here than you might expect, because output tokens, which are not cached, are most of the cost.
Points to check
- Count tokens, not words. Use the token counts your provider reports in its usage data, not a guess from word counts. Tokens do not match words one for one, and the ratio differs for code and for other languages.
- Output is usually the big line. Because output tokens cost more per million, long answers drive the bill. Shorter outputs often save more than a cheaper model.
- Cache writes cost extra. On the Anthropic page, writing to a five-minute cache costs 1.25 times the base input price. The calculator does not model writes, so use it for a steady state where most cache use is reads.
- Prices change and have tiers. Some models charge more for very long prompts, and prices have moved between versions. Check the vendor’s page before you commit to a plan.
- Cheaper is not better by default. A model that needs two tries costs twice as much per answer. Compare cost at the quality you need.
Related tools: the bandwidth calculator, the percentage change calculator, the ROI calculator and the startup runway calculator.
Frequently asked questions
How is the cost of an LLM API call calculated?
Multiply the input tokens by the input price per million and the output tokens by the output price per million, add them, and divide by one million. Cached input tokens use a lower cached price. The calculator does this for each model and scales it to a day, month and year.
Why are output tokens more expensive than input tokens?
Providers charge a higher price per million for output than for input. On the Anthropic price list the output price is several times the base input price for every model. For that reason long answers usually drive the bill, and shorter outputs can save more than a cheaper model.
What does the cached share mean?
It is the part of your input tokens that is read from a prompt cache, which is priced much lower than normal input. It helps when many requests start with the same long prompt. Enter 0 if you do not use caching. Cache writes are not modelled.
Why does the calculator not include fixed prices?
Model prices change often and differ between providers, so any figure printed here could be out of date. The prices in the boxes come from Anthropic’s pricing page on 18 October 2026 as examples. Replace them with the current prices of the models you compare.
How do I use the discount field?
Enter a percentage that applies to all tokens, for example 50 for a batch tier that halves the price for work that can wait. Anthropic’s page describes a 50% discount on both input and output tokens for its Batch API. Leave it at 0 for normal pricing.
Does the cheapest model give the best value?
Not necessarily. A cheaper model that needs retries, longer prompts or human review can cost more per good answer. The calculator compares price only, so test quality on your own task before choosing, and include costs it leaves out, such as tool calls and taxes.
Related calculators
- Percentage Change CalculatorEnter a starting and a new value to get the percentage change, or apply a percentage to a value, or find the value before a change.
- ROI CalculatorEnter what you put in, what it is worth, any income and costs, and how long you held it.
- Startup Runway CalculatorEnter your cash, monthly revenue and expenses, and any monthly growth.
- Bandwidth CalculatorChoose what to work out.
- SaaS Metrics Calculator (MRR, Churn, LTV, CAC)Enter one month of customers, recurring revenue, margin and sales spend.
- Data Storage ConverterConvert any data size.
- AI Subscription vs API Break-Even CalculatorEnter the subscription price, how many requests each user makes and the API prices per million tokens.
- Token Counter and Context Window EstimatorPaste your text and set a characters-per-token ratio and a context window.
Sources
This tool is for information only and is not financial advice. Figures are estimates, confirm anything you act on with your lender or a qualified adviser.