Understanding LLM Pricing: How Prompt Caching Reshapes Inference Costs

    When people ask whether a new LLM generation got "more expensive," they usually compare a single headline number. That comparison almost never holds up. This article breaks down the three-tier pricing structure that mainstream inference services use today, explains why the ratios between tiers matter more than the absolute prices, and shows through scenario math why the same model can end up costing several times more or less depending on how you write your prompts. It also explains why long-context inference is superlinear in cost, and which engineering practices turn an expensive workload into a cheap one.

    1. Start With the Price Sheet: Pricing Has Three Tiers, Not One

    You cannot judge whether an LLM “raised prices” by looking at one aggregate number. Mainstream inference services bill in tiers, splitting the cost of a single call into three independent dimensions:

    • Input, cache miss: the prompt was not cached, so the model has to compute it from scratch;
    • Input, cache hit: the prompt prefix was already cached and matched, so the model reuses the computed intermediate state (KV Cache) and only processes the new portion;
    • Output (decoding): the model generates the result token by token. This cannot be cached, and it is the most expensive tier.

    To illustrate the structure (these are illustrative numbers used only to show the relationships between tiers, not the pricing of any specific product): suppose the previous generation priced output at roughly 27 per million tokens, with cache-miss input at about 6.5 and cache-hit input at about 1.1. A newer generation pushes output to 100 per million tokens, cache-miss input to about 20, and cache-hit input to about 2.

    Laid out as a table, the structure is immediately clear:

    Billing tier Previous gen (illustrative) New gen (illustrative) Multiple
    Output 27 100 ≈3.7×
    Input, cache miss 6.5 20 ≈3.1×
    Input, cache hit 1.1 2 ≈1.8×

    The conclusion is straightforward: the cache-hit tier rose the least, and the output tier rose the most aggressively. This is not an across-the-board increase. It is a deliberately designed tilt.

    2. The Multipliers Are the Real Signal

    The ratios between tiers matter more than the absolute prices, because they encode the behavior the provider wants from you.

    In the previous generation, cache-miss input cost about 6 times cache-hit input, and output cost about 25 times cache-hit input. In the new generation, those two ratios stretch to roughly 10× and 50× respectively.

    What does that mean? By widening the gap, providers are using price as a lever to push developers toward reusing prefix caches as much as possible. Every percentage point of additional cache hit rate now translates into a larger drop on the bill. The price structure has effectively become a best-practices manual: whoever keeps their system prompt and long prefixes stable gets a near-discounted unit price, while whoever sends a freshly written prompt on every request pays full price or a premium.

    3. Scenario Math: One Model, a 3x+ Cost Difference

    Abstract multipliers need concrete scenarios to land. Assume cache-hit input at 2, cache miss at 20, and output at 100 (illustrative values again), and compare two typical users.

    Scenario A: an enterprise-grade agent with a heavily reused long prefix
    Assume an input-to-output ratio of about 20:1 (common for long-context coding agents) and a 90% cache hit rate:

    1. Effective input price ≈ 2 × 0.9 + 20 × 0.1 = 3.8 per million tokens
    2. Output price = 100 per million tokens
    3. Blended cost = (20 × 3.8 + 1 × 100) / 21 ≈ 8.4 per million tokens

    Scenario B: an individual developer whose prompt differs every time
    Assume a 5:1 input-to-output ratio and a 20% cache hit rate:

    1. Effective input price ≈ 2 × 0.2 + 20 × 0.8 = 16.4 per million tokens
    2. Output price = 100 per million tokens
    3. Blended cost = (5 × 16.4 + 1 × 100) / 6 ≈ 30.3 per million tokens

    That is roughly a 3.6x difference. This is the point: against the same price sheet, an enterprise customer running the same system prompt over the long term, with high prefix reuse, effectively pays a discounted rate, while a developer who switches prompts on every request pays full price or a premium. Whatever “price increase” is being discussed, its real impact on the former is far smaller than the headline numbers suggest.

    4. Chat Era vs. Agent Era: Entirely Different Cost Magnitudes

    Why are providers willing to price output this high and still widen the caching multipliers? Because usage patterns changed.

    • Chat era: a single interaction is typically tens to a few thousand tokens. Users spend little, and they are insensitive to unit price, so pricing strategy has limited effect on their experience.
    • Agent era: one complex task routinely involves thousands of tool-calling steps and accumulates hundreds of thousands of tokens. Going further, multiple agents running in parallel and operating autonomously for days is a common pattern. Token consumption per task here is several orders of magnitude above the chat era, so even a small change in unit price is amplified into a large difference on the bill.

    This is also why an inference provider would likely lose money on agent workloads priced at the previous generation’s rates: cost does not scale in a linearly controllable way with token count. It is pushed up by characteristics of the underlying hardware resources.

    5. Why Long-Context Cost Is Superlinear

    To understand the pricing, you ultimately have to go back to the hardware cost structure of inference. Long context is expensive because three resources grow with context length:

    1. Memory footprint (KV Cache): autoregressive attention must retain Key/Value caches for every historical token, so memory usage grows linearly with sequence length and is amplified further during batching, which directly limits concurrency.
    2. Bandwidth consumption: during decoding, every generated token requires reading the entire historical KV Cache, so memory-bandwidth pressure accumulates as context grows. Decoding itself is memory-bandwidth bound.
    3. Compute (Attention): attention complexity grows superlinearly (roughly quadratically) with sequence length, and the compute cost of the prefill phase on very long prompts is particularly significant.

    This explains a key point: what a single call actually consumes is not simply a “token count.” It is the combined occupancy of memory, bandwidth, and compute. Cache hits cut costs so dramatically precisely because they let the model skip recomputing the KV Cache and re-running prefill. What gets saved is real physical resources, not just a number in a billing table.

    6. Optimization Practices: How to Turn Yourself Into Scenario A

    Since pricing places the cost lever on cache reuse, developers can actively reduce cost through engineering work.

    1. Keep the prefix stable and push volatile content to the end
    Put fixed content — the system prompt, tool definitions, long documents — at the very front of the prompt, and put volatile content such as user input, timestamps, and random IDs at the end. Prefix caching typically matches only the longest stable prefix, so any change early in the prompt invalidates the cache.

    1. # Cache-friendly (stable prefix, volatile content last)
    2. [fixed system prompt / tool schema / long background document]
    3. [this turn's user question / dynamic variables]
    1. # Cache-unfriendly (volatile content injected into the prefix; hit rate collapses)
    2. [timestamp: 2026-09-21 ...][fixed system prompt][this turn's question]

    2. Avoid needless perturbation of the prefix
    Do not re-serialize JSON, dynamically reorder the tool list, or inject an incrementing counter on every turn. These look harmless, but they make the prefix inconsistent at the byte level and break the cache. Fix the serialization field order and the template rendering approach.

    3. Take advantage of disaggregated inference architectures
    Mature inference services in the industry commonly adopt disaggregated inference (splitting the prefill and decode phases across separate resource pools) and KV-Cache-centric scheduling to achieve high cache hit rates. Your “stable prefix” strategy only pays off when you use this kind of service: whether the cache hits depends largely on server-side architecture, but the precondition is that you supply a reusable, stable prefix in the first place.

    4. Build cost observability
    Track cache hit rate, input-to-output ratio, and tokens consumed per task as monitoring metrics. An abnormal drop in hit rate is often the earliest signal that a prompt template was accidentally changed.

    7. Final Thoughts

    Faced with a new generation’s headline “output prices up several times,” the right response is neither to call it expensive nor to call it cheap, but to read the structure correctly: output is a rigid cost, while input is an elastic cost that caching can optimize. With agents now rolling out at scale, whoever raises prefix reuse, lowers their input-to-output ratio, and keeps long-context resource consumption under control will pay a far lower effective unit price under the same price sheet. Putting cache reuse into practice with general cloud capabilities — containerized deployment, message queues for task orchestration, monitoring and alerting for cost observability — is the most solid engineering answer to generational shifts in pricing.