LLM API Cost, Prompt Caching & Batch Break-Even Calculator (2026)

Compare monthly OpenAI GPT-5, Anthropic Claude 5.5, and Google Gemini 3.1/2.5 API bills with real prompt caching hit rates, cache write fees, multi-turn context growth, and 50% Batch discounts.

Checked 4 Dec 2026·Published 4 Dec 2026·Raw .md
Presets:
Monthly API requestsreq
Static system + tool prefixtok
New dynamic user tokens / turntok
Output tokens (incl. reasoning)tok
Prompt cache hit rate%
Turns re-sent per chat sessionturns
Lowest budget tier
$74.25
Gemini 2.5 Flash-Lite
GPT-5 est.
$1,131
$7.54 / 1K req
Claude Sonnet 5.5
$1,494
$9.96 / 1K req
Gemini 2.5 Flash-Lite · Google$74.25/mo (-42%)
Claude Haiku 5.5 (<=100K) · Anthropic$74.70/mo (-45%)
GPT-5 mini · OpenAI$226/mo (-42%)
Gemini 2.5 Flash · Google$311/mo (-34%)
o4-mini (Reasoning) · OpenAI$1,015/mo (-28%)
GPT-5 · OpenAI$1,131/mo (-42%)
GPT-4.1 · OpenAI$1,485/mo (-42%)
Claude Sonnet 5.5 · Anthropic$1,494/mo (-45%)
Key unit-economics rules
  • Prompt caching cuts repeated system/tool prefix costs by 75% to 90%, provided your static prefix exceeds 1,024–4,096 tokens and stays byte-identical.
  • Multi-turn chat history re-sends prior turns on every user message; a 10-turn conversation bills roughly 5.5x the input tokens of a single-turn call unless prefix caching hits.
  • Batch API endpoints slash both input and output rates by 50% across OpenAI, Anthropic, and Gemini for workloads tolerating up to 24-hour completion.

How does LLM prompt caching change your real monthly API bill?

Prompt caching splits your input payload into a reusable static prefix (billed at 10%–25% of standard input rates on cache hits) and dynamic per-request user tokens (billed at 100%), often cutting agent and RAG input bills by 60% to 85%.

Most basic token calculators multiply requests * (input_tokens * input_price + output_tokens * output_price). In production AI apps built in 2026 (especially tool-calling agents, code assistants, and document Q&A pipelines) that naive formula overstates or understates your real invoice by 3x to 6x. Three mechanics dominate your actual monthly spend:

  1. Static Prefix vs. Dynamic User Payload: System instructions, JSON tool schemas, and retrieved reference documents frequently span 2,500 to 25,000 tokens per call, whereas the user's new question may be only 150 tokens. When that static prefix clears the provider's minimum threshold (1,024 tokens on OpenAI and Claude Sonnet/Opus 5.5; 2,048–4,096 tokens on Gemini), cache hits drop input pricing by up to 90% (for example, GPT-5 drops from $1.25 to $0.125 per 1M cached tokens, and Claude Sonnet 5.5 drops from $2.00 to $0.20 per 1M).
  2. Cache Write & TTL Initialization Overhead: Anthropic bills explicit cache writes at roughly 1.25x base input rate ($2.50/1M on Claude Sonnet 5.5 for a 5-minute TTL), while Google Gemini explicit context caching charges an hourly storage rate alongside discounted read rates. If your traffic is too sparse to hit the warm cache before eviction, or if a dynamic timestamp at the top of your system prompt invalidates the prefix on every call, you pay cache-write overhead with zero read savings.
  3. Multi-Turn Context Accumulation & Hidden Reasoning Tokens: Stateless chat completions re-transmit the entire conversation history on turn 2, turn 3, and turn N. Without sliding-window truncation or high prefix cache hit rates, input token consumption grows quadratically (N * (N + 1) / 2). Meanwhile, reasoning models such as o4-mini bill internal chain-of-thought tokens at the full output token rate, meaning a 300-token visible JSON response accompanied by 2,400 internal reasoning tokens actually bills 2,700 output tokens.

