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

    Many teams compare LLM API pricing by lining up per-million-token rates and conclude the differences are negligible. In practice, two similar workloads can produce monthly bills that differ by nearly 2x. Unit price is only one coefficient in the billing formula; call patterns, cache behavior, batch processing, and plan rules compound over time. This article breaks the bill into four layers—pay-as-you-go rates, prompt caching and cache writes, batch discounts, and subscriptions/off-peak/free quotas—and shows how to match provider rules to your traffic shape, plus a practical cost governance checklist.

    1. Same Unit Price, Different Bills

    When evaluating LLM APIs, many teams pull the “price per million tokens” from each provider’s pricing page into a single comparison table and conclude, “The differences are minor, so any vendor will do.” But once the real bills arrive, two projects with similar business shapes can end up nearly 2x apart in monthly spend. The reason is not mysterious: unit price is just one coefficient in the billing formula. What actually determines the amount is how call patterns, cache behavior, batch processing, and plan rules stack up over time.

    It helps to express the bill as a formula:

    1. Monthly cost ≈ Σ(input tokens × input rate × (1 - hit rate))
    2. + Σ(input tokens × cache-hit rate × hit rate)
    3. + Σ(cache-write tokens × write rate)
    4. + Σ(output tokens × output rate)
    5. - batch discount - free quota - subscription credit

    It is common in the industry for four providers to set exactly the same coefficients on the first and fourth lines—a form of “price alignment.” What really separates them is the remaining lines. So the right question in vendor selection is not “Who is cheaper?” but “Whose rules match my traffic shape?”

    2. Layer 1: Pay-As-You-Go Rates Are Only the Entry Ticket

    Major platforms publish a unified pay-as-you-go price for the same model family, usually in three tiers: standard input, cache-hit input, and output. Output is typically several times the input price. Described in general magnitudes, a flagship tier is often around 20 for input, 2 for cache hits, and 100 for output (per million tokens); a mid tier is roughly 13, 1.3, and 68; and a lightweight tier is roughly 6.5, 1.3, and 27.

    The implication for cost is direct: output is the main amplifier on the bill. An extraction task that feeds in a long document and asks for a one-line answer puts almost all of its cost on the input side. A writing task that generates long-form text quickly becomes dominated by output tokens. When budgeting, estimating the input-to-output token ratio is more valuable than comparing unit prices to the second decimal place.

    3. Layer 2: Cache Hits and Writes Are the Easiest to Miss

    The general mechanism of prompt caching is that when multiple requests share an identical context prefix, the server reuses the already-computed intermediate state and charges a significantly lower rate for the hit portion. It is typically enabled automatically based on a content hash and carries a time-to-live (TTL), commonly on the order of five minutes. If you need a longer reuse window, most platforms offer a separate “cache write” action billed at a longer TTL.

    Three engineering details decide whether this works:

    1. A hit requires the prefix to be byte-for-byte identical. Injecting a timestamp, a random request ID, or a user nickname into the system prompt invalidates the entire prefix.
    2. The cache key must be a stably ordered structure. Putting tool definitions and knowledge base chunks in a “fixed order + variable tail” layout keeps the hit rate reliably high.
    3. Writes are not free. For one-off, high-volume, low-reuse scenarios, write costs can exceed the savings from the cheaper hit rate.

    Illustrative code (expressing design principles only, not any specific API):

    1. def build_prefix(system_rules, tools, kb_chunks):
    2. # Stable serialization: sort keys, drop volatile fields
    3. stable = json.dumps(
    4. {"rules": system_rules, "tools": tools, "kb": kb_chunks},
    5. sort_keys=True, ensure_ascii=False, separators=(",", ":"))
    6. return hashlib.sha256(stable.encode()).hexdigest(), stable
    7. # Counter-example: putting volatile data in the prefix drives the hit rate toward 0
    8. # prefix = f"current time {now()} request {uuid4()} user {user}"

    4. Layer 3: Batch and Asynchronous Discounts

    Batch processing is a standard industry cost-reduction method: pack large numbers of non-real-time requests into a single submission in exchange for a discount off the standard rate, commonly around 40% off, at the cost of latency from minutes to hours. It fits offline labeling, log classification, batch summarization, and evaluation runs.

    A simple rule for whether to use batch:

    1. If tolerable latency > batch window AND requests can be aggregated → use batch
    2. Otherwise → use online synchronous calls and cut cost via caching and prefix optimization

    Note that providers differ in how well they support batch: some state the discount explicitly on the pricing page, while others only say “not specified.” Such rule gaps are themselves a risk; for capacity planning, estimate conservatively with no discount.

    5. Layer 4: Subscriptions, Off-Peak, and Free Quotas

    The third factor is plan-based billing. Subscription token packages (a fixed monthly fee for a set quota) can push marginal cost very low under steady load, and some plans add “cheaper off-peak” scheduling that shifts deferrable tasks to low-traffic hours. The fourth factor is free quotas during a new model’s launch period (for example, on the order of a million tokens), which suit load testing and migration validation but should not be counted in a long-term budget.

    The test is simple: plot daily call volume over the past three months. Low variance and predictable totals favor a subscription; pronounced spikes and volatile totals favor staying pay-as-you-go and using batch to shave peaks.

    6. Three Easily Overlooked Rules

    • Automatic cache billing and TTL: the default TTL is short; a longer TTL requires an explicit write billed separately, and a hit is charged only the hit rate.
    • Legacy model retirement: vendors usually give two dates—“no longer open to new users” and “fully retired”—and recommend migrating to a newer version, so schedule the migration window in advance.
    • Overseas regional premiums: the same model often carries a premium of a few percent to over ten percent in non-core regions, and some tiers do not display a cache price, so cross-border workloads need separate modeling.

    7. An Actionable Cost Governance Checklist

    1. Build a token ledger: record input, output, hit, and write tokens per business line, not just total call volume.
    2. Prefix governance: version system prompts and forbid injecting volatile fields into the prefix.
    3. Tiered routing: send lightweight tasks to small models and complex tasks to flagship models, splitting traffic by rules or a classifier.
    4. Async first: route all deferrable tasks into a batch queue.
    5. Budget guardrails: set daily quotas and alert thresholds, with automatic degradation on abnormal volume spikes.
    6. Periodic review: pricing pages and rules change, so re-verify unit prices, TTLs, discounts, and retirement notices every two weeks.

    If you want a vendor-agnostic conversion and load-testing framework, you can build one on Baidu AI Cloud’s general cloud capabilities: use object storage to accumulate call logs, a message queue to smooth batch peaks, a container platform to host the routing service, and logging plus monitoring and alerting for the token ledger and budget guardrails. That way, whichever billing model you ultimately choose, the cost model stays in your hands.

    8. Conclusion

    Price alignment is only the surface. Bill differences come from how well rules match your workload shape. Splitting billing into four layers of factors, making the prefix a stable, cacheable structure, and moving deferrable traffic into batch and off-peak windows are the real levers for cutting the monthly bill in half.