How Inference Costs Shape Tiered LLM API Pricing
This article explains the inference cost structure behind tiered LLM API pricing. It covers the costs of cache-hit input, cache-miss input, and output tokens, and shows how KV Cache reuse and the input-to-output ratio change the effective price per token. Two worked examples compare an enterprise coding agent with an individual developer, and the article closes with engineering practices for lowering API bills.
Recent API price changes from a large model provider have drawn attention. The new generation model’s output price is roughly four times the previous generation’s, and its input price is roughly three times higher. The cache-hit input tier rose more modestly. On the surface, this looks like an across-the-board price increase. However, once the three tiers are separated and calculated against real usage patterns, the picture changes. This adjustment is better understood as a redesign of the billing structure than as a simple price hike.
This article does not focus on any single vendor. It discusses the technical and commercial logic that applies broadly to LLM API pricing.
1. What Each of the Three Price Tiers Reflects
To understand the pricing, you first need to understand the cost structure of LLM inference. Each API call consumes tokens in three categories:
- Cache-hit input: The request’s prompt prefix closely matches earlier requests. The inference engine can reuse the KV Cache that was already computed and skip the expensive prefill step. This cost is very low and close to reading from GPU memory.
- Cache-miss input: The full prefill must run. Compute grows with sequence length, and in practice the linear term dominates. Costs can be significant in long-context scenarios.
- Output: Tokens are generated autoregressively during decode. Each generated token requires loading the full set of model weights once, so the process is limited by memory bandwidth. Output is the most expensive stage per token.
This explains why output is usually priced several times to several dozen times higher than input. The price gaps track real compute costs. In this adjustment, the ratio of output to cache-hit input rose from about 25x to about 50x, and the ratio of cache-miss input to cache-hit input rose from about 6x to 10x. The provider is deliberately widening the price gap between different usage patterns.
2. How Disaggregated Inference Raises Cache Hit Rates
A wider price gap only works if cache hits actually become common. The key technology behind this is the disaggregated inference architecture. Prefill and decode clusters are physically separated, and they share the KV Cache through a high-speed transport layer.
In traditional monolithic inference, the KV Cache is created and destroyed with each request’s lifecycle, so it is hard to reuse across requests. A disaggregated architecture with a global cache pool makes the following possible:
- Persistent KV Cache across requests and sessions: Identical system prompts, tool definitions, and code repository context need to be computed only once.
- Prefix-tree cache organization: Multi-turn conversations and historical context naturally form prefix chains. The hit rate increases with session depth.
- Cache-aware scheduling: Requests route to the nodes that hold the matching cache, which reduces redundant computation.
In scenarios such as coding assistants and AI agents, each request carries nearly the same system prompt and a large amount of context. Only a small amount of new content is appended at the end. For these workloads, cache hit rates above 90% are not unrealistic. In other words, the architecture determines whether the low cache-hit price is a real benefit or only a figure on paper.
3. Estimating Your Real Bill With Two Variables
List prices alone say little about actual cost. Two variables determine it: the input-to-output ratio and the cache hit rate. A general estimation formula is:
Effective input price = hit price × hit rate + miss price × (1 - hit rate)Blended cost ≈ (input ratio × effective input price + output ratio × output price) / (input ratio + output ratio)
Scenario 1: Enterprise coding agent. The input-to-output ratio is about 20:1, which is common in long-context coding tasks. The cache hit rate is 90%. Using the new pricing tiers:
- Effective input price ≈ 2 × 0.9 + 20 × 0.1 = 3.8 yuan per million tokens
- Blended cost ≈ (20 × 3.8 + 1 × 100) / 21 ≈ 8.4 yuan per million tokens
Scenario 2: Individual developer. Every prompt is different. The input-to-output ratio is about 5:1, and the cache hit rate is only 20%:
- Effective input price ≈ 2 × 0.2 + 20 × 0.8 = 16.4 yuan per million tokens
- Blended cost ≈ (5 × 16.4 + 1 × 100) / 6 ≈ 30.3 yuan per million tokens
The model and the price list are the same, but the second scenario’s unit cost is about 3.6 times the first. The adjustment amounts to a technical implementation of price discrimination. High-reuse, sticky enterprise workloads get an implicit discount, while low-reuse, exploratory usage pays a premium.
4. Engineering Practices for Developers
Once you understand the pricing structure, the optimization priorities become clear:
- Maximize prefix reuse: Place fixed content, such as the system prompt, tool schemas, and project documentation, at the start of the prompt. Put variable content at the end. Cache matching is a prefix match from the beginning, so any change in the leading content invalidates everything after it.
- Control output length: Output has the highest unit price. Using structured instructions to limit redundant generation saves more than trimming input.
- Session affinity and batch scheduling: Group requests from the same business line into nearby time windows to keep the cache warm. Avoid frequent context switching between unrelated tasks.
- Monitor two core metrics: Continuously track the cache hit rate and the input-to-output ratio in your logging and alerting systems. These metrics predict your bill better than the price list does.
- Compare blended cost when choosing a provider: Plug your real workload profile into the formula instead of comparing list prices alone.
5. Conclusion
LLM API pricing is shifting from a single per-token price to a layered pricing model based on computational characteristics. This shift raises the bar for cloud platforms, which need to keep up with cache infrastructure, scheduling strategies, and observability. For teams building AI applications, whether they select model services on platforms such as Baidu AI Cloud or run their own inference clusters, the core method is the same: understand the cost structure, optimize prompt layout, and shape your workload to fit the lower-priced tiers. The room to reduce your bill is often larger than it first appears.
