Why LLM API Bills Can Differ by 50% at the Same Token Price

    Many teams compare LLM API platforms by looking at a single number: the price per million tokens. Real bills, however, are not a linear function of that price. They are the combined result of several billing dimensions. Once list per-token prices are aligned across cloud platforms, the cost gap does not disappear; it moves into billing rules, discount mechanisms, and scheduling strategy. This article breaks the bill down into its main components—batch discounts, prefix caching, subscriptions with off-peak scheduling, free quotas, and migration costs—and shows how to estimate each one with a script so you can optimize usage structure before comparing prices.

    1. The Problem: Same Unit Price, Different Bills

    When evaluating LLM API costs, many teams focus on a single number: the price per million tokens. But a real bill is never a linear scaling of that price. It is the result of several billing dimensions stacked together. When the list per-token prices across multiple cloud platforms are pulled to the same level, the cost difference does not vanish. It shifts to billing rules, discount mechanisms, and scheduling strategy.

    Broken down, a bill can be abstracted into a general formula:

    1. Monthly bill = Σ(input tokens × input price + output tokens × output price)
    2. - cache hit discount
    3. - batch discount
    4. - free quota deduction
    5. + cache write surcharge
    6. + overage / peak-time premium

    As long as any one of these terms is non-zero, the bills from two platforms will diverge. So the first step in platform selection is not comparing prices, but confirming which of these terms your usage structure actually falls into.

    2. Layer 1: Converging List Prices Make Price Comparison Meaningless

    A common pattern has emerged in the industry: the same third-party model has exactly the same pay-as-you-go price on different cloud platforms, including all three tiers—input price, cache hit price, and output price. This means the question “which one is cheaper” has no answer at the pay-as-you-go level.

    Note that pricing pages have information gaps. Some platforms mark the cache hit price as “not listed on the page.” Such a blank does not mean free; it needs to be verified by sending fixed-prefix requests in a test environment. In addition, overseas regions usually carry a clear premium, with input and output prices potentially rising by about 10%, so the region parameter must be checked before cross-border calls.

    Conclusion: the pay-as-you-go unit price only determines the cost baseline, not the cost difference.

    3. Layer 2: Batch Discounts, the Biggest Lever for Offline Workloads

    Most platforms offer a discount off the standard price for asynchronous batch APIs (commonly around 40% off), at the cost of response time degrading from seconds to minutes or even hours. This defines its applicability:

    • Suitable: log summarization, offline labeling, batch translation, data cleaning, regression evaluation set generation.
    • Not suitable: online chat, code completion, real-time risk control, or any pipeline with interactive latency requirements.

    The key engineering action is workload tiering. It is recommended to tag requests at the gateway layer, route deferrable workloads into a batch queue, and keep interactive workloads on the real-time channel:

    1. def route(req):
    2. if req.deadline_s > 3600 and req.is_idempotent:
    3. return batch_queue.submit(req) # discounted channel
    4. return realtime_client.call(req) # standard channel

    An often-overlooked detail: batch discounts usually apply per model family. If your business is bound to a specific version, confirm whether that version is covered by the discount.

    4. Layer 3: Prefix Caching, Turning Repeated Context into a Discount

    The general mechanism of prefix caching is to automatically reuse the computed result for a repeated request prefix. The hit portion is billed at the hit price (typically one tenth of the input price), the miss portion is billed at the standard price, and cache writes may be billed separately with different TTLs. The default TTL is usually on the order of minutes.

    This means the cost depends on how prompts are organized. Putting stable content first and variable content last significantly raises the hit rate:

    1. [system instructions + tool definitions + long document] ← stable prefix, cacheable
    2. [user's question this turn] ← variable suffix, not cached

    The counter-example is putting timestamps or random IDs at the beginning of the prompt, which invalidates the entire prefix every time, while cache write fees keep piling up. For long-document Q&A workloads, cache optimization often brings more benefit than switching models.

    5. Layer 4: Subscriptions and Off-Peak Scheduling, Structural Optimization for Real-Time Calls

    When the business must be bound to a specific model version and is dominated by real-time calls, a subscription (prepaid per cycle, granting a certain quota, with overage settled pay-as-you-go) may be better than pure pay-as-you-go. Its benefit comes from two points: first, the prepaid quota unit price is lower than the pay-as-you-go price; second, the overage portion is still billed pay-as-you-go, so the cost has a ceiling.

    Stacking off-peak rules amplifies the benefit further. If nearly half of the calls can be scheduled into the nighttime low-peak window, overall spending can drop by more than 40%. The implementation key is to add a retryable queue on the client side:

    1. if now.hour < 8 and req.retryable:
    2. defer_queue.put(req, run_at="08:00") # shift to the off-peak window
    3. else:
    4. return client.call(req)

    The prerequisite is that the business allows delay and retries, and you need to set a queue limit and a degradation strategy to avoid pileups during peak hours.

    6. Layer 5: Free Quotas, Version Retirement, and Migration Costs

    Three points are easy to miss:

    1. New models often come with a free trial quota (e.g., on the order of a million tokens), effective only for specific models or new users. It is a one-time deduction and should not be counted in a long-term cost model.
    2. Older model versions are gradually closed to new users and eventually retired, and the official guidance is usually to migrate to the new version. Prompt regression testing, quality evaluation, and gradual rollout during migration are all hidden labor costs.
    3. For a workload already running on a cloud, connecting to the model service on the same platform nearby avoids cross-cloud network and data transfer overhead, at the same cost as the original vendor.

    7. Decision Checklist

    • Not locked to a model version: pay-as-you-go is fine; platforms are the same price, so choose the one with the most convenient network and compliance.
    • Offline-first: prioritize the batch discount channel.
    • Long-context repeated calls: do the prefix caching refactor first, then talk about selection.
    • Version-locked real-time business: evaluate subscription + pay-as-you-go overage, combined with off-peak scheduling.
    • Workload already on a cloud: connect nearby to avoid cross-cloud costs.

    8. Build Your Own Estimation Script

    1. def monthly_bill(inp, out, hit_ratio=0.0, batch_ratio=0.0,
    2. batch_discount=0.6, sub_quota=0, sub_price=0,
    3. offpeak_ratio=0.0, offpeak_discount=0.5):
    4. realtime = 1 - batch_ratio
    5. billable_inp = inp * realtime
    6. hit = billable_inp * hit_ratio
    7. miss = billable_inp - hit
    8. cost = miss * 20 + hit * 2 + out * 100
    9. cost += inp * batch_ratio * 20 * batch_discount
    10. cost += out * batch_ratio * 100 * batch_discount
    11. cost = cost * (1 - offpeak_ratio * offpeak_discount)
    12. return max(cost - sub_quota, 0) + sub_quota * sub_price

    Plug in your real input/output ratio, cache hit rate, and deferrable workload share, and you can quantify the benefit of each strategy instead of choosing a platform by gut feeling. The correct order for cost optimization is: first change the usage structure, then change the billing channel, and only then compare unit prices.