LLM API Cache Hit Pricing: A Technical Breakdown of Lower Input Token Costs
This article explains why a cloud MaaS platform would cut the price of cached input tokens to 20% of the original rate while keeping other billing items unchanged, and what that change means for developers. It covers how prefix caching (also called prompt or context caching) reuses KV Cache to skip prefill computation, the engineering constraints of strict prefix matching, cache expiry, capacity limits, and input-only savings. It then walks through the revised cost model, how to identify high-hit and low-hit scenarios, how to measure a token-weighted hit rate, and practical techniques such as prefix normalization, stable serialization, session-sticky routing, tiered caching, fallback plans, and cost observability. It closes with common misconceptions and an action checklist for reducing LLM input costs.
1. The Event in Abstract: A Typical “Cache Hit Input” Price Cut
A cloud provider’s model-as-a-service (MaaS) platform announced that, starting at 00:00 Beijing time on November 23, 2026, it would lower the price of its LLM service in a single region. The adjustment applies only to the “cache hit input” portion, which drops to 20% of the original price; all other billing items stay the same. The change also has a clear regional scope (one region) and a precise start time.
Abstracted into technical language, this announcement contains three key elements:
- The billing dimension is further subdivided: input tokens are no longer a single unit price but are split into “cache hit input” and “cache miss input.”
- The discount applies only to the reusable portion: the reduction covers only repeated input whose prefix matches exactly, which indicates the provider genuinely saves on cost through cache reuse and is passing part of that saving on.
- Regional and time boundaries are explicit: the price change rolls out region by region and takes effect at a precise zero hour, which requires an architecture that can route by region and support time-based splitting of cost accounting.
The direct implication for developers: the focus of cost optimization shifts from “sending fewer tokens” to “making tokens reusable.”
2. How Prompt Caching Works
LLM inference is autoregressive: computing attention at each layer requires the key-value pairs (KV Cache) of all previous tokens. In a standard request, this intermediate state is discarded when the request ends, so even an identical prefix must be recomputed next time.
Prefix caching (often called prompt caching or context caching in the industry) works by indexing the intermediate state with the prefix of the input sequence and retaining it. When a new request’s prefix matches the cached content token by token, the intermediate state is reused directly and that portion of prefill computation is skipped.
This yields several constraints that engineering must respect:
- Matching is strict prefix matching: everything must be identical from the first token; any difference in the middle prevents all subsequent content from hitting.
- Hits are time-sensitive: cache entries have an expiry, and long periods without access cause eviction and invalidation.
- Hits have capacity and isolation boundaries: cache space is limited and isolated per tenant/session, so long-term residency cannot be guaranteed.
- Only the input side benefits: output tokens still have to be generated one by one, so caching cannot reduce output cost.
An illustrative way to organize requests (pseudocode, showing structure only, not any specific API):
# Bad example: putting the timestamp first makes the prefix different every timeprompt_bad = f"Current time {now()}, here is the product manual: {manual}"# Good example: stable content first, variable content lastSYSTEM = "You are a technical support assistant. Here is the product manual (fixed):\n" + manualdef build_request(user_query, ts):return [{"role": "system", "content": SYSTEM}, # long, stable prefix{"role": "user", "content": f"{user_query}\n[request time: {ts}]"},]
3. How the New Billing Model Changes the Cost Structure
Let the original unit price of cache hit input be P; after the adjustment this portion becomes 0.2P. Let total input tokens be I, the hit ratio be h, and the miss unit price be P_u. Then:
Original cost = I * (h * P + (1 - h) * P_u)New cost = I * (h * 0.2P + (1 - h) * P_u)Savings = I * h * 0.8P
The conclusion is clear: savings are directly proportional to the hit ratio, the hit unit price, and total input volume. When long documents, system prompts, and tool definitions make up a large share of the input, P is often close to or even higher than the miss price, so the optimization leverage is greatest. Conversely, if requests are all short, standalone question-answer pairs, h approaches 0 and the price cut brings almost no benefit.
Note that specific unit prices, cache validity periods, capacity limits, and similar parameters should be taken from the provider’s current official billing and documentation; this article makes no numerical assumptions.
4. Identifying Cacheable Scenarios and Measuring Hit Rate
Typical high-hit scenarios include: long system prompts and role settings, product manuals and specification documents, codebase context, tool/function definition lists, historical prefixes in multi-turn conversations, and fixed templates shared across batch tasks.
Low-hit scenarios include: unique long text per request, context concatenated in random order, conversation history that is summarized before concatenation (the summary differs each time), and multiple tenants sharing one very long prefix whose contents differ.
For measurement, build your own observability: on the application side, record each request’s input token count, hit token count (collect it directly if the response exposes that metric, otherwise estimate it by comparing prefix hashes across consecutive requests), and the distribution of cache invalidation reasons. The core metric is the weighted hit rate:
Weighted hit rate = Σ(cached input tokens) / Σ(total input tokens)
Weight by tokens rather than counting requests, otherwise a large number of short requests will mask the waste in long-context requests.
5. Engineering Practice: Concrete Ways to Raise the Hit Rate
- Prefix normalization: assemble in a fixed order — system instructions → tool definitions → static knowledge → conversation history → current question — and never put timestamps, request IDs, or random numbers in the prefix.
- Stable serialization: unify JSON key order, whitespace, casing, and newline style to avoid byte-level differences for semantically identical content.
- Session-sticky routing: pin the same session to the same instance/region to reduce invalidation caused by load-balancer drift; since this price cut applies to a single region only, it also signals the need to account for cost by region.
- Tiered caching strategy: split very long static knowledge into multiple stable blocks and retain them by access frequency; place frequently changing content later.
- Invalidation and fallback plans: automatically fall back to full prefill when the cache is unavailable, prioritizing correctness; set timeouts and retry limits for latency-sensitive paths.
- Cost observability: build a token cost dashboard by business line and scenario, listing “hit unit price × hit volume” separately to make it easy to assess the impact of price changes.
6. Common Misconceptions
- Assuming a price cut equals lower total cost: if the hit rate stays flat while call volume rises, total spend can still increase.
- Sacrificing quality for hits: moving necessary user context outside the prefix can produce irrelevant answers.
- Ignoring output cost: output tokens are usually more expensive and cannot be cached, so compressing output length is often more effective than optimizing input.
- Treating the cache as persistent storage: caching is a performance and cost optimization mechanism with no reliability guarantee; business data must be persisted to a database.
7. Action Checklist
- Inventory the top 10 high-frequency request templates and calculate their share of input tokens.
- Complete prefix normalization changes and measure the change in weighted hit rate via a canary rollout.
- Build a cost dashboard that splits hit/miss metrics by region and scenario.
- Align billing with the effective time point to avoid cross-period accounting errors.
- Add “stable prefix + variable suffix” to coding standards and review checklists so the optimization is sustainable rather than a one-off.
