LLM API Cost Calculator

Every LLM API bills the same way — so many dollars per million input tokens, so many per million output tokens — yet the number you actually want, “what will this cost me per month?”, is never the number on the pricing page. This calculator does that last step for you. Pick one of 20 current models from OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI, describe one typical request (input tokens, output tokens, how much of the input repeats enough to be cached) and how many requests you run a day, and you get the cost per request, per day, per month and per year.

Or skip the model choice entirely: switch on “Compare all models” and the same workload is priced on every model in the table, ranked cheapest first. That’s the view you want when the model decision is still open — the spread between the cheapest and the most expensive way to serve the same request is often more than a hundredfold.

If you don’t know your token counts yet, start with a workload preset. The four presets — Chatbot, RAG support bot, Document summariser and Coding agent — pre-fill typical token figures for each shape of work, clearly labelled as assumptions, so the first screen already shows real numbers instead of a blank form. And if you have a real prompt to measure, the hub’s LLM Token Counter will estimate its tokens first; this calculator prices them.

A developer's desk with a calculator, a notebook of handwritten figures and a laptop showing a blurred chart, while working out API costs

LLM API Cost Calculator

Pick a model, enter the tokens in one typical request and how many requests you run, and see what the API costs per request, per day, per month and per year — or compare every model on the same workload at once.

Start from a workload preset RAG support bot: 4,000 input tokens, 500 output tokens, 50% of input from cache, 500 requests a day. Preset figures are typical-workload assumptions to start from — adjust them to your own logs.
System prompt, conversation history, retrieved documents — everything you send.
The reply the model writes. On reasoning models, include thinking tokens — providers bill those as output.
%
The repeated part of your prompts — a fixed system prompt or the same documents — that prompt caching serves at the lower cached rate.
Compare all models on this workload One ranked table, cheapest first, instead of a single model.
Use Batch API pricing (50% off where published) Applies only where the provider publishes a batch discount. Batch jobs are asynchronous — results come back within hours, not seconds.
$0.00Per request
$0.00Per day
$0.00Per month (30 days)
$0.00Per year (365 days)
ModelPer requestPer dayPer monthPer year
The formula: cost per request = (input tokens × (1 − cached %) × input rate + input tokens × cached % × cached rate + output tokens × output rate) ÷ 1,000,000. Per day is that figure × your requests per day; per month × 30 days; per year × 365 days.

Not sure how many tokens your prompt uses? Estimate them first with the LLM Token Counter, then price the estimate here.

About the prices: every rate in the table was checked in November 2026 against the provider’s own published pricing page — OpenAI, Anthropic, Google, DeepSeek, Mistral and xAI. Providers change prices often, and a few rows were introductory prices with published end dates when checked — the model note under the rates line flags those. Where a model has length-tiered pricing (different rates for very long prompts), it is left out of the table rather than shown at a rate that would mislead. The cached share models cache reads; the one-off fee for writing to the cache is not included. Everything is calculated locally in your browser — your figures never leave this page.

How it works

The maths is the providers' own published formula, printed on the tool itself:

Cost per request = (input tokens × (1 − cached %) × input rate + input tokens × cached % × cached rate + output tokens × output rate) ÷ 1,000,000

Per day multiplies by your requests per day; per month uses 30 days; per year uses 365. The rates are each model's standard published prices per million tokens. Where a provider publishes a Batch API discount — OpenAI, Anthropic, Google and Mistral all publish 50% — the toggle applies it to that provider's models only; DeepSeek and xAI publish no batch discount for the models in the table, so the toggle leaves them alone and says why.

Every price in the table was checked in November 2026 against the provider's own pricing page, and the tool links to all six source pages. Three honest qualifications ride along. First, a few rows were introductory prices with published end dates when checked — Google's Gemini 4 models are listed as rising on 1 December 2026, and Gemini 3.8 Flash on 1 January 2027 — and the tool flags those rows rather than letting them pass as permanent. Second, DeepSeek's rates are its off-peak prices; its weekday peak hours (UTC) cost exactly double, which the tool states instead of quietly averaging. Third, the cached percentage models cache reads at the published cached rate; the one-off fee for writing content into the cache isn't included, because it's paid once per cache fill rather than per request.

