What the LLM API Cost Calculator does
This calculator estimates what an LLM API workload costs per request, per day and per month on every OpenAI, Anthropic and Google model in a dated price catalogue, including the effect of prompt caching and batch processing. Enter your traffic once and compare all the models side by side, or add the custom rate from your own contract.
The rates are copied from each provider's official pricing page and dated; they are not fetched live, and the page tells you when it last checked them. Token prices change often, promotional rates expire, and long prompts can move a request onto a dearer tier, so the calculator models those rules explicitly rather than hiding them in a single blended figure.
How to use it
- Enter requests per day and the days you bill per month, then the average input and output tokens per request. If you do not know the token counts, paste a typical prompt into the AI Token Counter first.
- If every prompt starts with the same long block - a system prompt, tool definitions, a policy document - enter its size as the cacheable prefix and estimate how often it is served from cache.
- Enter the share of traffic that can wait for a batch API (results within hours rather than seconds). Batch requests cost half on all three providers.
- Pick the headline model and read its monthly figure, savings and notes; then sort the comparison table by monthly cost. Add your negotiated rates under Custom rates if your contract differs from list price.
Reading the results
Per request is the average cost of one call with your mix of cache hits and batch; per month multiplies it by requests per day and days per month. Nothing is rounded until display.
Savings compares your settings with the same traffic at full input price and no batch. It can be negative on Anthropic models when the hit rate is low, because writing a prompt to the 5-minute cache costs 1.25 times the input price - caching pays only once the prefix is read back.
Output usually dominates the bill: output tokens cost four to eight times as much as input on current models. If output share is high, shortening answers or capping reasoning effort saves more than trimming the prompt.
Worked example: a support chatbot on Claude Sonnet 5
5,000 conversations a day, 30 days a month. Each request sends 4,200 input tokens, of which a 3,000-token system prompt and policy text is identical every time and hits the cache 85% of the time, and gets back 350 output tokens. Claude Sonnet 5 lists $2 input, $0.20 cache hit, $2.50 five-minute cache write and $10 output per million tokens.
Per request: 1,200 uncached tokens x $2 = $0.0024; 2,550 cached tokens x $0.20 = $0.00051; 450 cache-write tokens x $2.50 = $0.001125; 350 output tokens x $10 = $0.0035. Total $0.007535.
That is $37.68 a day and $1,130.25 a month. Without caching the same traffic costs $0.0119 a request, or $1,785 a month, so caching saves $654.75 (36.7%). Moving the whole workload to the Batch API would halve every line again - but only if customers could wait hours for a reply, which a live chatbot cannot.
Formulas and scoring rules
- Cached and written prefix
cached = prefix x hit_rate; written = prefix x (1 - hit_rate)Only Anthropic charges a separate cache write (1.25x input for the 5-minute cache). On OpenAI and Gemini the written tokens are ordinary input.- Cost of one request
cost = (plain_input x r_in + cached x r_cache + written x r_write + output x r_out) / 1,000,000plain_input = input - prefix, plus the written prefix where no write rate exists.- Batch blend
cost = (1 - b) x cost_standard + b x cost_batchb is the batch share. Batch rates are the providers' published batch prices (half of standard); Anthropic's cache multipliers stack on them.- Tier and promotion rules
Gemini 2.5 Pro and 3.1 Pro: prompt > 200,000 tokens uses the long-context rates; Gemini 3.6-3.8 Flash: promotional rates through 2026-12-31, list rates afterThe price date field decides which applies.- Projection
day = cost x requests_per_day; month = day x days_per_monthMoney is shown to cents, per-request figures to five decimals.
What the catalogue includes and leaves out
Each model row carries its standard input, cached-input, output and batch rates, its context window where the provider's model page states one, and a link to the page the figures came from. Where a figure could not be confirmed on the review date it is left blank rather than guessed.
Left out on purpose: regional and data-residency surcharges (Anthropic's US-only inference is 1.1x), priority and fast modes, image, audio and video input, web search and code execution fees, Gemini's hourly context-cache storage charge, and OpenAI's long-context tiers on the newest models, whose thresholds are not stated on the pricing page. Add them as a custom rate if they matter to you.
Limitations: what the result does not prove
- Prices are a dated snapshot, not live data. Check the provider's pricing page before committing a budget, especially near a promotional end date.
- Averages hide spread. A workload whose prompts sometimes exceed a long-context threshold costs more than the average prompt size suggests; model the long requests separately.
- Token counts per request are your estimate. Tokenizers differ by model, so the same text is more tokens on some models than others; the comparison assumes the same count everywhere.
- It excludes taxes, volume discounts, committed-spend agreements and any tool or retrieval charges.
Privacy: where your data goes
Everything you paste, type or drop is processed in this browser tab. It is not uploaded, logged, stored or sent to analytics. Session recording and tag-manager scripts are switched off on this page.
Standards and sources
- OpenAI API pricing - checked 19 Sep 2026
- Anthropic Claude API pricing - checked 19 Sep 2026
- Google Gemini API pricing - checked 19 Sep 2026
- Anthropic - Prompt caching
- OpenAI - Batch API
Frequently asked questions
How much does prompt caching actually save?
Cached input is billed at a tenth of the input price on most current models (a fortieth on Claude Fable 5.1), so a large, stable prefix with a high hit rate can cut input cost by 60-80%. Anthropic charges 1.25x to write the cache, so savings start only once the same prefix is read back at least once within the cache lifetime.
When is the Batch API worth using?
Whenever the answer can wait. Batch requests on OpenAI, Anthropic and Google cost half the standard rate and usually finish within hours. Classification, extraction, evaluation runs, embeddings back-fills and nightly summaries are good fits; anything a person is waiting on is not.
Why do reasoning models cost more than the token count of the answer suggests?
Reasoning or thinking tokens are generated before the visible answer and are billed as output tokens, even when the API does not return them in full. Enter output tokens as the total the provider reports in the usage field, not just the length of the visible reply.
Why does Gemini 2.5 Pro cost more for long prompts?
Google prices some Pro models in two tiers: prompts up to 200,000 tokens pay the lower rate and longer prompts pay the higher rate for the whole request, input and output. The calculator switches tier when your input tokens per request exceed 200,000.
Are these prices live?
No. They were copied from the official pricing pages on the date shown under the table and are updated when the page is reviewed. Use the custom rate fields to enter today's price or your negotiated contract rate if they differ.
Can I compare a model that is not in the list?
Yes. Open Custom rates, type its input, cached-input, cache-write and output prices per million tokens, and a row with your name appears in the comparison table alongside the catalogue models.
Last reviewed by the A2Z.Tools team against the sources listed above.