How to Model the Total Cost of Large Language Model Inference Pricing
A higher price for a single token tier does not necessarily mean that LLM inference has become proportionally more expensive. This article explains how cache-hit rates, input-to-output ratios, and output pricing interact, then presents a reusable cost model for estimating effective cost per million tokens and per completed task. It also outlines practical engineering and capacity-planning strategies for keeping unit costs under control.
When the pricing table for a new generation of large language model inference services shows increases of several times, developers may quickly conclude that the service is no longer affordable. However, focusing on a single price tier can significantly overestimate the actual impact. Inference billing usually includes multiple tiers, such as uncached input, cached input, and output tokens. Input-to-output ratios, context reuse, and cache-hit rates vary widely across workloads, so the resulting total cost can differ by several times.
This article starts with the pricing structure, builds a reusable cost model, and discusses how to turn a nominal price increase into a manageable cost per effective unit of output.
1. Why List Prices Alone Do Not Reveal the Real Cost
Large language model inference is commonly billed across several dimensions:
- Input tokens
- Output tokens
- Cached input tokens
- Optional modes such as batch processing or asynchronous jobs
For developers, the most important billing factors are not simply the listed price per million tokens. They are how many effective tokens each business task consumes and which pricing tier those tokens fall into.
Assume the previous-generation service used the following relative pricing:
- Cached input:
c - Uncached input:
6c - Output:
25c
The new-generation service changes the structure to:
- Cached input:
c - Uncached input:
10c - Output:
50c
These values are relative examples rather than prices from a specific provider. Output pricing has approximately doubled, while uncached input pricing has increased by about 1.67 times and cached input pricing has remained broadly unchanged. At the same time, the uncached-to-cached input ratio has increased from 6 to 10, and the output-to-cached-input ratio has increased from 25 to 50.
This pricing structure creates a stronger incentive for cache reuse. Workloads that achieve higher cache-hit rates can substantially reduce input costs, while workloads that generate large amounts of output face greater marginal expenses.
| Pricing tier | Previous generation | New generation | Implication |
|---|---|---|---|
| Cached input | c |
c |
Relatively stable |
| Uncached input | 6c |
10c |
Higher penalty for cache misses |
| Output | 25c |
50c |
Higher marginal output cost |
| Uncached-to-cached ratio | 6 |
10 |
Greater value from cache reuse |
| Output-to-cached ratio | 25 |
50 |
Output budgets require separate control |
At least three variables are needed to evaluate whether the new model is actually more expensive for a given workload:
- Cache-hit rate
h - Input-to-output ratio
R - Relative output price
Looking only at output pricing may make long-context workloads with high cache reuse appear more expensive than they are. Looking only at input pricing, on the other hand, can understate the pressure on output-heavy workloads.
2. A Total Cost Model: Converting Tiered Prices into an Effective Cost
Let:
cbe the cached input pricembe the uncached input priceobe the output pricehbe the cache-hit rateR:1be the input-to-output ratio
The effective input price is:
C_input_eff = h × c + (1 - h) × m
The approximate blended cost per million tokens is:
C_total = (R × C_input_eff + 1 × o) / (R + 1)
Here, R represents the amount of input associated with one unit of output. Long-context coding assistants, document question answering, and enterprise knowledge-base agents may have input-to-output ratios of 10:1, 20:1, or higher. Low-frequency question answering and single-turn generation may have ratios closer to 3:1 to 5:1.
Using relative values, let c = 1, m = 10, and o = 50. This gives an uncached-to-cached ratio of 10 and an output-to-cached-input ratio of 50.
function estimate_cost(hit_rate, input_output_ratio, c=1, m=10, o=50):input_eff = hit_rate * c + (1 - hit_rate) * mtotal = (input_output_ratio * input_eff + o) / (input_output_ratio + 1)return input_eff, total# Enterprise long-context scenarioinput_eff_1, total_1 = estimate_cost(0.90, 20)# Low-frequency developer scenarioinput_eff_2, total_2 = estimate_cost(0.20, 5)
Scenario 1: Enterprise Agent
Assume an input-to-output ratio of 20:1 and a cache-hit rate of 90%.
The effective input price is:
0.9 × 1 + 0.1 × 10 = 1.9c
The blended cost is:
(20 × 1.9 + 50) / 21 ≈ 4.19c
Output accounts for approximately 56.8% of the total, while input accounts for about 43.2%. Although the output price is high, the combination of a high input-to-output ratio and a high cache-hit rate keeps the effective input cost low and the total cost within a manageable range.
Scenario 2: Low-Frequency Developer Workload
Assume an input-to-output ratio of 5:1 and a cache-hit rate of 20%.
The effective input price is:
0.2 × 1 + 0.8 × 10 = 8.2c
The blended cost is:
(5 × 8.2 + 50) / 6 ≈ 15.17c
The total cost is approximately 3.6 times higher than in the enterprise scenario. The difference does not come from using a different model price. It results from a low cache-hit rate, a high proportion of uncached input, and a lower input-to-output ratio that gives the expensive output tier a larger share of the total cost.
This explains why a pricing structure with relatively stable cached-input pricing and sharply higher output pricing naturally encourages engineering optimization. Cache hits act as a pressure-release mechanism for input costs, while output controls serve as a budget brake.
If a service uses techniques such as separated inference architecture, prefix caching, or session reuse to achieve a high cache-hit rate for long-context coding tasks, a high nominal price does not necessarily produce a proportional increase in enterprise costs. Conversely, if every prompt is substantially different and cache reuse is limited, uncached input can quickly increase the bill even when the input-to-output ratio is relatively high.
3. Cache-Hit Rate Is a New Cost Lever
The effect of cache-hit rate on total cost is not simply linear. It is amplified by the gap between uncached and cached input pricing.
Using the same parameters, reducing the enterprise workload’s cache-hit rate from 90% to 50% increases the effective input price from 1.9c to 5.5c. The blended cost rises from 4.19c to:
(20 × 5.5 + 50) / 21 ≈ 7.62c
That is approximately 1.82 times the original cost.
If the cache-hit rate falls from 90% to 30%, the effective input price becomes:
0.3 × 1 + 0.7 × 10 = 7.3c
The blended cost becomes:
(20 × 7.3 + 50) / 21 ≈ 9.33c
This is approximately 2.23 times the original cost.
Engineering teams should therefore treat cache-hit rate as a first-class metric alongside latency, throughput, and error rate. Practical improvements include:
- Keep system prompts and tool descriptions stable.
- Reduce unnecessary changes to prompt prefixes.
- Organize long documents, codebases, and knowledge-base content in a stable order to improve prefix reuse.
- Reuse historical context for conversational tasks instead of retransmitting all materials on every turn.
- Apply structured output constraints to reduce verbose explanations and repeated generation.
- Use asynchronous or batch modes for bulk workloads when appropriate, avoiding unnecessary use of high-cost execution tiers during peak periods.
- Build cost dashboards by scenario, tenant, and task type, separating cached input, uncached input, and output tokens.
4. Capacity Planning: Move from Price Comparison to Scenario Modeling
For enterprises and developers, a more reliable approach is to build a workload-level cost model instead of comparing the list prices of two model generations.
The process can be organized into four steps:
- Collect request-level data. Track input tokens, output tokens, cached input tokens, and completed tasks.
- Calculate workload metrics. Compute
handRfor each business line, and identify input-heavy and output-heavy workloads. - Compare old and new pricing. Apply the cost model and run sensitivity analyses, such as a 10-percentage-point decline in cache-hit rate, a doubling of the input-to-output ratio, or a 30% increase in output length.
- Set optimization priorities. Improve cache-hit rates first in workloads with high input-to-output ratios, and reduce redundant generation first in output-intensive workloads.
When using general-purpose cloud logging, monitoring, and object storage services, request-level token details can be stored in an analyzable dataset. Teams can then periodically review the relationship between cache-hit rate and unit task cost.
For enterprise agents, the primary metric should be the cost of completing one effective task rather than the listed price per million tokens. For low-frequency developers, output length and invocation frequency deserve particular attention. Repeatedly retransmitting large amounts of context in low-cache-hit workloads can quickly increase costs.
5. Conclusion
The pricing changes in next-generation large language model inference services represent a shift from a single token price toward tiered pricing with incentives for cache reuse.
Higher output prices directly increase the cost of output-intensive workloads. A larger gap between uncached and cached input prices also increases the value of maintaining a high cache-hit rate. Enterprise long-context workloads can keep total costs well below what the list price may initially suggest if they maintain strong cache reuse. Low-frequency workloads with low cache-hit rates and relatively short input-to-output ratios are more likely to feel the impact of price increases.
The key task for developers is to translate the pricing table into a business-level cost model. By continuously optimizing cache-hit rate, input-to-output ratio, and output length, teams can keep inference spending focused on effective business output.