Two things the table deliberately leaves out. Models with length-tiered pricing — where the rate changes for very long prompts — are excluded rather than shown at a single rate that would mislead on one side of the tier; the FAQ names them. And models the provider has already marked deprecated are removed, even when their old prices still appear in search results elsewhere.

How to use it

  1. Pick a workload preset if one matches your shape of work, or just start typing — every field is editable either way.
  2. Choose your model from the picker. Its published rates per million tokens appear in the line underneath.
  3. Enter the input tokens in one typical request — system prompt, history, retrieved documents, everything you send.
  4. Enter the output tokens — the reply. On reasoning models, include thinking tokens; providers bill those as output.
  5. Set the cached share: the percentage of your input that repeats across requests and can be served from prompt caching at the lower rate.
  6. Set requests per day, and read the four figures: per request, per day, per month, per year.
  7. Not settled on a model? Switch on Compare all models for the ranked table, and try the Batch API toggle if your workload can wait a few hours for results.
  8. Press Copy results to take the figures away as plain text for a budget note or a team chat.

Worked example

The calculator opens on the RAG support bot preset, priced on Claude Sonnet 5.5: 4,000 input tokens and 500 output tokens per request, 50% of the input served from cache, 500 requests a day. Sonnet 5.5's published rates are $2.00 per million input tokens, $0.10 per million cached input tokens and $10.00 per million output tokens. The formula runs:

  • Uncached half of the input: 4,000 × 50% × $2.00 = $4,000 per million requests
  • Cached half of the input: 4,000 × 50% × $0.10 = $200 per million requests
  • Output: 500 × $10.00 = $5,000 per million requests

Total $9,200 per million requests — $0.0092 per request. At 500 requests a day that's $4.60 a day, $138.00 a month and $1,679.00 a year.

Now switch on Compare all models without changing anything. The same workload on Gemini 2.5 Flash-Lite comes to $0.00042 per request — $6.30 a month — while the most expensive models in the table run past $250 a month for the identical requests. Same prompts, same answers' length, wildly different bill: that spread is exactly what the comparison view exists to show before you build on a model, not after the first invoice.

Who it is for

Developers estimating an API bill before they commit to a model; teams comparing providers for a chatbot, a support bot or an internal tool and needing one workload priced the same way everywhere; indie builders checking whether a feature's unit economics survive at a paid tier; and anyone who has read a pricing page three times and still can't tell what their app will cost, because the pricing page answers a question they didn't ask.

Why use this tool

  • Presets, not a blank form — four typical workloads pre-fill realistic token figures, labelled as assumptions, so you get a usable estimate before you have logs of your own.
  • Every model on your workload, ranked — one click prices all 20 models on the same inputs, cheapest first, instead of twenty separate trips to twenty pricing pages.
  • Dated and sourced prices — the table states when its prices were checked and links to each provider's own pricing page, and rows carrying introductory prices are flagged with their published end dates.
  • The discounts, applied honestly — prompt-caching rates and the 50% Batch API discount are applied only where the provider actually publishes them, and the tool says so where it can't apply them.

FAQ

How is the API cost calculated?

With the providers' standard formula: the uncached share of your input tokens at the model's input rate, plus the cached share at its cached-input rate, plus your output tokens at its output rate, all divided by a million. That gives the cost of one request; the calculator multiplies it by your requests per day, then by 30 for the month and 365 for the year. The formula is printed on the tool, so you can check any figure by hand.

How current are these prices?

The table was checked in November 2026 against each provider's own published pricing page, and the tool links to all six pages so you can verify any row yourself. Providers change prices often — sometimes monthly — and a few rows were introductory prices with published end dates when checked; those are flagged on the tool with the date and the rate that replaces them. Treat the output as a well-sourced estimate for planning, and confirm the row that matters on the provider's page before a large commitment.

What counts as input and output tokens?

