Why LLM API Bills Can Differ by 2x at the Same Token Price

    Token prices are not the whole story. This article breaks down the real layers behind an LLM API bill—batch discounts, prompt caching, subscription plans, and off-peak scheduling—and shows a reusable cost model, the optimization order that actually pays off, and the billing details teams usually overlook. You will learn how to turn an unpredictable month-end bill into a predictable curve using a thin gateway and three core metrics.

    1. The Symptom: Identical Unit Prices, Diverging Bills

    Most teams that have integrated an LLM API have seen this: the same workload, the same model tier, run for a month on several different platforms—and the bills diverge noticeably, in extreme cases by nearly 2x. The first reaction is usually “one vendor quietly raised prices” or “one vendor has a hidden discount.” But after lining up the pricing pages row by row, you find that the pay-as-you-go unit prices are almost identical—input, cache hit, and output prices match to the last digit.

    This points to an easily overlooked fact: the unit price is only one input to the bill, not the bill itself. What actually determines monthly spend are the billing rules layered on top of the unit price. This article does not discuss any specific vendor or product. It abstracts these rules into a cost model you can calculate and optimize yourself.

    2. What a Bill Is Really Made Of: A Reusable Estimation Formula

    Breaking the monthly cost apart, it can be written roughly in the following form (illustrative, not any platform’s real API):

    1. # Illustrative cost model; all prices in CNY per 1M tokens
    2. def monthly_cost(usage, price, batch_ratio=0.0, batch_discount=0.6,
    3. cache_hit_ratio=0.0, plan=None):
    4. billable_in = usage["input"] * (1 - cache_hit_ratio)
    5. cache_in = usage["input"] * cache_hit_ratio
    6. on_demand = (billable_in * price["input"]
    7. + cache_in * price["cache_hit"]
    8. + usage["output"] * price["output"])
    9. batch_part = on_demand * batch_ratio * batch_discount
    10. realtime = on_demand * (1 - batch_ratio)
    11. if plan is None:
    12. return realtime + batch_part
    13. # Subscription: deduct the plan quota first; overage falls back to pay-as-you-go
    14. covered = min(realtime, plan["quota"])
    15. overage = (realtime - covered) * price["input"] # overage is usually billed per token
    16. return plan["fee"] + overage + batch_part

    This function has four adjustable knobs: batch ratio, batch discount, cache hit ratio, and whether a subscription is layered on. Four platforms with identical unit prices means the price dict is the same, so the bill differences can only come from the last three knobs. That is the entire source of “same price, different bill.”

    3. Three Rules That Actually Open Up the Gap

    3.1 Batch Processing: Trading Latency for a Discount

    Batch processing is a common capability across the industry: requests are placed in a queue and executed asynchronously, with no promise of a real-time response, in exchange for a discount well below the standard price (typically around half to 60% of standard). It fits tasks that do not need second-level responses: log summarization, offline labeling, bulk translation, data cleaning, and nightly reports.

    Two constraints matter. First, not every model tier offers batch processing; free or lightweight tiers are often excluded. Second, batch processing usually has separate quotas and concurrency limits, so throughput ramp-up needs to be load-tested in advance. A common mistake is switching an entire online path to batch processing, which degrades first-token latency from milliseconds to minutes—unacceptable to the business side.

    3.2 Cache Hits: An Automatic Discount on Repeated Prefixes

    Mainstream inference services automatically enable caching for repeated prefixes, with a default lifetime usually on the order of minutes (commonly 5 minutes). On a hit, that portion is billed only at the cache price, which is generally around one-tenth of the input price. Some model families also bill cache writes separately, tiered by lifetime.

    The impact of this rule on the bill is severely underestimated. Take a customer service or coding assistant built on “long system prompt + fixed knowledge base + short user question”: the prefix often accounts for more than 70% of tokens. As long as the interval between requests falls within the cache lifetime window, input cost can be compressed to roughly a quarter of the original. Conversely, if every request prepends a random timestamp or random request ID to the very front of the prompt, the cache can never hit, and this discount is entirely lost.

    A practical engineering approach is to order the prompt by stability:

    1. [stable] system role + tool definitions + long-term knowledge base
    2. [semi-stable] conversation summary (updated per turn)
    3. [volatile] current user input + timestamp/random string

    Get the order wrong, and even completely repeated content will not hit.

    3.3 Subscriptions and Off-Peak: Moving Load to a Cheaper Timeline

    The logic of a subscription (plan package / token plan) is to pay a fixed fee for a quota; within the quota, nothing is billed per token, and usage beyond it falls back to pay-as-you-go. The math only works when utilization is high enough: let the plan fee be F, the quota be Q, and the pay-as-you-go unit price be P. A subscription is cheaper than pay-as-you-go only when actual usage U satisfies U > (F / P) and sits near or below U ≤ Q. At very low usage, a subscription is a waste; when usage far exceeds the quota, the overage costs the same as pay-as-you-go, so the subscription is just prepayment.

    Off-peak rules are another lever: some platforms offer a discount or extra quota during specific windows (usually late night into the early morning). For tasks that can be delayed, moving the schedule into the off-peak window is equivalent to lowering the unit price without changing the code logic.

    Here is a decision order worth fixing in place:

    1. First measure the cache hit ratio and capture the prefix savings in full;
    2. Then move offline tasks to batch processing;
    3. Then evaluate a subscription, deciding on historical usage rather than estimated usage;
    4. If there is headroom, layer on off-peak scheduling.

    Reversing the order leads to overestimated gains—for example, buying a subscription when the cache hit ratio is only 20%, so the plan quota is quickly eaten up by a large volume of non-cached input.

    4. Four Billing Details That Are Easy to Miss

    • Regional price differences: the same model may cost 5%–10% more in a non-primary region (such as an overseas region). Confirm the regional price table before cross-border calls rather than applying the default region’s price.
    • The time boundary of free quota: a new model launch often comes with a one-time free quota (commonly on the order of millions of tokens). It only affects the first month’s bill and cannot be used to project steady-state cost.
    • Model retirement cycles: lightweight or previous-generation model families usually announce when they will stop accepting new registrations and when they will be taken offline, and the official guidance is generally to migrate to the newer tier. Architecturally, make the model identifier a configuration item to avoid hardcoding.
    • Cache writes and reads are priced separately: writes are tiered by lifetime, while reads are very cheap. High-frequency short-prefix scenarios need to account for write amortization; low-frequency long-prefix scenarios should avoid repeated writes.

    5. Vendor-Neutral Cost Governance

    Since unit prices are converging, competitiveness comes down to metering and scheduling. The recommendation is to build a thin gateway on your own side that consolidates the following capabilities:

    1. # Illustrative: unified gateway routing and metering policy
    2. routing:
    3. default: standard_model # model identifier externalized as config
    4. offline_queue: batch_model # offline traffic goes to batch
    5. fallback: light_model # fallback path
    6. metering:
    7. log_fields: [model, region, prompt_tokens, cached_tokens,
    8. completion_tokens, latency_ms, task_id]
    9. alert: daily_spend_anomaly # day-over-day anomaly alert
    10. cache:
    11. stable_prefix_first: true
    12. ttl_budget_seconds: 300

    With monitoring, alerting, and logging in place, aggregate three core metrics by day: cache hit ratio, batch share, and cost per task (CNY per 1,000 requests). Once these three metrics are visualized, the bill turns from a “month-end surprise” into a predictable curve.

    When implementing on Baidu AI Cloud, you can reuse its general-purpose capabilities such as model services, container platform, message queue, logging, and monitoring/alerting: use the message queue to absorb deferrable tasks so that batch processing and off-peak scheduling form naturally; use object storage to keep prompt and knowledge base versions so prefixes stay stable; use monitoring and alerting to set threshold reminders on daily cost. This architecture is not tied to any single model source—switching providers means changing only the configuration, not the business code.

    6. Conclusion

    Once pay-as-you-go unit prices across platforms are flattened, the gap in the monthly bill is determined entirely by three rules: batch discounts, cache hits, and subscriptions plus off-peak. The optimization order should be to first squeeze out caching and prefix stability, then migrate offline traffic to batch processing and off-peak windows, and only then decide whether to prepay for a subscription based on historical usage; workloads already on a given cloud can usually connect nearby without incurring extra fees. Externalizing the model identifier, region, and routing policy as configuration—and putting the cache hit ratio and cost per task on a daily dashboard—is the reliable path to bringing the bill down by half.