LLM API Token Cost & Prompt Caching Calculator
Interactive LLM API Token Cost & Prompt Caching Calculator
?
Model calls per day. Read it from the provider's usage dashboard. Range: 100 to 5,000,000 calls per day, step 500.?
Average input tokens per call: system prompt, tool schemas, retrieved context and user message. Read the prompt_tokens field in API responses. Range: 50 to 128,000.?
Average output tokens per call, including reasoning tokens on reasoning models. Read the completion_tokens field in API responses. Range: 20 to 16,000.?
Share of input tokens served from the prompt cache, in percent. Read it from the cached-token field in usage reports. Range: 0 to 95 %, step 5.?
Price per million input tokens in USD, from the provider's price list for the model you use. Verify the current price before budgeting. Used only when the model below is Custom. Range: 0.05 to 30.00.?
Price per million output tokens in USD, from the provider's price list. Verify the current price before budgeting. Used only when the model below is Custom. Range: 0.10 to 90.00.?
Price of reading a cached input token, as a multiple of the base input price. Read it from the provider's price list: 0.10 on most Anthropic models, 0.05 on Sonnet 5.5 and Opus 5.5, 0.025 on Fable 5.1. Pick the value that matches the model whose input price you entered. It applies only when the model below is Custom. Default: 0.10.?
Choose a model to price the workload at its list prices (read from the Anthropic, OpenAI and Google pricing pages, verified Nov 2026). The three price fields above are then ignored and each model brings its own cache write and read multiples. Custom keeps the values you typed. Default: Custom.Use the LLM API Token Cost & Prompt Caching Calculator to evaluate Cost_mo = M_in · P_in · [(1 − r)·1.25 + r·m_read] + M_out · P_out for production RAG chatbots, automated document extraction pipelines. With the defaults (Daily API Requests = 15000 Calls/Day, Average Input Prompt Tokens / Call = 1800, Average Output Completion Tokens / Call = 450) it returns Monthly input & output volume: In = 810M tok/mo · Out = 202.5M tok/mo. Change any input and the results update from the same equation.
Governing equationCost_mo = M_in · P_in · [(1 − r)·1.25 + r·m_read] + M_out · P_out (illustrative defaults; selector list prices verified Nov 2026)
Model assumptions
Every input token that is not a cache hit is assumed written to the cache at 1.25 times the input price: an upper bound, since a part of the prompt that is never cached costs less. Batch + cache = 0.50 x the cached bill, because Anthropic states the multipliers stack with the Batch API discount. A listed model replaces the three price fields with its own prices and cache multiples. Google's hourly cache storage fee is not modeled.
Why Output Tokens Drive a Large Share of the API Bill
API providers bill input and output tokens at different rates, and output tokens cost more. The default of $2.50 and $10.00 per million tokens is illustrative, not the list price of any model. Pick a model in the selector to price the same traffic at its list prices from the Anthropic, OpenAI or Google pricing pages (verified Nov 2026), or keep Custom and enter your own pair.
Monthly volume is calls per day x 30 x tokens per call. At the default 15,000 calls a day with 1,800 input and 450 output tokens, the calculator projects 810 million input tokens and 202.5 million output tokens a month. The uncached monthly bill at the default prices is 810 x 2.50 + 202.5 x 10.00 = $4,050.00.
| Daily Requests | Monthly Input (M) | Monthly Output (M) | Standard Cost | With 60% Cache | Batch API (-50%) |
|---|---|---|---|---|---|
| 1,000/day | 54.0M | 13.5M | $270.00 | $210.60 | $135.00 |
| 5,000/day | 270.0M | 67.5M | $1,350.00 | $1,053.00 | $675.00 |
| 15,000/day | 810.0M | 202.5M | $4,050.00 | $3,159.00 | $2,025.00 |
| 50,000/day | 2700.0M | 675.0M | $13,500.00 | $10,530.00 | $6,750.00 |
| 100,000/day | 5400.0M | 1350.0M | $27,000.00 | $21,060.00 | $13,500.00 |
| 250,000/day | 13500.0M | 3375.0M | $67,500.00 | $52,650.00 | $33,750.00 |
How to Evaluate Prompt Caching and Batch Pricing Math?
Cache reads are billed at a fraction of the base input price and cache writes at a premium. Anthropic lists a 5-minute write at 1.25 times and a read at 0.10 times on most models (platform.claude.com/docs/en/build-with-claude/prompt-caching, checked November 2026); OpenAI's GPT-6 table lists a 30-minute write at 1.25 times, and Google lists no write premium, only an hourly storage fee. The calculator assumes every token that is not a hit is written at the write multiple, an upper bound: cached input = M_in x P_in x [(1 - r) x w + r x m_read]. At 60 % hits the default cached bill is 810 x 2.50 x (0.40 x 1.25 + 0.60 x 0.10) + 202.5 x 10.00 = $3,159.00, against $4,050.00 uncached.
Caching pays only above a break-even hit rate of about 22 % (1.25 - 1.15 x r = 1); below it the write premium costs more than the reads save, and the calculator reports the extra cost. Read multiples differ by model: 0.10 on most, 0.05 on Opus 5.5, Sonnet 5.5 and GPT-6.1 Sol and Terra, 0.025 on Fable 5.1. Sonnet 5.5 ($2.00 input) at 60 % gives 810 x 2.00 x (0.40 x 1.25 + 0.60 x 0.05) + 2,025.00 = $2,883.60. Batch is a flat 50 % on the uncached bill, 0.50 x $4,050.00 = $2,025.00; Anthropic says the cache multipliers stack with it, so Batch + cache is 0.50 x $3,159.00 = $1,579.50. Stacking is provider-specific.
| Model | List $ In / Out (per 1M) | Cached Monthly (60% Hit) | Cached vs Cheapest |
|---|---|---|---|
| Claude Haiku 5.5 (prompts up to 100k tokens) | $0.10 / $0.50 | $146.61 | 1x |
| GPT-6 Luna | $0.10 / $0.50 | $146.61 | 1x |
| Gemini 3.1 Flash-Lite* | $0.25 / $1.50 | $396.90 | 2.71x |
| Gemini 3.5 Flash-Lite* | $0.30 / $2.50 | $618.03 | 4.22x |
| GPT-6.1 Terra | $1.00 / $5.00 | $1,441.80 | 9.83x |
| Claude Sonnet 5.5 | $2.00 / $10.00 | $2,883.60 | 19.67x |
| GPT-6.1 Sol | $2.00 / $10.00 | $2,883.60 | 19.67x |
| Gemini 3.1 Pro Preview* | $2.00 / $12.00 | $3,175.20 | 21.66x |
| Claude Opus 5.5 | $4.00 / $20.00 | $5,767.20 | 39.34x |
| Claude Fable 5.1 | $10.00 / $50.00 | $14,296.50 | 97.51x |
| GPT-6 Astra | $10.00 / $50.00 | $14,661.00 | 100x |
Worked Examples: Two Presets Calculated with Cost_mo = M_in · P_in · [(1 − r)·1.25 + r·m_read] + M_out · P_out
Worked Example 1 (Triage bot, 2,000 calls/day, illustrative $0.15 / $0.60 pricing): This preset sets Daily API Requests = 2000 Calls/Day, Average Input Prompt Tokens / Call = 1200, Average Output Completion Tokens / Call = 300, Prompt Cache Hit Ratio = 30 %, Input Price = 0.15, Output Price = 0.6, Cache Read Price = 0.10×. Evaluating Cost_mo = M_in · P_in · [(1 − r)·1.25 + r·m_read] + M_out · P_out gives: standard bill = 21.60 USD/mo, cached bill = 20.57 USD/mo, batch bill = 10.80 USD/mo, batch cached bill = 10.29 USD/mo, cache savings = 1.03 USD. Related in the Cloud, API, LLM & Automation Hub: LLM VRAM Calculator: Model Weights & KV Cache Sizing and API Rate Limit, Token Bucket & Backoff Calculator.
Worked Example 2 (Document extraction, 50,000 calls/day, illustrative $0.80 / $3.20 pricing): This preset shifts the operating inputs to Daily API Requests = 50000 Calls/Day, Average Input Prompt Tokens / Call = 3200, Average Output Completion Tokens / Call = 600, Prompt Cache Hit Ratio = 75 %, Input Price = 0.8, Output Price = 3.2, Cache Read Price = 0.10× to show what an unused prompt cache costs: at 3,200 input and 600 output tokens per call with a 75 % hit rate, the same traffic costs $6,720.00 a month without caching and $4,368.00 with it, so leaving the cache off overpays by about 54 %. The calculator returns: standard bill = 6,720.00 USD/mo, cached bill = 4,368.00 USD/mo, batch bill = 3,360.00 USD/mo, batch cached bill = 2,184.00 USD/mo, cache savings = 2352.0 USD. You can compare these limits with other calculators in the Engineering Studio.
Using Measured Token Counts in the Calculator
Prompt structure controls the hit rate. Static content (system prompt, tool definitions, reference documents) placed first can be cached, while content that changes at the start of the prompt breaks the cached prefix. Traffic has to reuse the prefix within the cache lifetime.
Sources
- Anthropic · Pricing (Claude Sonnet and cache multipliers)Claude Sonnet 4.5 and 4.6 at $3 input / $15 output per MTok; Claude Sonnet 5.5 at $2 / $10; Claude Fable 5.1 at $10 / $50. Cache writes (5 min) at 1.25 × base input and 1 h writes at 2 ×; cache reads at 0.10 × for most models, 0.05 × for Opus 5.5 and Sonnet 5.5, 0.025 × for Fable 5.1. Checked November 2026. Basis of the price examples and of the write and read multipliers. Claude Sonnet 5 and 5.5 list base input at $2 per MTok with a 5-minute cache write at $2.50, so the calculator's $2.50 default input price is an example and not the base price. Cache multipliers stack with other pricing modifiers, including the Batch API discount: the page states 'These multipliers stack with other pricing modifiers, including the Batch API discount'. Stacking is provider-specific, so the BATCH + CACHE figure applies to Anthropic and has to be verified for any other provider. Cache reads are 0.10 x base input for most models, 0.05 x for Sonnet 5.5 and Opus 5.5 ($0.10 per MTok on a $2 base) and 0.025 x for Fable 5.1 ($0.25 on a $10 base); the calculator takes the read multiplier as an input. Also read on 2026-11-05: Claude Opus 5.5 $4 input and $20 output; Claude Haiku 5.5 $0.10 / $0.50 for prompts up to 100,000 tokens and $0.50 / $2.50 above that; Claude Haiku 4.5 $1 / $5. Basis of the model selector's Anthropic rows.
- Anthropic · Prompt cachingCache write tokens are charged when content is first stored (5-minute write 1.25 × base input, 1-hour write 2 ×); cache read tokens cost 0.1 × base input; the default cache lifetime is 5 minutes. Basis of the cache-write premium, the read multiplier and the break-even hit rate of about 22 %.
- Google AI Studio · Pricing (Gemini paid tier, context caching)Paid tier, per 1M tokens: Gemini 3.1 Pro Preview $2.00 input and $12.00 output for prompts up to 200k tokens, caching $0.20; Gemini 3.5 Flash-Lite $0.30 / $2.50, caching $0.03; Gemini 3.1 Flash-Lite $0.25 / $1.50, caching $0.025 (text). Context caching also bills an hourly storage fee per 1M cached tokens ($1.00 on the Flash-Lite models, $4.50 on 3.1 Pro Preview), which the calculator does not model; the page lists no cache-write premium. Batch is 50 % of the standard price. Gemini 4 Argon, 3.8 Flash and 3.6 Flash have a scheduled price change and are left out. Page read 2026-11-05.
- OpenAI · Pricing (GPT-6 family, standard tier)Standard tier, short context (up to 272K input tokens), per 1M tokens: GPT-6 Astra $10 input, $1.00 cached, $50 output; GPT-6.1 Sol $2 / $0.10 / $10; GPT-6.1 Terra $1 / $0.05 / $5; GPT-6 Luna $0.10 / $0.01 / $0.50. The table also lists a 30-minute cache write at 1.25 times the input price and a 12-hour write at 2.5 times; the calculator uses the 30-minute write. The Flex/Batch rates are half the standard ones. Page read 2026-11-05.
Method and test suite: Calculation Methodology.
Frequently Asked Questions: LLM API Token Cost & Prompt Caching Calculator
Why does the cached bill still include the full output cost?
Caching reduces only the input side. Output tokens are generated for every call and are billed at the output price.
Does the calculator include the cache write premium?
Yes. Every input token that is not a hit is assumed written to the cache at the model's write multiple (1.25 times the input price for Anthropic and OpenAI, 1.0 for Google), an upper bound if part of your prompt is never cached. Below a hit rate of about 22 % at 1.25 times the premium outweighs the savings and the result shows the extra cost.
Are the batch and cached figures additive?
For Anthropic, yes: its pricing page states that the cache multipliers stack with the Batch API discount, so Batch + cache is half the cached bill ($1,579.50 at the default). Verify stacking for any other provider.
Should I enter words or tokens?
Tokens. Token counts depend on the tokenizer and the language, so take prompt_tokens and completion_tokens from API responses rather than estimating from word counts.