Input is everything you send: the system prompt, the conversation so far, any documents or retrieved passages, and the user's message. Output is everything the model generates — including, on reasoning models, the thinking tokens it produces before the visible reply, which providers bill at the output rate. If you don't know your counts yet, estimate a real prompt with the LLM Token Counter on this hub, then price the estimate here.

How does the cached percentage save money?

Most repeated input — a fixed system prompt, the same documents in a RAG prompt — can be served from the provider's prompt cache at a much lower rate than fresh input: a tenth of the input price is typical. Enter the share of your input that repeats across requests and the calculator prices that share at the cached rate. Two models in the table (Mistral Large 3 and Grok 4.7) have no published cached rate, so their cached share is priced at the full input rate and the tool says so. The one-off fee for writing to the cache isn't modelled — it's paid once per cache fill, not per request.

What does the Batch API toggle do?

Four of the six providers — OpenAI, Anthropic, Google and Mistral — publish a Batch API that runs requests asynchronously, typically returning results within hours, at 50% of the standard rates. The toggle applies that halving to those providers' models only. DeepSeek and xAI publish no batch discount for the models in this table, so the toggle doesn't touch them. If your workload is a live chat, batch isn't an option; if it's overnight summarising or classification, it's the single biggest saving on the page.

Why are some well-known models missing from the table?

Because their pricing doesn't fit a single honest row. Models whose rate changes at a prompt-length threshold — Claude Haiku 5.5 and Gemini 3.1 Pro Preview are the current examples — would be misstated at any one rate, so they're left out until their pricing simplifies. Models a provider has marked deprecated are also removed: their listed prices stop applying once traffic is re-routed to newer models. Every model that is in the table has one published rate card that could be verified on the provider's own page.

How is the API cost calculated?

With the providers' standard formula: the uncached share of your input tokens at the model's input rate, plus the cached share at its cached-input rate, plus your output tokens at its output rate, all divided by a million. That gives the cost of one request; the calculator multiplies it by your requests per day, then by 30 for the month and 365 for the year. The formula is printed on the tool, so you can check any figure by hand.

How current are these prices?

The table was checked in November 2026 against each provider's own published pricing page, and the tool links to all six pages so you can verify any row yourself. Providers change prices often — sometimes monthly — and a few rows were introductory prices with published end dates when checked; those are flagged on the tool with the date and the rate that replaces them. Treat the output as a well-sourced estimate for planning, and confirm the row that matters on the provider's page before a large commitment.

What counts as input and output tokens?

Input is everything you send: the system prompt, the conversation so far, any documents or retrieved passages, and the user's message. Output is everything the model generates — including, on reasoning models, the thinking tokens it produces before the visible reply, which providers bill at the output rate. If you don't know your counts yet, estimate a real prompt with the LLM Token Counter on this hub, then price the estimate here.

How does the cached percentage save money?

Most repeated input — a fixed system prompt, the same documents in a RAG prompt — can be served from the provider's prompt cache at a much lower rate than fresh input: a tenth of the input price is typical. Enter the share of your input that repeats across requests and the calculator prices that share at the cached rate. Two models in the table (Mistral Large 3 and Grok 4.7) have no published cached rate, so their cached share is priced at the full input rate and the tool says so. The one-off fee for writing to the cache isn't modelled — it's paid once per cache fill, not per request.

What does the Batch API toggle do?

Four of the six providers — OpenAI, Anthropic, Google and Mistral — publish a Batch API that runs requests asynchronously, typically returning results within hours, at 50% of the standard rates. The toggle applies that halving to those providers' models only. DeepSeek and xAI publish no batch discount for the models in this table, so the toggle doesn't touch them. If your workload is a live chat, batch isn't an option; if it's overnight summarising or classification, it's the single biggest saving on the page.

Why are some well-known models missing from the table?

Because their pricing doesn't fit a single honest row. Models whose rate changes at a prompt-length threshold — Claude Haiku 5.5 and Gemini 3.1 Pro Preview are the current examples — would be misstated at any one rate, so they're left out until their pricing simplifies. Models a provider has marked deprecated are also removed: their listed prices stop applying once traffic is re-routed to newer models. Every model that is in the table has one published rate card that could be verified on the provider's own page.