LLM Cache Hit Rates and the Real Cost of Subscription Plans
Comparing LLM pricing requires more than looking at a single input or output rate. This analysis explains how cache hit rates, input-to-output ratios, usage periods, quota limits, and actual consumption affect total costs. It also compares pay-as-you-go model APIs with monthly coding subscriptions and provides a framework for calculating effective unit prices.
When evaluating large language model pricing, one of the most common mistakes is comparing only a single rate. One provider may offer cheaper cached-input pricing, while another may include a larger subscription quota. However, an individual price does not directly represent the final cost.
The actual bill is usually affected by several factors, including cache hit rate, the ratio between input and output tokens, usage periods, subscription validity, quota limits, and real usage intensity.
This article compares two general approaches:
- Token-based model APIs.
- Monthly AI coding subscriptions with usage quotas.
All amounts and usage figures below are examples for calculation purposes. Actual purchasing decisions should be based on the latest pricing rules for the relevant service.
1. Understand the Three Types of Tokens
A typical LLM request can be divided into three categories of tokens.
1. Cached input tokens
These are tokens that have already appeared in previous requests, such as fixed system prompts, project conventions, codebase indexes, long-running context, or repeated file content. If the service can reuse the results of previous computation, these tokens may be billed at a lower rate.
2. Uncached input tokens
These are newly added tokens in the current request, including a user’s new question, recently modified code, current logs, and incremental context. They are typically charged at the standard input rate.
3. Output tokens
These are the tokens generated by the model, including answers, code, patches, explanations, and structured results. Output pricing is generally higher than cached-input pricing and can also be significantly higher than standard input pricing.
Therefore, a low cached-input price does not automatically mean that the total cost will be lower. The share of all three token categories must be considered.
2. A General Cost Formula
Assume the total token volume is (T), the cache hit rate is (r_c), the share of standard input tokens is (r_i), and the output share is (r_o), where:
[
r_c+r_i+r_o=1
]
Let the prices for cached input, standard input, and output be:
- (P_c): price per million cached tokens
- (P_i): price per million standard input tokens
- (P_o): price per million output tokens
The total cost can then be expressed as:
[
C=\frac{T}{1,000,000}\times(r_cP_c+r_iP_i+r_oP_o)
]
The value of this formula is that it converts a comparison of individual prices into a comparison of the actual blended cost.
For example, one plan may charge 0.115 yuan per million cached tokens, while another charges 0.05 yuan. The second plan appears to be less than half the price. However, if its standard input or output rates are higher, its final bill may not remain lower.
3. Results with a 98% Cache Hit Rate
Assume the request structure is:
- Cached input: 98%
- Standard input: 1.5%
- Output: 0.5%
At a total usage volume of 100 million tokens, the estimated cost is approximately:
- Plan 1: 12.57 yuan
- Plan 2: 9.40 yuan
This result shows that when the cache hit rate is extremely high, the cached-input price can have a significant effect on the final bill.
A 98% hit rate is not entirely unrealistic for workloads such as:
- Maintaining the same code repository over an extended period;
- Including the same project rules in every request;
- Using fixed system prompts and tool descriptions;
- Repeatedly analyzing the same set of files;
- Making incremental edits instead of submitting the full context each time.
In these scenarios, much of the token volume is not new content. It is context that has already been processed. As a result, differences in cached-input pricing become more significant.
However, 98% is a relatively ideal assumption. In practice, editor plugins may continuously change the context order, while tool results may append dynamic content. These changes can invalidate the cached prefix. Once the cache hit rate declines, the cost structure also changes.
4. What Changes at a 95% Cache Hit Rate
If the cache hit rate is reduced to 95%, the recalculated cost for every 100 million tokens is approximately:
- Plan 1: 14.92 yuan
- Plan 2: 18.25 yuan
Compared with the previous scenario, the conclusion reverses. Once the cache hit rate falls, the plan with the higher cached-input price becomes more cost-effective.
This highlights two important points.
First, the cached-input price is not the only important metric. The cache hit rate matters just as much.
Second, the cost advantage may change at a clear break-even point.
When the standard input and output rates differ significantly, a relatively small number of uncached tokens can create a substantial marginal cost. This is especially true for code generation, complex reasoning, and long-form output, where the output share may be much higher than 0.5%. In such cases, conclusions based on an extremely high cache hit rate should not be applied directly.
A more rigorous approach is to calculate the break-even cache hit rate for the two plans. By setting their blended unit costs equal, it is possible to determine the threshold. During procurement, historical usage data can then be used to determine whether the organization’s actual hit rate is above or below that threshold.
5. Why Cache Hit Rates Are Often Overestimated in Coding Workloads
Many teams estimate costs using a cache hit rate from marketing materials or general experience. Real-world environments may produce lower results for several reasons.
1. The context prefix changes
Caching often depends on a stable context structure. If timestamps, random identifiers, or dynamic logs are placed near the beginning of the prompt, subsequent content may no longer be reusable.
2. Files are modified
Some systems use prefix matching for caching. Even a small modification near the beginning of a file or context can prevent a large amount of subsequent content from being matched.
3. Tool results are unpredictable
Coding tasks often involve search, compilation, testing, and execution results. These values may change from one round to the next and should not automatically be treated as stable cached content.
4. Multiple projects are mixed together
When several projects are handled under the same account, their project rules, dependencies, and code contexts can differ substantially. The resulting cache hit rate is usually lower than during continuous development on a single project.
For this reason, enterprises should not base their budgets only on a theoretical cache hit rate. They should calculate the rate from real request logs:
[
\text{Cache hit rate}=\frac{\text{Cached input tokens}}{\text{All input tokens}}
]
They should also track cached input, standard input, and output tokens separately instead of looking only at monthly total token usage.
6. How to Convert Subscription Quotas into API Value
In addition to pay-as-you-go APIs, many AI coding tools offer monthly subscriptions. In this example, three plans cost 118 yuan, 538 yuan, and 1,078 yuan per month. Their weekly usage quotas during off-peak periods are approximately:
- Basic tier: 317 million tokens per week;
- Professional tier: 1.9 billion tokens per week;
- Advanced tier: 4.433 billion tokens per week.
If the weekly quota is multiplied by four weeks and valued using the same API pricing model, the estimated original API value is:
- Basic tier: approximately 160 yuan of API usage;
- Professional tier: approximately 955 yuan of API usage;
- Advanced tier: approximately 2,229 yuan of API usage.
Based on the nominal quota, the subscription price is approximately 50% to 70% of the corresponding API list value. This means that subscriptions can provide a meaningful discount if users can consistently consume most of their quota.
However, the phrase “can consume most of the quota” is critical. If actual usage reaches only 20% or 30% of the quota, the effective unit price rises considerably.
The real cost of a subscription should be calculated as:
[
\text{Effective unit price}=\frac{\text{Monthly fee}}{\text{Actual tokens consumed}}
]
It should not be calculated as:
[
\text{Effective unit price}=\frac{\text{Monthly fee}}{\text{Advertised quota}}
]
The difference between these two calculations often determines whether the subscription is genuinely cost-effective.
7. Peak-Period Restrictions Affect Real Value
Subscriptions commonly distinguish between peak and off-peak periods. In this example, peak hours are from 14:00 to 18:00, Monday through Friday, with a four-hour daily limit.
For individual developers, this restriction may be relatively manageable because substantial development work can still be performed in the evening and on weekends.
For enterprise teams, the situation may be different. Team members often use coding tools during weekday afternoons, which may overlap directly with peak periods. Available quotas, response times, or concurrency may therefore be affected.
When evaluating a subscription, consider:
- The working hours of team members;
- Whether multiple users need to share the plan;
- Whether concurrent usage is supported;
- Whether additional restrictions apply during peak periods;
- Whether weekly quotas can roll over;
- Whether unused quotas expire at the end of the month.
If unused quota cannot roll over and weekly usage varies significantly, a pay-as-you-go API may offer greater flexibility. Conversely, if a team has steady daily demand for code analysis and generation, a subscription usually provides more predictable budgeting.
8. Recommendations for Individuals and Enterprises
Individual developers can consider a combination of API usage and subscriptions:
- For low-frequency usage, prioritize pay-as-you-go billing;
- For intensive coding, consider a monthly subscription;
- When usage fluctuates substantially, observe actual token consumption for at least one month;
- If most work occurs outside peak hours, evaluate the plan’s available usage windows carefully;
- If projects are switched frequently, do not rely too heavily on an extremely high cache hit rate.
Enterprises should establish a complete cost-monitoring system:
- Track token consumption by user, project, and model;
- Separate cached input, standard input, and output;
- Measure cache hit rates for different projects;
- Record usage during peak and off-peak periods;
- Calculate the cost of each project per unit of code change;
- Set budget alerts for abnormal growth.
Output quality and development efficiency must also be considered. Suppose one option saves 1,000 yuan per month but requires developers to spend an additional 30 minutes each day correcting flawed code. The labor cost may be much higher than the apparent savings.
The real objective is not simply to find the lowest token price. It is to balance cost, quality, stability, and engineering efficiency.
9. Conclusion: Use Real Usage Structure, Not Promotional Pricing
A meaningful LLM cost comparison should include at least three steps.
First, separate cached input, standard input, and output, and identify the share of each category.
Second, model multiple cache hit rate scenarios, including at least high, medium, and low hit-rate cases.
Third, combine pay-as-you-go API costs with actual subscription consumption and calculate the effective unit price.
When the cache hit rate approaches 98%, a plan with lower cached-input pricing may have a clear advantage. When the hit rate falls to around 95%, standard input and output pricing become more influential, and the final conclusion may even reverse.
Subscriptions are generally more suitable for users with stable, high usage who can avoid the main peak-period restrictions.
The most reliable evaluation method is not to compare a single advertised number. Instead, build a complete cost model that includes token composition, cache hit rate, time restrictions, actual consumption, and developer productivity. Only then can you determine whether a seemingly inexpensive option truly fits your development workflow.
