How to Calculate LLM Cost: Limited-Time Discounts vs. Cache Price Cuts

    This article breaks down large language model inference costs into three components—cache-miss input, cache-hit input, and output—and shows how to model them in a single formula so different pricing tiers can be compared fairly. It walks through a reproducible example with a fixed budget, compares per-request cost, affordable request count, and effective token throughput across pricing structures, and derives the break-even cache hit rate at which a discounted premium tier matches a cheaper tier. It also covers when high-quota plans make sense and ends with a practical optimization checklist for cost dashboards, prompt layering, context trimming, model routing, and budget guardrails.

    1. The Technical Logic Behind the Pattern: Why Discounts and Cache Price Cuts Appear Together

    When LLM providers adjust pricing, two moves often happen at the same time: a limited-time discount on higher-capability model tiers, and a long-term reduction in the price of cached input (cache hits). These look like marketing decisions, but they actually target two different parts of the inference cost structure.

    The cost of a single LLM inference call breaks down into three segments: input that misses the cache (cache miss input), input that hits the cache (cache hit input), and output. Uncached input requires a full prefill computation and carries the largest compute cost. Cached input reuses a previously computed key-value cache (KV Cache) and only incurs a smaller read-and-concatenation overhead. Output is generated token by token through autoregressive decoding, with a cost somewhere in between.

    So a “limited-time discount” usually applies to the overall price list as a short-term promotion, while a “permanent cache price cut” applies to the cache-hit segment as a long-term cost optimization. For developers working with long contexts, fixed system prompts, or multi-turn calls that repeatedly reuse the same prefix, the latter often delivers a larger real benefit than the former.

    2. Splitting the Bill into Three Parts: A Standard Cost Model

    To compare whether different model tiers are worth it, the first step is not to look at unit prices but to normalize the billing model. Write every option in the following form:

    1. Total cost per call =
    2. total input tokens × hit rate × cache hit price
    3. + total input tokens × (1 - hit rate) × cache miss price
    4. + total output tokens × output price

    On top of this, define three comparable metrics:

    • Cost per request: how much a single typical call costs;
    • Affordable request count: a fixed budget divided by the cost per call;
    • Effective usable volume: affordable request count multiplied by total tokens per call, used to measure “how much real work the same amount of money can handle.”

    The third metric is the one most often ignored. Many comparisons fixate on the per-million-token price, but in real workloads the output share and differences in hit rate can significantly change the conclusion.

    3. A Reproducible Example: Comparing Options Under a Fixed Budget

    Set a group of general assumptions so readers can swap in their own real numbers:

    1. Budget: 40 (currency units)
    2. Input per call: 51,000 tokens
    3. Output per call: 5,100 tokens
    4. Total per call: 56,100 tokens
    5. Input cache hit rate: 56%

    Under this model, cached input is about 28,560 tokens, uncached input about 22,440 tokens, and output 5,100 tokens.

    With these assumptions, different pricing structures produce results on the following scale (the numbers are illustrative estimates meant to demonstrate the method, not to represent any specific service):

    Option type Hit / miss / output price profile Cost per call Affordable calls Effective volume
    Low tier, same price for input and output 1 unit/token ~0.0374 ~1,070 ~60 million
    Low tier, tiered cache pricing 0.2 / 1 / 2 ~0.0384 ~1,043 ~58.51 million
    High tier, double rate 2 units/token ~0.0748 ~535 ~30 million
    High tier, discounted price 0.25 / 3 / 6 ~0.1051 ~381 ~21.36 million
    High tier, list price 1 / 12 / 24 ~0.2496 ~160 ~9 million

    Three stable conclusions emerge from the table:

    1. The discount makes an order-of-magnitude difference for the high tier. Going from list price to discounted price cuts the cost per call by about 58% and increases the affordable call count by about 2.4x, yet a gap of roughly 2.8x versus the low tier remains.
    2. Tiered cache pricing offers little advantage on the low tier. When the hit rate sits in the 50%–60% range, it is nearly on par with the same-price-for-input-and-output option, and only pulls ahead once the hit rate climbs further.
    3. Output share is a hidden variable. Output is about 9% of the total per call in this example; if a workload produces longer output, the disadvantage of options with a high output price is amplified.

    4. Break-Even Hit Rate: When Does a Cache Price Cut Actually Pay Off

    Take the low tier as the baseline. For the discounted high tier to match it, the following must hold:

    1. 51000 × [h × 0.25 + (1 - h) × 3] / 1e6 + 5100 × 6 / 1e6 ≤ 0.0374

    Solving this gives h of roughly 80%. In other words, the two options cost about the same only when the input cache hit rate approaches 80%; below that threshold the low tier is cheaper, and above it the high tier starts to win.

    The engineering implication of this break-even point is clear: the cache hit rate is not an operations metric but a cost metric. Ways to raise the hit rate include keeping the system prompt order stable, placing the unchanging prefix at the very front, avoiding timestamps or random IDs inserted near the beginning of a long context, and reusing the same session’s context.

    5. High-Quota Plans and the Boundary of Heavy Usage

    Once call volume enters the heavy range, the comparison shifts from unit price to quota size. High-quota plans typically trade a lower marginal unit price for a prepaid commitment, which suits batch processing and always-on agent scenarios with stable, predictable call volume; low-quota options suit the early stage, where usage fluctuates and there is a lot of trial and error.

    The判断 method is simple: first use one week of real call logs to measure the distribution of input and output per call and the hit rate, then plug those into the formula above to compute the monthly total cost under both pay-as-you-go and prepaid-quota modes, and take the lower one. Do not jump between plan tiers based on gut feeling.

    6. An Actionable Optimization Checklist

    • Build a cost dashboard: make hit rate, average input and output length, and cost per call the core monitoring metrics, wired into your logging service and alerting system.
    • Layer your prompts: separate fixed instructions, occasionally changing retrieved snippets, and user input into three layers to maximize prefix reuse.
    • Trim context: summarize and compress long conversations so history does not grow without bound and drag the hit rate down.
    • Route across models: send simple requests to the low tier and complex reasoning to the high tier, splitting traffic with rules or a lightweight classifier.
    • Add budget guardrails: set daily and monthly token quotas with alert thresholds to prevent abnormal calls from inflating the bill.
    • Recompute periodically: discounts and cache prices are external variables, so rerun the same example once a month with the same model instead of making decisions on outdated conclusions.

    7. Conclusion

    Limited-time discounts solve the threshold problem of “can’t afford it,” while permanent cache price cuts solve the structural problem of “can’t sustain it.” For most individual developers and small-to-mid teams, in the realistic 50%–60% hit rate range, a low-tier model combined with good cache reuse habits remains the best value; only when a workload has a stable, highly reusable prefix and a hard requirement on model capability is a discounted high tier worth budgeting for. Mastering the three-part breakdown and the break-even hit rate calculation is more valuable in the long run than memorizing any single promotional price.