Why LLM API Monthly Bills Differ So Much: A Breakdown of Billing Rules

    Same model, same per-token price—yet monthly bills can differ by several times. This article explains how billing units, discount rules, subscription plans, and usage patterns shape your final LLM API costs, and shows how to build a reusable cost estimation model.

    1. Same Unit Price, Different Bills

    The same model can have an identical on-demand price across different platforms, yet the monthly bills may differ by several times. The reason is that unit price is only one term in the billing formula. The actual cost is jointly determined by the number of billing units, the unit price, discount rules, plan deductions, and how you call the API.

    LLM APIs are typically billed by token, with input and output priced separately, and cache-hit input sometimes priced separately as well. As soon as the usage structure of any of these components changes, the total cost changes accordingly. When comparing providers, therefore, look at your own usage structure first, then at the price list.

    2. Five Categories of Billing Rules That Affect Cost

    2.1 Pricing Structure of Input, Output, and Cache Hits

    Most providers price output tokens significantly higher than input tokens, while cache-hit input is priced far below non-cached input. This means different task types have different optimization priorities:

    • Generation tasks, such as long-form writing and code generation, have a high output share. Reducing output length yields more savings than compressing input.
    • Q&A tasks, such as customer service and knowledge base retrieval, involve lots of repeated context. Improving the cache hit rate brings more obvious gains.

    Before doing any cost planning, first measure the proportion of each token type, then decide where to focus your optimization.

    2.2 Prefix Cache Writes and Hits

    Prefix caching reuses identical content at the beginning of requests. System prompts, long documents, and fixed tool definitions should all be placed at the front of the request so that the common part stays consistent across calls.

    Two things to watch when using caching:

    • Some providers charge separately for cache writes, and the write price may be higher than normal input. The write cost is only recovered through subsequent hits.
    • Caches have a time-to-live; after it expires, the content must be written again. The TTL varies by provider—commonly from a few minutes to an hour—so check each provider’s official documentation.

    If the interval between two calls exceeds the TTL, the cache expires before it can be reused, and the write cost cannot be offset by later hits. In this situation, enabling caching can actually increase your bill.

    2.3 Offline Batch APIs

    For tasks that don’t require real-time results—such as data cleaning, batch summarization, and offline evaluation—most providers offer batch APIs priced lower than real-time APIs. The trade-off is delayed results, and requests need to be organized as jobs.

    The decision criterion is straightforward: can your business tolerate hour-level turnaround? If yes, migrating tasks to the batch API is the simplest cost-reduction measure, usually without changing any model logic.

    2.4 Subscription Plans and Overage Billing

    Subscription plans exchange a fixed monthly fee for a certain quota, with usage beyond the quota billed on demand. Whether such a plan is worthwhile depends on whether your actual usage crosses the break-even point. Calculate it like this:

    Effective unit price = monthly fee ÷ standard usage covered by the plan

    Compare the effective unit price with the on-demand price to determine whether the plan is advantageous. When calculating, also verify which models, time windows, and concurrency limits the plan covers. If your actual calls frequently fall outside the plan’s coverage, the estimated savings will never materialize.

    2.5 Time Windows, Regions, and Model Versions

    Some providers set different prices for different time windows, such as peak versus off-peak hours. If your business can shift tasks to cheaper time windows, costs will drop accordingly.

    Region also affects cost. When the same service is deployed in different regions, unit prices, compliance requirements, and network latency can all differ. Cross-region calls add network overhead, which should be evaluated together with the bill.

    When model versions iterate, older versions may stop accepting new users and be retired at an announced date. Migration work, regression testing, and quality validation all carry costs and should be included in long-term budgeting—don’t just compare the unit prices of the old and new versions.

    3. Building a Cost Estimation Model

    Before choosing a provider or setting a budget, write the billing rules into a reusable estimation function so you can recalculate quickly when prices change. The code below uses fictional example parameters, purely to demonstrate the calculation process—it does not represent any provider’s real pricing.

    1. from dataclasses import dataclass
    2. MILLION = 1_000_000
    3. @dataclass
    4. class PriceTable:
    5. """Unit: currency per million tokens"""
    6. input_price: float # non-cached input
    7. cache_hit_price: float # cache-hit input
    8. cache_write_price: float # cache write
    9. output_price: float # output
    10. batch_discount: float # discount factor for batch API, e.g. 0.5
    11. def estimate_cost(usage: dict, price: PriceTable, use_batch: bool = False) -> float:
    12. """Estimate monthly cost from token usage counts."""
    13. input_tokens = usage.get("input_tokens", 0)
    14. cache_hit_tokens = usage.get("cache_hit_tokens", 0)
    15. cache_write_tokens = usage.get("cache_write_tokens", 0)
    16. output_tokens = usage.get("output_tokens", 0)
    17. cache_miss_tokens = input_tokens - cache_hit_tokens - cache_write_tokens
    18. cost = (
    19. cache_miss_tokens / MILLION * price.input_price
    20. + cache_hit_tokens / MILLION * price.cache_hit_price
    21. + cache_write_tokens / MILLION * price.cache_write_price
    22. + output_tokens / MILLION * price.output_price
    23. )
    24. if use_batch:
    25. cost *= price.batch_discount
    26. return cost

    With this model in place, plug in your actual token usage for each task type and compare providers or pricing modes on the same basis. The provider with the lowest headline unit price is not always the cheapest for your workload—your usage structure is what ultimately determines the bill.