LLM API Cost Analysis: Why Identical Unit Prices Can Produce Very Different Monthly Bills

    This article explains why identical listed token prices for LLM inference do not guarantee identical monthly bills. It presents a reusable cost model, examines six commonly overlooked billing variables—cache hits and writes, batch discounts, free credits, subscription and off-peak rules, region factors, and model lifecycle—and shows how to compare platforms using a unified real workload. It also provides a calculation example, pseudocode, and a cost governance checklist.

    LLM API Cost Analysis: Why Identical Unit Prices Can Produce Very Different Monthly Bills

    When selecting an LLM inference service, many teams start by comparing the input price per million tokens, the cache-hit price, and the output price. When several platforms appear to have the same standard pay-as-you-go unit prices, it is easy to conclude that “it does not matter which one we choose.” However, the listed price is only one linear coefficient in the billing function. The actual monthly bill also depends on usage structure, cache hit rate, cache write cost, batch task discounts, free credits, subscription plans, off-peak rules, regional differences, and model lifecycle. A consistent listed unit price does not mean a consistent effective unit cost, and a consistent effective unit cost does not mean the monthly total cost is predictable.

    This article does not focus on a specific platform or model. Instead, it abstracts “same unit price, different bill” into a general LLM inference cost accounting problem and provides a reusable analysis framework, calculation method, and governance checklist.

    1. Build the Right Cost Model First

    When comparing prices, at least three concepts must be distinguished:

    1. Listed price: the price per million tokens shown on the pricing page, usually divided into input, cache hit, output, and other tiers.
    2. Effective unit price: the actual amount paid divided by total tokens after including cache hits, batch discounts, regional factors, free credits, and subscription offsets.
    3. Marginal cost: the incremental cost of each additional request above existing subscriptions, credits, or committed usage. It determines whether scaling, load testing, and peak traffic are cost-effective.

    A simplified but practical monthly cost model can be written as:

    1. Monthly cost =
    2. Σ[ input miss tokens × input price
    3. + input hit tokens × cache hit price
    4. + output tokens × output price
    5. + cache write tokens × cache write price ]
    6. × region factor
    7. × batch discount factor
    8. - available credits
    9. + subscription fixed fee

    We can further define:

    1. Effective unit cost = monthly cost ÷ total monthly tokens
    2. Cache hit rate h = input tokens hitting cache ÷ total input tokens

    Many billing differences are not caused by “the unit price changed,” but by one term in the formula above being ignored. For example, cache writes may be priced separately, batch tasks may apply only to some models, free credits may have expiration dates and scope limits, subscription plans may cover only some models, overseas regions may have higher unit prices, and old models may be retired and force migration to a new price tier. The following sections break these down one by one.

    2. Six Billing Variables That Are Easiest to Overlook

    1. Cache Hits and Cache Writes: A Low Hit Price Still Includes Write Costs

    Prefix caching is an important way to reduce the cost of repeated context. The basic logic is that when multiple requests share stable prefix content, the platform can reuse already-computed intermediate results, and the hit portion is billed at a lower cache-hit price. But caching is not “free acceleration.” At least three points need to be accounted for:

    • Whether cache writes are priced separately: some billing rules price cache writes separately by TTL tier. For example, shorter TTL and longer TTL writes may have different costs.
    • Default TTL and invalidation policy: caches usually have a time-to-live, which may be several minutes by default. After the TTL expires, the cache must be written again. Request intervals, prefix stability, and concurrency patterns all affect the actual hit rate.
    • The hit rate is not 100%: if the prefix changes frequently, requests are scattered, or context concatenation order is unstable, the hit rate will drop significantly, and cache benefits will be offset by write costs and missed input costs.

    A simple example illustrates this. Assume the input price is CNY 20 per million tokens, the cache-hit price is CNY 2 per million tokens, and the output price is CNY 100 per million tokens. A workload processes 1 million input tokens and 0.2 million output tokens per month.

    1. No cache:
    2. Input cost = 1 × 20 = 20
    3. Output cost = 0.2 × 100 = 20
    4. Total = 40
    5. 60% hit rate, excluding write cost for now:
    6. Missed input = 0.4 × 20 = 8
    7. Hit input = 0.6 × 2 = 1.2
    8. Output = 20
    9. Total = 29.2

    If the cache write cost is CNY 5 per million tokens and 0.4 million tokens need to be written, this adds CNY 2, for a total of CNY 31.2. Compared with no cache, this still saves about 22%, but it is no longer as dramatic as “the hit price is only one-tenth of the input price.” If the hit rate drops to 30%, the savings narrow further. Therefore, the core of cache optimization is not simply “enable caching,” but designing stable prefixes, improving hit rates, controlling write frequency, and including write costs in the accounting.

    2. Batch and Asynchronous Discounts: Trading Latency for Cost

    Batch inference usually allows non-real-time tasks to be queued for execution in exchange for a discount from the standard price. For example, some rules may bill at 60% of the standard price. This is suitable for log analysis, offline evaluation, data cleaning, batch generation, and other latency-insensitive scenarios, but not for online chat, real-time risk control, or other strongly interactive tasks.

    When accounting for this, note:

    • Whether the discount applies to the target model, target region, and target billing item;
    • Whether batch tasks can be combined with cache hits;
    • Whether queuing time, failure retries, and result storage introduce additional costs;
    • Whether online and offline traffic are mixed in the same budget, causing the average unit price to be pulled down by “apparently cheap” batch tasks while online peak traffic remains expensive.

    If 50% of monthly workload can be shifted to batch tasks and the batch discount is 60%, overall cost may drop by about 20%. If the batch-eligible share reaches 80%, the reduction will be more significant. This is one common source of “same unit price, bill differs by half.”

    3. Free Credits: One-Time Offsets, Not Long-Term Unit Prices

    New models or new users often receive one-time free credits, such as a certain number of million tokens. Free credits can significantly reduce trial-period bills, but you must confirm:

    • Whether the credits cover only input, or also output, cache writes, and batch tasks;
    • Whether there is an expiration date, model scope, or region scope;
    • Whether credits are applied automatically or must be claimed;
    • The billing tier after the credits are exhausted;
    • Whether free credits affect rate limits, priority, and service levels.

    Free credits are suitable for proof of concept and migration evaluation, but they cannot be directly converted into long-term marginal cost. Amortizing one-time credits into an annual budget can easily underestimate real spending after stable operation begins.

    4. Subscription Plans and Off-Peak Rules: Fixed Fees Plus Credits

    Some services offer subscription plans that cover certain models and quotas for a fixed monthly fee, with additional rules for off-peak usage. The key is to calculate the break-even point:

    1. Is the subscription worthwhile =
    2. fixed monthly fee < pay-as-you-go cost for the same workload - value of credits included in the subscription

    At the same time, pay attention to overage unit prices, covered models, concurrency limits, priority, off-peak time definitions, and whether unused credits roll over. For teams with stable and predictable workloads, subscriptions may reduce unit costs. For teams with highly variable workloads and frequent model switching, fixed fees may become sunk costs.

    5. Regions and Networks: Factors Beyond Unit Price

    The same model may have different prices in different regions. Overseas regions often have higher unit prices due to higher infrastructure, network, and compliance costs. Cross-region calls may also introduce additional network traffic, latency, and data processing requirements. Accounting should include region factors, cross-region traffic, disaster recovery replication, and compliance costs. For heavily regulated or low-latency workloads, do not select only the lowest-price region.

    6. Model Lifecycle: Old Model Retirement Can Change the Bill Structure

    Models are not permanent. Old models may stop being available to new users and be retired on a schedule. Official guidance usually recommends migration to newer versions. Migration brings three types of cost:

    • Price changes: the new model may have different input, cache, and output prices;
    • Compatibility costs: prompts, output formats, tool calls, and evaluation baselines need regression testing;
    • Migration risk: during gradual rollout, dual running may increase short-term costs.

    Therefore, price comparison must include a “version snapshot” and a “lifecycle plan.” A budget model that looks only at current unit prices and ignores future retirement and migration is incomplete.

    3. Use a Unified Workload for Comparable Accounting

    To answer “which platform is cheaper,” you cannot directly compare pricing pages. Instead, use the same sample of real workload. The recommended steps are:

    1. Sample real requests and count input tokens, output tokens, cache-hit tokens, and cache-write tokens;
    2. Separate online real-time traffic from offline batch traffic;
    3. Measure stable prefix ratio, request intervals, and TTL distribution to estimate the cache hit rate;
    4. Record a price snapshot for each candidate platform: model version, region, billing items, discount rules, and credit expiration;
    5. Calculate scenarios separately for no cache, cache enabled, batch, subscription, and regional uplift;
    6. Output the effective unit cost and monthly total cost range, not a single number.

    Pseudocode:

    1. function monthlyCost(usage, price, policy):
    2. miss = usage.inputTokens * (1 - usage.cacheHitRate)
    3. hit = usage.inputTokens * usage.cacheHitRate
    4. base = miss * price.input
    5. + hit * price.cacheHit
    6. + usage.outputTokens * price.output
    7. + usage.cacheWriteTokens * price.cacheWrite
    8. if policy.batchEligible:
    9. base = base * policy.batchFactor
    10. base = base * policy.regionFactor
    11. base = max(0, base - policy.credit)
    12. return base + policy.fixedFee

    This model is not intended to replace platform bills. It helps teams identify sensitive variables before selection. In practice, build a scenario table: what are the costs at 0%, 60%, and 90% hit rates; how much is saved at 0%, 50%, and 80% batch ratios; at what usage level the subscription fixed fee reaches break-even; and whether a 10% regional uplift is still acceptable. Only when listed prices are converted into effective unit prices and total cost ranges does price comparison become useful for decision-making.

    4. Cost Governance Checklist

    Finally, here is an actionable governance checklist:

    • Price snapshot: record the pricing page verification date, model version, region, TTL, discounts, and credit expiration to avoid budgeting with outdated prices.
    • Distinguish listed price from effective price: in monthly reports, show standard pay-as-you-go cost, discounted cost, post-credit cost, and effective unit cost together.
    • Cache prefix design: place stable system prompts, fixed knowledge snippets, and tool descriptions in the prefix to reduce disruption of the hit rate by dynamic content.
    • Batch task scheduling: move offline evaluation, data cleaning, and batch generation into queues that can tolerate latency, and account for retries and storage costs.
    • Subscription break-even: calculate the intersection of fixed fees and pay-as-you-go costs monthly, and regularly review plan coverage.
    • Budget alerts: split budgets by model, business line, region, and task type, and set alerts for abnormal usage.
    • Model lifecycle management: maintain a version inventory, migration windows, and gradual rollout evaluations to avoid forced scaling caused by old model retirement.
    • Load testing and regression: replay real traffic to verify cache hit rates, batch discounts, and rate-limit policies, avoiding “cheap on paper, more expensive in production.”

    Conclusion

    When LLM API pay-as-you-go unit prices are the same, it only means the linear billing coefficients are close. A monthly bill can differ by half because cache writes, batch discounts, free credits, subscription and off-peak rules, regional factors, and model lifecycle rules all interact. Developers and enterprise users should treat the pricing page as an input, real workload as the baseline, and effective unit cost plus monthly total cost range as the basis for decisions. Only by building a unified accounting model and monitoring it continuously can “apparently identical” unit prices be turned into predictable and governable inference costs.