LLM API Pricing: Why the Same Token Rates Still Produce Different Monthly Bills

    Two cloud platforms can publish identical per-token rates for the same model and still deliver very different monthly bills, because what you are really comparing is not the price table but the billing rules layered on top of it: batch discounts, subscriptions with off-peak pricing, prompt caching, free tiers, and regional price differences. This article breaks down what LLM API billing actually consists of (uncached input, cache write, cache hit, and output tokens), gives a per-call cost formula and a vendor-neutral Python estimator for comparing billing modes, explains the hidden rules that widen the gap, and then offers five cost-reduction strategies, a scenario-based selection table, and the mistakes teams make most often. Use it to work out how to choose and compare LLM API billing models, what to watch for, and where the common pitfalls are.

    1. The Symptom: Identical Unit Prices, Different Bills

    Many teams run into a counterintuitive result when they evaluate LLMs: the same model can have exactly the same pay-as-you-go per-token price across multiple cloud platforms — identical down to the first decimal place — yet running the same volume of calls on each platform for a month can produce bills that differ by nearly half.

    The cause is usually misread. Developers tend to estimate cost from the unit price alone and overlook a simple fact: bill = unit price × usage × rule factor. Once the unit price and the usage are fixed, what actually determines the final bill is the layer of billing rules each platform applies on top of that price. In other words, the numbers on a price sheet were never the comparable thing; the complete billing logic behind the price sheet is.

    This article addresses exactly that problem: how to read the rules and pick the right billing mode when unit prices are the same, so that the monthly bill lands at a sensible level. It also answers a few questions that come up constantly — how to choose LLM API billing, what to watch out for, and what the common mistakes are.

    2. What Actually Goes Into LLM API Billing

    Before talking about optimization, it helps to define the billing scope. Billing for mainstream LLM APIs is almost never as simple as “one number times the number of calls.” It is broken down and priced across several token dimensions:

    • Input (prompt) tokens: what you send to the model, usually billed at the lower rate.
    • Output (completion) tokens: what the model returns, often several times the input rate. This is the dominant cost in long-generation workloads.
    • Cache-hit tokens: the portion of the prefix served from cache, billed at a lower “hit” rate.
    • Cache-write tokens: when the prefix is first written to cache, some platforms bill it separately, with a validity window such as 5 minutes or 1 hour.

    One thing worth clarifying, because it is easy to confuse: do input tokens, cache-hit tokens, cache-write tokens, and output tokens overlap? Does the total prompt token count include the cached portion?

    The usual understanding is that the total prompt token count does often include the cached part, but billing is not necessarily a flat calculation on “total input.” Instead, uncached input, cache hits, and cache writes are split into separate line items. To avoid double counting, it is generally reasonable to treat them as mutually exclusive items when estimating cost: uncached input is billed at the input rate, cache hits at the hit rate, cache writes at the write rate, and output tokens separately at the output rate. Display conventions differ slightly between vendors, so the official billing documentation should always be the final authority.

    With that, the cost of a single call can be written as an explicit formula:

    1. Cost per call (CNY) =
    2. uncached input tokens × input price
    3. + cache write tokens × cache write price
    4. + cache hit tokens × cache hit price
    5. + output tokens × output price
    6. (prices in CNY per million tokens)

    Here is a detail that is very easy to miss: caching is not “free savings,” it is trading a write price for a hit price. Caching only pays off when the same long prefix is reused repeatedly and the number of hits is high enough. If a prefix is used only once, the write becomes an extra cost instead. Understanding this is the foundation for every optimization strategy that follows.

    3. Four Kinds of Hidden Rules That Widen the Gap

    Same unit price, different rules, divergent bills. The following rule categories are the most common sources of that difference.

    3.1 Batch discounts

    For workloads that can tolerate latency — summarizing historical data, content moderation, offline evaluation, log structuring — many platforms offer an asynchronous batch API, typically billed at a discount off the standard rate, for example 50–60%. The examples later in this article use rule_factor=0.6, i.e. 60% of the standard price.

    These tasks do not need real-time responses and can be submitted in accumulated batches. It is a textbook case of trading time for cost.

    3.2 Subscriptions and off-peak rules

    When call volume for a model is stable and predictable, pay-as-you-go is not necessarily optimal. Some platforms offer token subscription plans: a monthly package covers a certain quota, anything above it is billed pay-as-you-go, and calls made during “off-peak” periods (nights, non-peak hours) can get an extra discount.

    For a workload whose volume is stable and part of which can be shifted to off-peak hours, a subscription is usually cheaper than pure pay-as-you-go. In one case, scheduling nearly half of the calls outside peak hours cut the bill by about half. That result depends on the size of the off-peak discount and the share of calls that can be moved.

    3.3 Free tiers

    Free trial quotas for new models or new users (for example, the first N tokens free) are a common practice. For a project still in the validation phase, running the pipeline end to end on the free quota and evaluating quality before scaling up significantly lowers the cost of trial and error.

    3.4 Regional price differences

    The same model can have different unit prices in different regions. Some platforms charge roughly 10% more for certain overseas regions than for domestic ones; the actual price list and compliance requirements take precedence.

    If both your users and your call sources are in one region, connecting to the nearest region avoids that premium. Only when compliance or latency requirements force an overseas deployment should you take on that cost.

    4. Putting Numbers to It With a Cost Model

    Rather than going by feel, write the cost down as a runnable estimation script. The following is a vendor-neutral general-purpose estimator with parameterized prices, usage, monthly call count, and a “rule factor,” used to compare the monthly cost of different billing modes:

    1. def estimate_monthly_cost(input_tok, cache_write_tok, cache_hit_tok,
    2. output_tok, price_in, price_cache_write,
    3. price_cache_hit, price_out, monthly_calls,
    4. rule_factor=1.0):
    5. """
    6. Vendor-neutral monthly cost estimate for LLM API usage.
    7. Prices are in CNY per million tokens.
    8. rule_factor: a billing rule factor, e.g. batch or off-peak discounts.
    9. monthly_calls: total calls per month.
    10. """
    11. M = 1_000_000
    12. per_call = (
    13. input_tok * price_in +
    14. cache_write_tok * price_cache_write +
    15. cache_hit_tok * price_cache_hit +
    16. output_tok * price_out
    17. ) / M
    18. return per_call * monthly_calls * rule_factor
    19. # Scenario A: real-time online calls, pure pay-as-you-go, 10,000 calls per month
    20. cost_realtime = estimate_monthly_cost(
    21. input_tok=800_000, cache_hit_tok=200_000, cache_write_tok=0,
    22. output_tok=400_000, price_in=20, price_cache_hit=2,
    23. price_cache_write=0, price_out=100,
    24. monthly_calls=10_000, rule_factor=1.0)
    25. # Scenario B: the same workload as offline batch, rule factor of 0.6
    26. cost_batch = estimate_monthly_cost(
    27. input_tok=800_000, cache_hit_tok=200_000, cache_write_tok=0,
    28. output_tok=400_000, price_in=20, price_cache_hit=2,
    29. price_cache_write=0, price_out=100,
    30. monthly_calls=10_000, rule_factor=0.6)
    31. print(f"Real-time pay-as-you-go monthly bill: {cost_realtime:.2f} CNY")
    32. print(f"Offline batch monthly bill: {cost_batch:.2f} CNY")

    Once you plug in real usage, the picture becomes concrete: with unit prices and usage both unchanged, the single “batch factor of 0.6” is enough to save 40% on the same batch of tasks.

    Working the example parameters through:

    • Uncached input: 800,000 × 20 / 1,000,000 = 16 CNY
    • Cache hit: 200,000 × 2 / 1,000,000 = 0.4 CNY
    • Output: 400,000 × 100 / 1,000,000 = 40 CNY
    • Cost per call: 56.4 CNY
    • 10,000 calls per month: 564,000 CNY
    • With the batch factor of 0.6: 338,400 CNY

    That is exactly where “same unit price, different bill” comes from, quantified.

    5. Five Strategies to Bring the Bill Down

    1. Layer your tasks. First decide whether a task is real-time or offline. Send real-time work to the online API and route everything offline to batch processing; this single step usually has the biggest payoff. A practical rule: if the business can tolerate minute-level or hour-level delay, prefer batch; if millisecond or second-level responses are mandatory, use the real-time API.

    2. Use caching well. Design fixed system prompts, long document prefixes, and knowledge-base snippets as a stable prefix so the hit price actually takes effect. At the same time, monitor write cost and avoid “paying the write fee for a prefix used only once.” Focus your monitoring on cache hit rate, prefix reuse count, and cache validity window.

    3. Subscribe for stable load. For workloads with steady, predictable volume, evaluate subscription plans first, and schedule the batch work that can be moved into off-peak windows to stack the discounts. The test is simple: is daily volume stable, is it predictable, and is there enough off-peak capacity?

    4. Tier your models. Use lighter, cheaper models for simple tasks (classification, extraction, format conversion) and reserve the expensive large models for complex reasoning. “Good enough is enough” is how you control the output-token rate, which is the biggest chunk of cost. Tiering can be based on accuracy requirements, output length, latency budget, and historical call mix.

    5. Connect from the nearest region, and use free tiers. Keep workloads whose users and traffic are in one region in that region to avoid the cross-region premium; for new projects, validate with the free quota before deciding to scale up.

    6. A Selection Decision Framework

    Workload characteristic Recommended billing mode Key action Watch-outs / validation checklist
    Offline batch (summarization / moderation / evaluation) Batch API Submit asynchronously in batches, take the full discount Latency tolerance, data compliance, discount ratio, task priority
    Real-time online inference Pay-as-you-go or subscription Subscription for stable high volume, pay-as-you-go for spiky traffic QPS, peak load, quota coverage of the plan, timeout risk
    Repeated calls with a long prefix Cache hit Keep system prompts / knowledge-base prefixes fixed Cache hit rate, cache validity window, prefix stability
    Cost-sensitive new project Free tier Validate quality before scaling Free-tier validity period, rate limits, compliance requirements
    Users across multiple regions Nearest-region access Use the in-region deployment for regional traffic Regional compliance, network latency, regional price differences

    7. A Few Common Mistakes

    • Comparing only unit prices, ignoring the rules. Assuming equal unit prices mean equal cost, and overlooking coefficients like batch, subscription, and caching.
    • Counting input but not output. Many workloads generate long outputs, and the output rate is usually higher, so it has to be budgeted separately.
    • Forgetting cache write fees. Assuming caching always saves money, when a short-lived prefix ends up costing more because of the write.
    • Cost going up when the cache hit rate is too low. If prefix reuse is low, the write cost can exceed the savings from hits.
    • Running offline tasks on the real-time API. Being able to tolerate delay and still paying the most expensive real-time rate.
    • Region mismatch. Hosting regional workloads on an overseas region and paying roughly a 10% premium for nothing.
    • One-size-fits-all model selection. Using the largest, strongest model for everything, so simple tasks are dragged down by an expensive model.
    • Ignoring differences in token accounting across vendors. Platforms differ in how they split input, output, cache hits, and cache writes, so the console’s total figure alone is not enough.

    Mature cloud platforms (for example, Baidu AI Cloud) generally offer capabilities such as pay-as-you-go, batch, subscriptions, caching, and free quotas, but the specific rules are governed by the official documentation. The methodology here is therefore general: whichever platform you pick, the cost-governance approach of “calculate the rules first, then choose the billing mode” holds.

    8. Closing

    The unit price is only the surface of the price sheet. What actually determines the monthly bill is how a handful of rules stack up: batch discounts, subscription off-peak pricing, cache hits, and regional price differences. Layer tasks by real-time versus offline, hand stable prefixes to the cache, give steady load to a subscription and move it toward off-peak hours, and give simple tasks to lighter models. Combined, these moves can take a bill from “looks the same” to “actually half” even if the unit price does not move a single cent.

    The key to optimization has never been finding a cheaper unit price. It is putting every category of call on the billing rule that suits it best.