LLM API Billing Comparison: Why Identical Pay-As-You-Go Rates Can Produce Very Different Bills

    This article explains why per-million-token pricing is not a sufficient cost metric for LLM APIs. It presents a reusable billing framework that covers input, cache hit, cache write, output, batch discounts, subscription plans, off-peak scheduling, free quotas, and model lifecycle, and it provides a calculation model and scenario-based decision checklist for comparing platforms without locking into a single channel.

    In multi-cloud access and model service selection, a common mistake is to treat the “price per million tokens” as the only cost metric. Actual bills are usually determined by a set of rules: input, cache hit, cache write, and output are priced separately; offline tasks may receive batch discounts; subscription plans may cover some models and usage; off-peak scheduling may significantly reduce unit prices; and free quotas, model lifecycle, and overage billing can also change the final amount. As a result, even when multiple access channels show exactly the same pay-as-you-go unit price, monthly bills can still differ by dozens of percentage points. This article does not recommend any specific platform. Instead, it provides a reusable general accounting framework to help teams move from “unit price comparison” to “rule comparison.”

    1. Unify the Billing Basis First: A Bill Has More Than One Price

    Pay-as-you-go fees for LLM APIs can usually be broken down into four token categories: input without cache hit, cache hit, cache write, and output. Many teams focus only on input and output prices while ignoring cache write costs and hit rates, which leads to estimation errors. Caching usually applies automatically to repeated prefixes and has a default TTL; write prices may differ by TTL, and once a cache hit occurs, only the hit price is charged. Therefore, stable system prompts, fixed tool descriptions, and long document prefixes are suitable for cache prefixes, but teams need to evaluate whether the “write cost” can be amortized by enough hits within the effective period.

    The example prices below are for illustrating the billing structure only and do not represent commitments from any real platform:

    Model Example Input Price Cache Hit Price Output Price Rules That Can Create Bill Differences
    Model A 20 2 100 Batch processing at a fixed percentage of standard price
    Model B 13 1.3 68 Subscription plan covers selected models
    Model C 6.5 1.3 27 Free quota for new models; retirement of old models

    The pay-as-you-go unit prices across the compared channels can be exactly the same, but bill differences come from rules: some channels offer batch discounts, some offer subscription plans and off-peak rules, some offer only free quotas for new models, and some pages do not state batch rules. A page that does not state a rule does not mean the rule does not exist, but budgets cannot be built on assumptions. Teams should confirm through contracts, support tickets, or test bills.

    2. Difference Source 1: Batch Discounts Suit Offline Tasks

    The core of batch processing is to submit delay-tolerant requests together in exchange for a fixed discount on the standard price. In the example, the batch coefficient is 60%, meaning 60% of the standard price. It suits tasks such as log cleaning, batch summarization, evaluation set generation, pre-running data annotation, and offline report generation. It does not suit latency-sensitive paths such as real-time customer service, online completion, or risk-control blocking. From an engineering perspective, batch tasks should be placed in asynchronous queues, decoupled using object storage or message queues, with idempotency keys and failure retries, and scheduled against a “deadline” rather than “immediate return.”

    If 60% of a team’s monthly token consumption comes from offline tasks and those tasks can enter batch processing, overall costs will be significantly reduced. Conversely, if real-time paths are forced into batch processing, timeouts and retries will offset the discount benefits.

    3. Difference Source 2: Subscription Plans and Off-Peak Rules

    Subscription plans usually cover specified models or a specified quota, with overage billed on a pay-as-you-go basis. Their advantage is locking in stable and predictable usage in advance to lower the unit price; the risks are mismatched model coverage, overage prices higher than pay-as-you-go prices, or subscription quotas expiring at the end of the month. Off-peak rules require calls to be scheduled outside peak hours and suit delay-tolerant tasks. In the example, if an older model can be locked in and a subscription plus overage pay-as-you-go can be used, the cost can be 12%–24% lower than pure pay-as-you-go; if half of the calls can be scheduled into off-peak windows, the cost can approach half. The key to this conclusion is not a particular platform, but the “delay-tolerant ratio” and “off-peak coverage rate.”

    Teams should first measure the delay-tolerant ratio of tasks, deadline distribution, and failure retry rate before deciding whether to adopt subscriptions or off-peak scheduling. For online requests that cannot be delayed, do not sacrifice user experience for off-peak discounts.

    4. Difference Source 3: Cache Writes, Free Quotas, and Model Migration

    Cache optimization requires looking at the total account: cache writes have a cost, and only hits generate benefits. If the prefix is stable over time and request volume is high, the benefits of a higher cache hit rate are usually significant; if the prefix changes frequently or requests are sparse, the write cost may not be amortized. It is advisable to monitor cache hit rate, cache write volume, average TTL, and the hit-benefit ratio.

    Free quotas are suitable for trial runs of new projects and first-month cost buffering, but they should not be included in long-term budgets. Model migration also affects bills: older model series may gradually stop being available to new users and eventually be retired, and the provider will usually recommend migrating to a newer version. Locking into older models brings migration costs, evaluation costs, and rollback risks. A more robust approach is to keep a model abstraction layer and make model names, price lists, batch coefficients, and subscription rules configurable, avoiding hard-coding in business code.

    5. Unified Billing Calculation Model

    A simplified formula can describe a monthly bill:

    Total cost = Σ(input miss tokens × input price + cache hit tokens × cache hit price + cache write tokens × cache write price + output tokens × output price) × rule coefficient − subscription credit + overage pay-as-you-go

    The rule coefficients include the batch coefficient and the off-peak coefficient; subscription credits must be limited to the covered quota. Example code:

    1. def monthly_bill(usage, price, rules):
    2. realtime = usage.in_tokens / 1e6 * price.in_price
    3. realtime += usage.cache_hit / 1e6 * price.cache_price
    4. realtime += usage.cache_write / 1e6 * price.cache_write
    5. realtime += usage.out_tokens / 1e6 * price.out_price
    6. batch = usage.batch_tokens / 1e6 * price.in_price * rules.batch_ratio
    7. idle = usage.idle_tokens / 1e6 * price.in_price * rules.idle_ratio
    8. subtotal = realtime + batch + idle
    9. subtotal -= min(subtotal, rules.free_credit)
    10. covered = min(usage.covered_tokens / 1e6 * price.in_price, rules.subscription_credit)
    11. return subtotal - covered

    In actual accounting, input, output, and cache should be tracked in separate tables and aggregated by model version and channel dimension, rather than estimated using an average unit price.

    6. Scenario-Based Decision Checklist

    1. Real-time online, non-delay-tolerant: prioritize stability, cache hit behavior, and rate-limiting policies across channels with the same pay-as-you-go price; do not migrate blindly for unit price alone.
    2. High share of offline batch processing: prioritize evaluating batch discounts and calculate the batch-capable ratio and retry costs.
    3. Can be scheduled off-peak and subscription coverage matches: compare “subscription + overage” with pure pay-as-you-go, focusing on overage prices and covered models.
    4. Locked into older models: compare migration costs with subscription benefits; if the older model is nearing retirement, evaluate newer models as early as possible.
    5. Existing cloud workloads: nearby access can reduce network and operations costs; if the cost is the same as the original provider, there is no need to migrate solely for unit price.
    6. New projects: first use pay-as-you-go and free quotas for new models to establish a usage baseline, then decide whether to sign a subscription.

    7. Engineering Implementation and Monitoring

    It is advisable to establish a unified price configuration and budget alerts, and monitor input/output tokens, cache hit rate, cache write volume, batch share, off-peak share, subscription coverage rate, overage rate, cost per request, and model version distribution. Review high-cost interfaces weekly and layer tasks by SLA: keep real-time paths stable, keep offline paths discounted, and keep delay-tolerant paths in off-peak windows. Through an abstraction layer for access and a configurable price list, retain the ability to switch channels at any time.

    The conclusion is that identical pay-as-you-go unit prices do not mean identical monthly bills. The real cost differences come from batch processing, subscriptions, off-peak scheduling, caching, free quotas, and model lifecycle. Only by layering usage by task SLA, calculating with a unified formula, and validating through a monitoring loop can teams keep bills within a reasonable range without locking into a single channel.