Input Cache Miss in LLM API Billing: Key Concepts and a Practical Guide
This article explains what an input cache miss means in usage-based LLM API pricing, how cache hits and misses are split within a single request, and which factors drive miss costs. It also covers emerging peak/off-peak time-based billing and practical engineering techniques—stable prefixes, dynamic content placement, off-peak batch scheduling, context control, and cost monitoring—to help developers lower input costs in long-context and multi-turn agent workloads.
1. What Is an Input Cache Miss
In the usage-based billing model of LLM APIs, the input side is usually split into two parallel billing items: input cache hit and input cache miss (also called regular input).
The technical basis for both is the KV (Key-Value) Cache mechanism. When a model processes input, it runs autoregressive attention over all input tokens and caches the Key and Value intermediate results produced at each layer. When a later request carries a prefix identical to a previous one, the server can reuse the cached KV results directly and skip the redundant prefill computation for those tokens—this is a cache hit. The billing rate for the hit portion is typically much lower than the standard input rate, because it saves a large amount of GPU compute.
By contrast, an input cache miss refers to the input tokens whose cache cannot be reused. The conditions that trigger a miss usually include:
- The prefix did not exist before: the request’s prefix was never loaded or generated on the server, so there is no reusable KV cache;
- The cache exceeded its lifetime: caches are not kept forever; once past the configured TTL (time to live), they expire, and requesting the same content again requires recomputation;
- The cache was evicted by the server: constrained by GPU memory capacity, servers typically use eviction policies such as LRU, so caches for cold prefixes may be cleared.
The missed portion is billed at the standard input rate and must undergo full prefill computation. It is the main component of input cost in long-context scenarios.
2. How Hits and Misses Coexist
In a real request, hits and misses often appear together, and understanding how they are split is critical for cost accounting:
- Stable prefix → billed as a hit: parts that stay unchanged across multiple turns, such as the system prompt and prior conversation context, can usually hit the cache;
- New suffix → billed as a miss: content added in the current turn, such as the user’s new question or newly attached document content, is new and can only be billed at the full regular input rate.
Total input cost for this request = (hit token count × hit rate) + (miss token count × standard input rate).
Take a multi-turn conversation as an example:
Turn 1: System Prompt + Question A→ all missed, billed at full rateTurn 2: System Prompt + conversation history + Question B→ System Prompt and history hit (low rate)→ Question B missed (full rate)Turn N: only the newly added content is billed at full rate; all other prefixes are reused at the low rate
As the number of turns grows, if the prefix stays stable, the share of full-rate new content keeps shrinking, so the cumulative cost of a long conversation drops substantially. This mechanism naturally encourages developers to organize input as “stable content first, dynamic content last.”
3. Key Factors Affecting Cache Miss Cost
- Prefix stability: modifying the system prompt every turn, reordering history messages, or inserting a dynamic timestamp into the context breaks prefix consistency and degrades parts that could have hit into misses.
- Request frequency and interval: caches have a lifetime, so low-frequency applications (such as hourly scheduled jobs) can easily let the cache expire between two requests.
- Concurrency and load: under high concurrency, server-side cache capacity is under greater pressure and eviction happens more frequently.
- Context length: the missed portion of a long-context request is more expensive to compute, so a single prefill costs more.
4. Peak/Off-Peak Time-Based Billing: The Direction of Miss Billing
As LLM inference infrastructure scales, the industry has introduced a finer billing dimension—peak/off-peak time-based billing. The core logic is that inference clusters are compute-constrained during peak hours and have spare resources during idle hours, so cache-miss input (the compute-intensive part that directly consumes GPU compute) is priced differently by time period, with a lower rate during idle hours.
Typical time-based rules include:
- Weekday peak and idle periods: during peak hours (usually working hours), missed input is billed at a higher standard rate; during idle hours (such as night), it is billed at the off-peak rate;
- Weekends billed at the off-peak rate all day: because overall load is lower, some platforms apply the off-peak rate to the whole of Saturday and Sunday;
- Rules differ by model family: the effective hours and billing tiers for lightweight Flash-class models and flagship Pro-class models may differ;
- Billing transparency: some platforms are beginning to gray-test a “show credits consumed this turn” feature on web and mobile, splitting a turn’s consumption into three dimensions—input cache hit, input cache miss, and output—to help users understand the cost breakdown directly.
5. Engineering Practices: How to Reduce Miss Cost
- Fixed-prefix design: place stable content such as the system prompt, tool definitions, and few-shot examples at the very front of the input and keep it byte-for-byte identical to maximize the hit ratio.
- Dynamic content last: put real-time changing data (current time, the user’s latest input) at the end of the input to avoid polluting the prefix.
- Batch processing during off-peak hours: schedule latency-insensitive offline batch jobs (document summarization, dataset labeling) to idle hours or weekends to take advantage of the off-peak rate.
- Control context growth: trim overly long history messages in time, or compress them into summaries. Note the tradeoff—trimming history changes the prefix and causes misses, so weigh the net benefit against the rate difference.
- Monitoring and cost attribution: parse the usage fields in API responses, tally hit/miss token counts per request, and build a cost dashboard by business dimension to continuously track the hit rate.
6. Summary
The input cache miss is the most “expensive” part of the input in LLM API cost structures. In essence, it is the set of tokens that cannot reuse the KV cache and must undergo full prefill computation. Developers should grasp three points: understand the principle behind the hit/miss split, raise the hit rate through stable-prefix design, and combine peak/off-peak time-based billing to schedule deferrable workloads into low-price periods. As long contexts and multi-turn agent calls become increasingly common, fine-grained cache cost management has shifted from optional to a required capability for engineering teams.
