Evaluating the True Cost of LLM Inference and Subscription Plans

    Comparing LLM services solely by the price per million tokens is misleading. This article breaks down the real costs of LLM inference by introducing a unified token cost calculation model that factors in cache hit rates, regular input, output ratios, and timing. It explores how varying cache hit rates can drastically alter cost conclusions, evaluates the true value of subscription plans versus pay-as-you-go pricing, and provides a practical framework for enterprises to assess both pricing and non-price factors when selecting an LLM service.

    1. Why You Cannot Just Compare “Price per Million Tokens”

    In the pricing tables of Large Language Model (LLM) services, prices are typically listed separately for cached input, regular input, and output. When comparing different services, many people only focus on the unit price of cached input. For example, if one solution charges 0.115 per million tokens for cached input and another charges 0.05 during off-peak hours, they might directly conclude that the former is more than twice as expensive.

    This comparison is incomplete. The actual cost of API calls depends on at least four factors:

    1. Cache hit rate: How many input tokens can be billed at the cached price.
    2. Regular input ratio: Input tokens that do not hit the cache are usually billed at a higher price.
    3. Output token ratio: Content generated by the model often has a higher unit price.
    4. Call timing and plan rules: Off-peak pricing, peak rate limits, weekly quotas, and concurrency limits will all alter the final cost.

    Therefore, a reasonable comparison method is not to look at a single price item, but to break down a complete call into three parts: “cached input, regular input, and output,” and then perform a weighted calculation based on real-world proportions.


    2. Unified Token Cost Calculation Model

    Let the total call volume be (T), the cache hit rate be (r_c), the regular input ratio be (r_i), and the output ratio be (r_o). These should satisfy:

    [
    r_c+r_i+r_o=1
    ]

    If the unit prices for the three types of tokens are:

    • Cached input price: (P_c)
    • Regular input price: (P_i)
    • Output price: (P_o)

    Then the average cost per million tokens can be expressed as:

    [
    P_{avg}=r_cP_c+r_iP_i+r_oP_o
    ]

    When the total volume is 100 million tokens, the cost is:

    [
    Cost{100M}=100\times P{avg}
    ]

    The key here is that the proportions must be based on the same statistical caliber. For instance, “98% cache, 1.5% input, 0.5% output” means that out of all tokens, cached input accounts for 98%, regular input for 1.5%, and output for 0.5%. You cannot interpret 98% as the “hit rate among input tokens,” otherwise the calculation results will show a significant deviation.


    3. Cost Comparison in High Cache-Hit Scenarios

    Assume that a certain type of intelligent programming or long-context application has high repetitive input characteristics, with an overall token ratio of approximately:

    • Cached input: 98%
    • Regular input: 1.5%
    • Output: 0.5%

    Using the pricing caliber from public examples for estimation, a high-performance model solution costs about 12.57 per 100 million tokens, while an off-peak solution costs about 9.40.

    From the results, the off-peak solution does have a lower total cost. However, it is important to note that this does not mean it has an advantage in all scenarios, for the following reasons:

    1. High Cache Rates Are Not Achievable for All Businesses

    Cache hits usually rely on a relatively stable context prefix, such as:

    • Fixed system prompts;
    • Long-standing project specifications;
    • Repeatedly submitted code repository contexts;
    • Multi-turn Q&A on the same document;
    • Fixed-format task templates.

    If users change most of the context with every request, or if the call content is primarily one-off text, image transcription results, or real-time retrieved content, the cache hit rate may drop significantly.

    2. Output Ratios Amplify Cost Differences

    Many code generation, report writing, and automation tasks produce a large volume of output. Even if almost all of the input hits the cache, output tokens still need to be billed at the output price.

    For example, code completion usually involves short outputs and high-frequency calls; whereas code refactoring, documentation generation, and test case generation might involve long outputs. The average cost of both cannot be estimated using the same ratio.

    3. Off-Peak Pricing May Come with Time Restrictions

    If the low price is only valid during specific hours, enterprises must confirm whether tasks can be delayed. Online customer service, real-time programming assistants, and production system inference often cannot freely avoid peak hours. Estimating costs based purely on off-peak prices will underestimate the actual cost.


    4. When Cache Rates Drop, the Conclusion Can Completely Reverse

    Let’s adjust the cache hit rate down to 95% and recalculate including the regular input and output ratios. Using the same set of example calibers, the former solution costs about 14.92 per 100 million tokens, while the off-peak solution costs about 18.25.

    At this point, as the cache rate drops, the pricing conclusion changes: the off-peak solution that was originally cheaper might now be more expensive than the other solution.

    This shows that the cache unit price is not the final cost; what really matters is the contribution ratio of the cache price to the total cost. Total cost can be understood as:

    [
    Total Cost = Cached Input Cost + Regular Input Cost + Output Cost
    ]

    When the cache rate drops from 98% to 95%, although it is only a 3-percentage-point change, these tokens shift from low-priced cached input to higher-priced regular input. If the gap between the regular input price and the cached input price is large, the overall cost will rise rapidly.

    When evaluating budgets, enterprises are advised to establish at least three models:

    Scenario Cache Hit Rate Applicable Business
    Ideal Scenario 98% or higher Fixed context, repeated code analysis
    Normal Scenario 90% - 95% Multi-turn dialogue, project-level development
    Conservative Scenario Below 90% Real-time data, one-off long text

    Final procurement decisions should be based primarily on Normal and Conservative scenarios, rather than relying solely on the ideal cache rate.


    5. Subscription Plans Do Not Simply Equal Unlimited Calls

    In addition to pay-as-you-go billing, many intelligent programming services also offer monthly subscription plans. Common structures are divided into Basic, Pro, and Premium tiers, with monthly fees potentially around 118, 538, and 1078, respectively.

    Plans usually provide a weekly token quota, but this quota may be subject to the following conditions:

    • Different limits during peak and off-peak hours;
    • Different consumption multipliers for different models or task types;
    • Concurrency limits;
    • Throttling or pausing after exceeding the quota;
    • Quotas settled on a natural week or rolling cycle basis;
    • Subscription quotas may not necessarily be convertible into general API quotas.

    Therefore, the value of a plan must be evaluated from the perspective of “effective usable token volume,” not just the monthly fee.

    In an example of high cache rate and off-peak usage:

    • The Basic plan can process approximately 317 million tokens per week;
    • The Pro plan can process approximately 1.90 billion tokens per week;
    • The Premium plan can process approximately 4.43 billion tokens per week.

    If converted based on the corresponding pay-as-you-go prices, their monthly equivalent values are approximately 160, 955, and 2229, respectively. Compared to the monthly fees, the plan prices are about 50% to 70% of the equivalent API cost.

    This means that for users with stable usage, high cache hit rates, and who primarily work during off-peak hours, subscription plans may offer a clear cost advantage.


    6. How to Determine if a Plan Suits Your Needs

    You can use the following simple evaluation method.

    Step 1: Track Real Usage

    Do not estimate token counts based on feeling. Extract data from call logs:

    • Daily input tokens;
    • Daily output tokens;
    • Cache hit tokens;
    • Regular input tokens;
    • Peak and off-peak call volumes;
    • Token distribution across different task types.

    If the service provides usage details, record them continuously for at least one to two weeks to avoid being skewed by anomalous daily tasks.

    Step 2: Calculate Pay-As-You-Go Cost

    Multiply each type of token by its corresponding unit price, then sum them up:

    [
    C_{api}=T_cP_c+T_iP_i+T_oP_o
    ]

    Where (T_c), (T_i), and (T_o) represent the number of cached input, regular input, and output tokens, respectively.

    Step 3: Calculate the Plan’s Effective Unit Price

    If the monthly fee is (M) and the usable tokens within the cycle are (T_p), the converted unit price of the plan is:

    [
    P_{plan}=\frac{M}{T_p}
    ]

    However, (T_p) here must be the actual usable allowance, not the theoretical maximum on the marketing page. If peak-hour allowances are smaller, or if certain tasks consume a higher multiplier, the allowance needs to be discounted.

    Step 4: Factor in Idle Costs

    Even if a plan is cheap, if the quota cannot be fully utilized, it is not necessarily a good deal. The actual effective cost should be:

    [
    Effective Cost = \frac{Plan Price}{Actual Used Tokens}
    ]

    For example, if a monthly plan has a quota of 2 billion tokens but only 500 million are actually used, you should divide the plan price by 500 million, not 2 billion. When quota utilization is low, pay-as-you-go billing is often more flexible.


    7. Enterprises Must Also Consider Non-Price Factors

    For individual developers, price is usually the primary factor; however, in enterprise environments, the following metrics are equally important:

    1. Stability: Is it prone to rate limiting during peak hours? Are there noticeable latency fluctuations?
    2. Quota Predictability: Are plan quotas clear? How are overages handled?
    3. Data Security: Are the storage and usage scope of code, documents, and business data explicitly defined?
    4. Monitoring Capabilities: Can token costs be broken down by project, team, and user?
    5. Failover: Are multi-model or multi-provider backup strategies supported?
    6. Integration Costs: How much rework is required to integrate it into existing development workflows?
    7. Output Quality: Low prices combined with high rework rates can lead to an increase in overall costs.

    It is particularly important to note that model inference cost is only part of the total cost. If the generated code quality is unstable and developers need to frequently modify, test, and roll back code, the saved token costs may be offset by labor costs.


    8. Conclusion: Make Decisions Based on “Real Call Structure” Instead of Marketing Prices

    The core of LLM cost comparison is not determining which cache price is lower, but establishing a call model that fits your own business.

    In high-cache-rate scenarios, off-peak pricing may bring a clear advantage; when cache rates drop, regular input and output costs will quickly change the conclusion. Subscription plans are usually more cost-effective when quota utilization is high, the proportion of off-peak usage is large, and task volume is stable. However, for businesses with highly volatile usage or real-time call requirements, pay-as-you-go billing may be safer.

    The most recommended practices are:

    • Simultaneously calculate costs at 98%, 95%, and 90% cache rates;
    • Separately track peak and off-peak usage;
    • Account for input and output tokens separately;
    • Record the actual utilization rate of plan quotas;
    • Include latency, stability, rework rate, and management costs into the total cost.

    Only by completing this comprehensive accounting can you determine whether a specific model solution or subscription plan truly fits your development workflow. Comparing “how much per million tokens” alone often yields only partial conclusions, and may even lead to opposite procurement decisions.