When should you switch from real-time inference to Batch API?

Move any asynchronous pipeline, nightly evaluations, dataset classification, document extraction, SEO metadata enrichment, or bulk embeddings, to the Batch API whenever latency under 24 hours is acceptable, locking in an immediate 50% discount on both input and output tokens.

Unlike prompt caching (which only discounts repeated input prefixes), Batch APIs cut output token costs in half as well. Because output tokens cost 4x to 8x more than input tokens across GPT-5 ($10.00 vs $1.25/1M), Claude Sonnet 5.5 ($10.00 vs $2.00/1M), and Gemini 3.1 Pro ($12.00 vs $2.00/1M), workloads that generate long structured reports or code diffs often save more money from Batch execution than from prompt caching alone. In addition, Batch queues use separate rate-limit pools, preventing background backfills from triggering 429 Too Many Requests errors on user-facing endpoints.

Cost Lever Discounts Input? Discounts Output? Typical Real-World Savings Primary Gotcha
Prompt Caching Yes (50%–90% off prefix) No 45%–80% on agent/RAG workloads Dynamic variables before prefix bust cache to 0%
Batch API Yes (50% off) Yes (50% off) Flat 50% across total job spend Up to 24h turnaround; async webhook/polling required
Model Routing (Mini/Flash) Yes (80%–95% lower tier) Yes (75%–95% lower tier) 70%–90% when routing 80% of simple turns Needs confidence/complexity classifier guardrails
Output Schema Compression Minor Yes (20%–45% fewer tokens) 15%–35% on high-volume JSON extraction Overly terse keys can hurt zero-shot accuracy

How do we verify token pricing in this calculator?

Every model rate in StackQuota is loaded directly from our versioned data/pricing/llm-models.json ledger, checked against official OpenAI, Anthropic, and Google AI pricing documentation, and stamped with its exact verification date.

Our simulator separates static cached prefix tokens from fresh dynamic input tokens and models cache misses as explicit write/full-price events:

  • Cached Read Cost = Requests * StaticPrefixTokens * CacheHitRate * CachedInputRate
  • Uncached Prefix Cost = Requests * StaticPrefixTokens * (1 - CacheHitRate) * CacheWriteOrBaseRate
  • Dynamic Input Cost = Requests * DynamicInputTokens * MultiTurnFactor * BaseInputRate
  • Output Cost = Requests * VisibleAndReasoningOutputTokens * BaseOutputRate
  • Batch Adjustment = Total * 0.50 (when Batch mode is toggled on)

Production runbooks for LLM API

Common billing questions

Why is my actual OpenAI or Anthropic bill higher than input + output word counts suggest?

1,000 English words equal roughly 1,330 tokens (about 0.75 words per token), JSON schemas and tool definitions are re-sent on every turn, and reasoning models bill hidden chain-of-thought tokens at the higher output token rate.

Can you combine Prompt Caching with the 50% Batch API discount?

Provider rules vary by endpoint: Batch API guarantees a flat 50% discount off standard input and output tokens, whereas real-time Prompt Caching discounts cached prefix reads by up to 90% without discounting output tokens. Toggle both modes in the calculator above to see which wins for your input-to-output ratio.

What minimum prompt length is required for prompt caching to activate?

OpenAI and Anthropic Claude Sonnet/Opus 5.5 generally require at least 1,024 static prefix tokens, while Claude Haiku 5.5 and Google Gemini models require 2,048 to 4,096 tokens depending on model generation.

What changed1
  • 2026-12-04: Initial release with verified OpenAI GPT-5/GPT-4.1/o4-mini, Claude 5.5, and Gemini 3.1/2.5 token, cache, and batch schedules.
Sources checked3

Notice a provider pricing update? Report an outdated rate →