The Real Cost of LLM Caching and Subscription Plans: A Token-Based Cost Model
Price per million tokens does not represent the final cost of an LLM application. Actual bills are usually driven by four factors: input tokens, output tokens, cache hit rate, and usage limits across time windows or subscription plans. This article explains how to build a blended unit-cost model, why a low cache price does not always mean lower total cost, how cache hit rate and output share affect results, and how to evaluate subscription plans with break-even analysis and effective value calculations.
In LLM applications, the “price per million tokens” shown on a price sheet does not directly represent the final cost. Actual bills are usually affected by four factors at the same time: the number of input tokens, the number of output tokens, the input cache hit rate, and usage limits across different time periods or subscription plans.
This is especially relevant in scenarios such as code generation, long-context question answering, document analysis, and AI-assisted coding. Many requests repeatedly carry system prompts, project directories, dependency descriptions, or historical conversations. If this content can be cached, the effective input cost of subsequent requests may drop significantly. Therefore, when comparing different models or service options, you should not look only at the cache unit price. You need a complete unit-cost model.
1. First Distinguish Three Types of Tokens
From a billing perspective, a model request can usually be split into three parts:
Cache-hit input tokens
This content has already appeared in previous requests and meets the cache conditions. It is usually billed at a lower price.Cache-miss input tokens
This includes context that appears for the first time, a changed user question, incremental code, or newly added documents. This part is billed at the regular input price.Output tokens
This includes text, code, structured data, or tool-call parameters generated by the model. Output prices are generally higher than input prices, so the output share can significantly affect the final bill.
Let total tokens be (T), the cache-hit ratio be (r_c), the regular input ratio be (r_i), and the output ratio be (r_o). Then:
[
r_c+r_i+r_o=1
]
If the prices of the three token types are (P_c), (P_i), and (P_o), all in CNY per million tokens, the blended cost per million tokens can be expressed as:
[
C_{1M}=r_cP_c+r_iP_i+r_oP_o
]
When the workload is (N) hundred million tokens, the cost is:
[
CN=100N \times C{1M}
]
The “100” appears because one hundred million tokens is 100 times one million tokens.
2. Why a Low Cache Price Does Not Guarantee Lower Overall Cost
Many cost comparisons focus only on the cache price. For example, one option may have a cache price of CNY 0.115 per million tokens, while another option has a cache price of CNY 0.05 per million tokens during a specific promotional period. On the surface, the former is more than twice the latter.
However, if cached content accounts for only part of total requests, the difference in cache unit price will be diluted by regular input and output costs. Conversely, if the cache hit rate is extremely high, the cache price will become the main determinant of total cost.
A simplified example can illustrate this.
Assume the token composition of a type of request is:
- Cache-hit input: 98%
- Regular input: 1.5%
- Output: 0.5%
In this case, the vast majority of tokens are billed at the cache price. Under the original calculation assumptions, the blended cost per 100 million tokens is about CNY 12.57 for Option A and CNY 9.40 for Option B. Option B is still lower, but the gap no longer equals the multiple between the cache unit prices.
If the cache hit rate drops to 95%, while the shares of regular input and output increase, the result may change. Under the same calculation assumptions, Option A costs about CNY 14.92 per 100 million tokens, while Option B costs about CNY 18.25. At this point, Option A becomes more cost-effective.
This result shows that model cost comparison is essentially a weighted-average problem, not a single-price comparison. An option with a lower cache price has a guaranteed advantage only when it can maintain a high hit rate.
3. Cache Hit Rate Is One of the Most Important Variables
Caching mechanisms usually require part of the request content to remain stable, for example:
- The system prompt remains unchanged for a long time;
- Project-level rule files change infrequently;
- Large documents or code repositories are repeatedly referenced;
- Conversation context is appended in a fixed order;
- Request prefixes have a high degree of repetition.
If the context prefix is modified on every request, or if dynamic content is placed before fixed content, the cache hit rate may decline. In engineering implementation, it is recommended to organize request content in the following order:
Stable system instructions→ Stable project description→ Fixed tool definitions→ Reused historical context→ Dynamic user question
This keeps stable content near the beginning of the context and concentrates dynamic content toward the end, increasing the probability of cache reuse.
However, cache hit rate should not be estimated only theoretically. A more reliable approach is to record the following metrics:
- Total input tokens;
- Cache-hit tokens;
- Cache-miss input tokens;
- Output tokens;
- Number of requests;
- Average context length per request;
- Changes in hit rate across different time periods.
With this data, you can directly calculate the real blended price instead of relying on idealized ratios.
4. Subscription Plans: Do Not Look Only at the Monthly Fee
In addition to pay-as-you-go APIs, many AI coding or development-assistance services also offer monthly subscription plans. Plans are usually priced by tier and set weekly or monthly usage quotas, while distinguishing between peak and off-peak periods.
Consider a set of example data:
- Basic plan: CNY 118 per month;
- Pro plan: CNY 538 per month;
- Advanced plan: CNY 1,078 per month.
Under assumptions of a relatively high cache hit rate and off-peak usage, the weekly usable token volumes for the three plans are approximately:
- Basic plan: 317 million tokens;
- Pro plan: 1.900 billion tokens;
- Advanced plan: 4.433 billion tokens.
If converted at original API prices, the corresponding values are approximately:
- Basic plan: CNY 160;
- Pro plan: CNY 955;
- Advanced plan: CNY 2,229.
This shows that the plan price is about 50% to 70% of the corresponding API value. For developers with stable usage and high request frequency, a subscription plan may be more cost-effective than pure pay-as-you-go API billing.
However, this conclusion must be based on several premises:
- Usage can actually reach the effective quota provided by the plan;
- Most requests occur during usable time periods;
- Plan restrictions are not triggered frequently;
- The task types are suitable for the models or features supported by the plan;
- Unused quota does not cause significant waste.
If a user generates only a small number of requests per month, the fixed monthly fee may result in higher total spending even if the plan has a lower unit price.
5. Peak-Hour Rules Change the Real Value of a Plan
Different services define peak hours differently. Some options may treat most weekday daytime hours as peak hours, while others restrict only several hours per day. You should not judge a plan as unusable merely because “peak restrictions exist.” Instead, calculate the actual impact.
For example, if an option defines 14:00–18:00 on weekdays as peak hours, only four hours per day are affected. For evening development, weekend use, or cross-time-zone teams, this restriction may not be severe.
During evaluation, you can build a simple time-utilization model:
[
U=\frac{\text{request volume during actually usable periods}}{\text{total request volume}}
]
If (U) is high, the plan quota can be fully used. If a large number of requests are concentrated in restricted periods, the nominal token quota cannot be fully converted into actual value.
Therefore, enterprise users should also observe:
- The working-time distribution of team members;
- Whether automated tasks run in concentrated periods;
- Whether overnight batch processing is restricted;
- Whether peak hours reduce concurrency or request speed;
- Whether quotas are shared by a single user, a single project, or a team.
6. Use Break-Even Analysis to Choose
Between pay-as-you-go APIs and subscription plans, the decision can be guided by the break-even point.
Let the monthly plan fee be (M), and the blended unit price of the pay-as-you-go API be (C). The token scale the plan needs to cover is approximately:
[
T_{break-even}=\frac{M}{C}
]
For example, if a plan costs CNY 538 per month, and the actual blended price is about CNY 18 per 100 million tokens, the theoretical break-even scale is approximately:
[
538\div18\approx29.9
]
That is, the plan would need to consume about 3 billion tokens per month to be roughly comparable to pay-as-you-go pricing on pure price terms.
In actual use, however, you also need to consider plan quota caps, time restrictions, non-rollover rules, and feature differences. Therefore, the real decision criterion should be:
[
\text{Effective plan value}=
\text{usable token value}
\times\text{actual utilization}
-\text{monthly fee}
]
If actual utilization is only 50%, the plan’s nominal quota cannot be fully counted as benefit.
7. Do Not Ignore the Amplification Effect of Output Tokens
In code generation, complex reasoning, and long-document processing scenarios, output tokens may be much higher than in ordinary question answering. Even if the input cache hit rate reaches 98%, as long as the output share rises, the final cost may still increase significantly.
For example, with a fixed input scale:
- When output accounts for 0.5%, blended cost may be mainly determined by cached input;
- When output rises to 2%, the impact of output pricing expands rapidly;
- When output reaches 5% or more, cache savings may be partially offset.
Therefore, cost optimization should not rely only on caching. It can also start from the output side:
- Limit unnecessary repeated explanations;
- Ask the model to return differences first;
- Use structured formats to reduce redundant text;
- Modify long code in chunks;
- Summarize historical results instead of passing the original text repeatedly;
- Set reasonable maximum output lengths for different tasks.
8. Build a Cost Table for Your Own Workload
Every team should maintain a real cost table containing at least the following fields:
| Metric | Meaning |
|---|---|
| Total requests | Number of requests in the reporting period |
| Total input tokens | Input scale of all requests |
| Cache-hit tokens | Input scale billed as cached |
| Regular input tokens | Input scale that misses the cache |
| Output tokens | Model-generated scale |
| Cache hit rate | Cache tokens / total input tokens |
| Blended cost | Actual cost after weighting token types |
| Cost per request | Blended cost / number of requests |
| Cost per task | Statistics by code task, Q&A task, and other categories |
It is also best to split the data by task type:
- Code completion;
- Code review;
- Document Q&A;
- Long-context analysis;
- Automated batch processing;
- Multi-turn dialogue.
Different tasks often differ greatly in cache rate, output share, and request peaks. Mixing them together can hide real problems.
9. Final Takeaways
LLM cost comparison should follow three principles.
First, do not compare only cache unit prices. Cache-hit input, regular input, and output must be placed into the same weighted formula.
Second, do not look only at a plan’s nominal quota. Calculate effective value by combining actual usage periods, cache hit rate, output share, and quota utilization.
Third, do not rely on a one-time calculation. Continuously record token consumption and billing data, and update model parameters weekly or monthly.
In scenarios with high cache hit rates, options with lower cache prices may be more advantageous. When the cache rate declines and regular input increases, the blended price ranking may reverse completely. Subscription plans are suitable for users with stable usage, frequent requests, and the ability to avoid restricted periods. For low-frequency users or teams with volatile demand, pay-as-you-go billing is usually more flexible.
The truly reliable choice is not to search for an absolutely cheap unit price, but to calculate each option’s cost per task, effective available quota, and long-term total spending based on your own request structure.
