All articles
LLM Economics

What Prompt Caching Actually Saves: The Token Math Behind LLM Gateways

Once caching is on, output tokens dominate your bill, so the input-token discounts everyone advertises matter less than you'd think.

Sep 15, 2026 · 4 min read
What Prompt Caching Actually Saves: The Token Math Behind LLM Gateways

Key takeaways

  • Prompt caching reduces the cost of repeated input tokens (system prompts, few-shot examples, long context) by charging a fraction of the standard rate on cache hits.
  • After caching kicks in, output tokens often make up 58-65% of total spend, shifting where you should optimize.
  • Provider-agnostic caching in an LLM gateway lets you get caching benefits even when routing between providers, instead of losing the discount every time you switch models.
  • Caching only helps when your prompts have a stable, reused prefix; highly dynamic prompts see little benefit.
  • Model your before/after cost per request to see whether caching is worth the added routing complexity for your workload.

What is prompt caching and why does it matter for cost?

Prompt caching lets a provider reuse the processed representation of a prompt prefix (system instructions, long context, few-shot examples) across multiple requests, charging a steep discount, often 50-90% off standard input token rates, for the cached portion instead of full price every time. For workloads with a large, repeated prefix and a small variable suffix (a support bot with a long system prompt and short user messages, for example), this can cut input-token costs substantially.

Why do output tokens dominate after caching?

A recent breakdown of provider-agnostic caching in LLM gateways found that once caching is active, output tokens can account for roughly 58-65% of total spend, up from a much smaller share when input tokens were priced at full rate. This flips the usual cost-optimization instinct: teams often focus on trimming prompts and context length, but if caching already handles the input side, the bigger lever becomes managing output length, response verbosity, unnecessary elaboration, redundant formatting, since output tokens are typically priced several times higher than input tokens across most providers.

What does provider-agnostic caching add?

Caching implementations tied to a single provider only help as long as you stay on that provider. A provider-agnostic gateway applies caching logic at the routing layer, so switching models for cost, latency, or capability reasons doesn't mean losing the cache discount every time. This matters increasingly as teams route requests across multiple providers based on task type or price, a rigid single-provider cache defeats the purpose of that flexibility.

Is caching worth it for your workload?

Caching pays off when your prompts share a large, stable prefix across many requests, think a fixed system prompt, a shared knowledge base excerpt, or repeated few-shot examples, and less so for prompts that are mostly unique per request. Before adopting a caching gateway, model your current cost split between input and output tokens, and estimate the cached-hit rate you'd realistically achieve given how often your prefix repeats.

The takeaway

Prompt caching is a real cost lever, but only if your prompts have a reusable structure, and once it's working, output token management becomes the bigger optimization target. Calcaas lets you model cost per request with and without caching assumptions to see where the real savings are.

Frequently asked questions

How much can prompt caching actually save?

Discounts on cached input tokens are commonly in the 50-90% range depending on the provider, but total bill savings depend on what share of your tokens are input versus output, since caching doesn't touch output token costs.

Why would output tokens become the bigger cost after caching?

Because caching only discounts the reused input prefix. Output tokens are generated fresh every time and are typically priced higher per token than input tokens, so once input costs shrink, output costs make up a larger share of what's left.

Does prompt caching work across different LLM providers?

Native caching is usually provider-specific. A provider-agnostic gateway implements its own caching layer so the benefit persists even when requests route to different providers.

How do I know if my prompts are a good fit for caching?

Check how much of your typical prompt is identical across requests (system instructions, shared context) versus unique per request. A high shared-prefix ratio is a good caching candidate; mostly-unique prompts see little benefit. (Note: place this JSON-LD inside a <script type="application/ld+json"> tag in the page head.)

ShareXLinkedInFacebook

More from the blog

The Margin Memo

Pricing math, in your inbox.

One short note a week on AI pricing, token economics, and margin. No spam, unsubscribe anytime.