Objective Reporting
Independent AI model, pricing, and benchmark coverage.
API Pricing Economics Desk

Prompt Caching and Batch APIs at Scale: Achieving 60-80% Spend Cuts Without Cache-Miss Traps

How engineering teams combine prefix caching, 50%-off asynchronous batch pipelines, and stable tool schemas to slash inference bills.

Dispatch Reference Metric: 50%-90% cached input read discount

Prompt caching and Batch APIs are now the two largest controllable line items in production LLM budgets, and they fail in opposite ways. Caching discounts repeated input tokens by 50% to 90% depending on provider and model; the three major Batch APIs take a flat 50% off every token in exchange for a 24-hour asynchronous completion window. Stacked on a 30,000-token coding agent, the pair takes a 20,000-session monthly workload from roughly $59,600 at list price to about $10,560. The distance between that figure and most teams’ actual invoices is set almost entirely by cache misses that no default dashboard surfaces.

Two Discounts, Two Mechanics

Prefix caching exploits a property of transformer inference: the key-value state produced by a token sequence is a deterministic function of that sequence. When two requests share a byte-identical prefix, the provider reuses the prefill computation and bills the shared portion at a read rate rather than a fresh-input rate.

Providers expose the mechanism differently. OpenAI’s version is automatic: any request whose opening 1,024 tokens match a recently seen prefix receives the discount in 128-token increments, with an optional routing key to improve cache locality across replicas. Anthropic requires explicit cache breakpoints, up to four per request, and prices the transaction in two parts: a write premium of 1.25x base input for the default 5-minute lifetime or 2x for a 1-hour lifetime, and a read rate of 0.1x, a 90% discount. Google sells cached content as a named object with a configurable TTL, charging a discounted token rate plus a storage fee per token-hour; newer Gemini models also apply implicit caching without configuration.

Batch APIs are blunter. Requests are queued, executed against spare capacity, and returned as a result file within a 24-hour target window. OpenAI, Anthropic, and Google all price standard batch tiers at 50% of synchronous list, and all three run batch traffic against separate rate-limit pools, a benefit that is often worth more operationally than the discount itself.

Caching and Batch Terms Compared

Dimension OpenAI Anthropic Google
Activation Automatic prefix match, optional routing key Explicit breakpoints, up to 4 per request Named cached content; implicit caching on newer models
Minimum prefix 1,024 tokens, 128-token increments 1,024 to 2,048 by model 1,024 to 32,768 by model
Cache read price About 50% off; up to 75% on some models 90% off (0.1x input) About 75% to 90% off, plus storage
Write premium None published 1.25x (5 min), 2x (1 hour) Per-token-hour storage fee
Default retention 5 to 10 min, up to 1 hour off-peak 5 min, refreshed on hit; 1 hour option Configurable, 1 hour default
Batch terms 50% off, 24-hour window 50% off, 24-hour window 50% off, 24-hour window

Vendor-reported list terms as of late 2026. Discounts, minimums, and retention windows vary by model tier and are subject to change; negotiated enterprise rates may sit below the batch discount.

Worked Example: A 30,000-Token Coding Agent

Take a session with a 30,000-token static prefix (system prompt, tool schemas, repository map), 25 turns, 600 new tokens appended per turn from tool output and user text, and 500 output tokens per turn. Assume list input at $3.00 per million tokens and output at $15.00, roughly a mid-tier frontier model.

Without caching, the agent re-sends the prefix every turn: 25 x 30,000 = 750,000 tokens, plus 180,000 tokens of conversation growth, for 930,000 input tokens. Input costs $2.79; 12,500 output tokens cost $0.19. Session total: $2.98.

With a 5-minute cache and one breakpoint at the end of the static prefix, the first request writes 30,000 tokens at $3.75 per million ($0.11), the next 24 read at $0.30 per million ($0.22), and the 180,000 growth tokens bill at full rate ($0.54). Output is unchanged at $0.19. Session total: $1.06, a 64% reduction. At 20,000 sessions monthly the bill falls from $59,600 to $21,120. Pushing the same traffic through batch as well halves it to $10,560, an 82% cut, provided the work is not interactive.

The sensitivity is severe. If the 5-minute TTL lapses twice mid-session, because a developer pauses to read a diff or a CI job queues, the prefix is rewritten three times instead of once. Writes rise to $1.46, reads fall to $0.11, and the session costs $2.30, a 23% saving rather than 64%. Break-even is short but real: at a 1.25x write premium, two reads repay the write; at 2x, three reads are required.

Limitations and Trade-Offs

Byte identity is the entire contract. A cache is a prefix match, not a semantic one. Changing a timestamp, a session ID, a feature flag, a trailing newline, or the serialization order of JSON tool definitions invalidates every token after the divergence point. Teams that build tool schemas from unordered maps in Go, or iterate over hash sets, have shipped agents that never hit cache once and paid the write premium on every request. The fix is structural: move volatile content to the end of the prompt or into the user turn, serialize tool definitions deterministically, and key on content hashes.

Write premiums are a bet, not a discount. Anthropic charges 1.25x to populate a cache whether or not anything reads it. Prefixes below the provider minimum are silently ineligible. A workload that writes caches without reading them pays 25% to 100% more than list price.

TTLs do not match human workflows. The 5-minute window resets on each hit, which suits tight agent loops but not a chat product where users think for ten minutes between messages. The 1-hour tier costs 2x on writes and needs at least three reads to pay off; on Google, long retention over a 200,000-token context can cost more in storage than the reads save.

Batch is not a latency tool. A 24-hour window, unordered result files, and per-request failures that must be resubmitted by custom ID rule out anything with an interactive SLO. Batch suits evals, backfills, nightly repository indexing, classification, and synthetic data generation. Stacking is also uneven: caching inside batch is supported on some providers and model tiers and not others, and the 50% applies to list price, so negotiated rates may already be lower.

Caching does nothing for output tokens. On long-generation workloads, output is the dominant cost and neither mechanism touches it. Every provider returns a cached-token count in its usage object; a hit-rate time series with an alert on step changes is the only reliable way to catch silent invalidation.

What to Watch Next

  • Whether extended cache retention, currently capped near an hour on most tiers, becomes a standard 24-hour option and at what premium.
  • Whether implicit caching spreads across model families, removing breakpoint management but also removing control over what gets written.
  • Published stacking rules for cache plus batch, and per-request cache telemetry in provider consoles rather than only in response payloads.