LLM API Pricing Breakdown: Why the Same Unit Price Can Double Your Bill

    LLM API costs are often compared by a single number—price per million tokens—yet two teams running the same model at the same volume can end up with very different monthly bills. This article explains how token mix, cache-hit rate, batch channels, subscription plans, regional pricing, and model version changes combine to determine the real cost. It covers how token-based billing works, when to choose pay-as-you-go versus batch, subscription, or caching, and includes a worked example plus Python code for estimating and routing costs. Readers will get a practical framework for evaluating platforms and controlling spend beyond the headline unit price.

    Why the same unit price can produce a very different bill

    When teams evaluate LLM APIs, they often look at a single metric: cost per million tokens. Put a few platforms’ price tables side by side, and the input, cache-hit, and output prices for the same model can look identical, so the team picks whichever provider is easiest to integrate.

    But when the month-end reconciliation arrives, the same call volume on the same model can produce a noticeably different bill. The reason isn’t mysterious: the per-unit price is just one dimension of cost. What actually drives the bill is the combined effect of token mix, cache-hit rate, batch channels, subscription plans, regional differences, and model version changes. At low volume these differences barely show; as volume grows, they get amplified.

    What do LLM APIs actually bill for?

    Most mainstream LLM APIs bill by tokens rather than a simple per-request charge. A single request usually involves at least three token categories:

    • Input tokens: system prompts, conversation history, knowledge-base snippets, user questions, and so on;
    • Output tokens: the content the model actually generates;
    • Cache-hit tokens: when part of the input shares a prefix with a previous request and hits the cache, that portion is usually billed at a lower rate.

    Generally, output tokens are the most expensive, input tokens come next, and cache-hit tokens are the cheapest. If long prefixes such as system prompts, knowledge-base snippets, and few-shot examples are carried repeatedly, the cache-hit rate can significantly affect the bill. In other words, the price table may look the same, but what actually varies is the proportion of each token type across different business scenarios.

    Pay-as-you-go, batch, subscription, or cache?

    Different billing methods aren’t simply “which one is cheaper”—they fit different traffic patterns.

    Billing method Best suited for Poor fit / use with caution Cost note
    Pay-as-you-go Volatile traffic, low total volume, temporary testing, unpredictable call volume Highly stable, very large volume—may cost more than a plan Flexible, but not always optimal for sustained high-volume usage
    Batch / offline Data cleaning, batch summarization, offline evaluation, log labeling, and other delay-tolerant tasks Real-time workloads that need second-level responses and low queue latency Usually discounted, but account for queuing and quotas
    Subscription / plan High-frequency, real-time, predictable workloads that can fill the plan’s quota Volatile usage, or a plan that doesn’t cover the model you need Effective unit cost drops below pure pay-as-you-go when quota is fully used
    Cache hits Highly reused long prefixes: system prompts, knowledge bases, fixed examples Prefixes that change frequently or differ greatly per request The hit portion is cheaper, but there may be a write fee

    Pay-as-you-go: the default path, but not always the cheapest

    Pay-as-you-go post-paid billing is the most common model—you pay for what you use, and its main advantage is flexibility. It suits teams with volatile traffic, low total volume, or early-stage business validation.

    But if calls are highly stable, large in scale, and predictable, pure pay-as-you-go may not be the most cost-efficient option. In particular, note that if monthly usage fluctuates a lot, or the plan doesn’t support the model you’re currently using, buying a plan can actually cost more. When choosing, don’t look only at the unit price—also check whether your call volume is stable enough and whether you meet the conditions for a matching plan.

    Batch / offline billing: the discount channel for offline tasks

    Many platforms offer a batch processing channel for “non-real-time” tasks. Requests can be submitted in batches and processed asynchronously using spare capacity, usually at a discount.

    This channel suits offline evaluation, batch labeling, nightly archiving, data cleaning, batch summarization, and similar tasks. But batch doesn’t mean unlimited, and it doesn’t mean there’s no latency requirement. Different platforms’ batch channels may have queue latency, concurrency quotas, submission windows, and job-duration limits. Before going live, run a small-traffic test to confirm an acceptable latency range.

    Subscription plans and overage: a hybrid model for high-frequency real-time use

    For high-frequency, real-time, predictable workloads, platforms may offer monthly or prepaid plans. A plan typically covers a certain quota for a fixed fee, bills usage beyond that quota at pay-as-you-go rates, and may stack off-peak discounts.

    When usage can fill the plan’s quota, the effective unit cost of the hybrid model falls below pure pay-as-you-go. But this conclusion has conditions: the quota must be fully used, the model must be within the plan’s supported range, and the call times must match off-peak discounts. If usage is unstable, the plan doesn’t support the target model, or off-peak discounts cover limited windows, a subscription may not be worth it.

    Cache, region, and model version: the most easily overlooked details

    Caching isn’t automatically enabled on every platform. Whether caching is automatic varies by platform—some enable it automatically, others require explicit opt-in, and enabling it may incur a cache write fee. TTL tiers differ widely across platforms and can’t be summed up as simply “a few minutes”; check the official documentation.

    Caching generally only covers a prefix that matches the previous request and is usually isolated per account or key. That means stable long prefixes should be placed at the very front of the request and kept character-for-character identical, or the cache may not be reusable. Whether caching is worth enabling depends on prefix reuse frequency and write cost.

    Also budget for long context (beyond a context threshold), reasoning models’ thinking tokens, and whether retries and timeouts are billed. Cross-border businesses also need to consider regional differences: the same model may cost more in an overseas region than in a domestic one, and both input and output prices may rise. Model version iteration also matters—old versions may be restricted from new onboarding or even retired, so leave room for migration costs in long-term planning.

    Why can the bill nearly double at the same unit price?

    A simplified illustrative example makes this clear.

    Assume the same model is priced at 20 per million input tokens, 2 per million cache-hit tokens, and 100 per million output tokens (illustrative values). Each request carries 4,500 input tokens, including a 4,000-token stable prefix, and generates 300 output tokens.

    Team A does everything pay-as-you-go, with no cache hits and no batch channel. This works out to about 120 per 1,000 requests.

    Team B does two things: 40% of requests hit the 4,000-token cached prefix, and 60% of requests go through a batch channel at a 20% discount (0.8x). On a conservative basis—the cache-hit portion doesn’t receive the batch discount—Team B’s cost is about 76.8 per 1,000 requests. Team A’s bill is about 1.56x Team B’s.

    If Team B further raises the cache-hit rate to 80% and routes 80% of delay-tolerant tasks into the batch channel, cost can drop to about 43.2 per 1,000 requests. At that point Team A’s bill is nearly 2.8x Team B’s—a gap that approaches or exceeds “doubling.”

    This is the same unit price with a different bill: what actually changes isn’t the price table but the token mix, cache-hit rate, batch proportion, and scheduling strategy.

    How to put cost optimization into practice

    You can start from five directions:

    1. Route offline tasks through batch: send tasks that don’t require real-time responses uniformly to the batch channel.
    2. Use subscriptions for high-frequency real-time use: when usage is stable and can fill a plan’s quota, cover the baseline with a plan and send overage to pay-as-you-go.
    3. Schedule off-peak: place delay-tolerant calls in low-traffic periods to stack off-peak discounts.
    4. Make good use of caching: put stable long prefixes at the front, keep them character-for-character identical to raise the hit rate, and avoid frequent changes that invalidate the cache.
    5. Choose the right model tier: tasks that a lightweight model can handle don’t need to default to a flagship model—build tiered routing between tasks and models.

    Code example: how to estimate an LLM API bill

    Below is an adaptable cost-estimation example. All prices are illustrative; check your chosen platform’s pricing page for actual figures.

    1. # Generic LLM API cost estimation example (all prices are illustrative)
    2. PRICE = {
    3. "input": 20.0, # per 1M tokens
    4. "cache_hit": 2.0, # per 1M tokens, cache-hit price
    5. "output": 100.0, # per 1M tokens
    6. }
    7. BATCH_DISCOUNT = 0.6 # simplified model: whether it stacks follows official billing rules
    8. def estimate_cost(input_tokens, output_tokens, cache_hit_tokens=0, batch=False):
    9. """Estimate cost under pay-as-you-go / batch billing"""
    10. fresh_input = max(input_tokens - cache_hit_tokens, 0)
    11. if batch:
    12. # Conservative basis: the cache-hit portion does not get the batch discount
    13. cost = (
    14. fresh_input / 1e6 * PRICE["input"] * BATCH_DISCOUNT
    15. + cache_hit_tokens / 1e6 * PRICE["cache_hit"]
    16. + output_tokens / 1e6 * PRICE["output"] * BATCH_DISCOUNT
    17. )
    18. else:
    19. cost = (
    20. fresh_input / 1e6 * PRICE["input"]
    21. + cache_hit_tokens / 1e6 * PRICE["cache_hit"]
    22. + output_tokens / 1e6 * PRICE["output"]
    23. )
    24. return cost
    25. # Scenario: each request carries a 4,000-token stable system prefix + 500-token varying question
    26. # No caching: per 1,000 calls
    27. no_cache = estimate_cost(4500, 300) * 1000
    28. # With caching (4,000 tokens hit): per 1,000 calls
    29. with_cache = estimate_cost(4500, 300, cache_hit_tokens=4000) * 1000
    30. # Cache + batch channel: per 1,000 calls
    31. batch_cost = estimate_cost(4500, 300, cache_hit_tokens=4000, batch=True) * 1000
    32. print(f"No cache: {no_cache:.2f}")
    33. print(f"With cache: {with_cache:.2f}")
    34. print(f"Conservative cache+batch: {batch_cost:.2f}")

    On the conservative basis used here—the cache-hit portion doesn’t receive the batch discount—the output is roughly:

    1. No cache: 120.00
    2. With cache: 48.00
    3. Conservative cache+batch: 32.00

    If a platform’s batch rules allow the cache-hit portion to also receive the discount, then on this illustrative basis the cost per 1,000 requests is about 120.00 → 48.00 → 28.80, where caching contributes about 72 and batching contributes another 19.2. Platforms differ on whether batch discounts stack, whether cache writes are billed, and whether cache hits participate in discounts—you must verify the official billing rules.

    Also note: the first request may require a paid cache write, which the example above doesn’t include. The real bill also depends on the cache-hit rate, the proportion of tasks that can be batched, output length, retry frequency, and regional pricing.

    For call routing, you can split it like this:

    1. def is_batchable(task):
    2. """Simple check for whether a task can go through the batch channel"""
    3. return (not task.get("require_realtime", True)) and task.get("can_delay", True)
    4. def route_request(task):
    5. """Choose a call channel based on task characteristics"""
    6. # Real-time first: real-time requests may use subscription/plans, but should not enter the batch channel
    7. if task.get("require_realtime", True):
    8. return "realtime"
    9. if is_batchable(task):
    10. return "batch"
    11. return "realtime"
    12. print(route_request({
    13. "name": "nightly_summary",
    14. "require_realtime": False,
    15. "can_delay": True
    16. }))
    17. print(route_request({
    18. "name": "chat",
    19. "require_realtime": True
    20. }))

    A note here: routing real-time traffic to subscriptions and sending tasks through the batch channel may look like they overlap, but the priority should be clear. Real-time requests keep the real-time channel first; a subscription is a billing optimization on the real-time side; only tasks that are explicitly delay-tolerant and batchable go into the batch channel. The batch channel usually has queue-latency and quota limits, so don’t simply read “delay-tolerant” as “can be batched without limit.” Before scaling up usage, run a small-traffic test of real latency, success rate, and cost.

    How to choose a platform and billing method?

    When choosing a platform, don’t look only at the unit prices on the pricing page. Evaluate in these steps:

    1. Export real business samples and measure the proportions of input, output, cache hits, long prefixes, and retry requests.
    2. Run a cost model on the real token distribution, rather than comparing only “how much per million tokens.”
    3. Check whether the platform offers batch channels, cache write fees, subscription plans, off-peak discounts, regional differences, and other rules.
    4. Run small-traffic tests on key workloads to validate batch latency, cache-hit rate, plan quota, and bill explainability.

    Mainstream cloud platforms generally offer multiple billing methods such as pay-as-you-go, batch, cache, and subscription. Specific names, discount levels, and supported models should be confirmed against each platform’s official billing documentation. Platforms may differ on whether caching is automatic, whether cache writes are billed, whether batch discounts stack, and whether plans restrict models.

    Common misconceptions about LLM API billing

    • Looking only at unit price, not token mix: for workloads with a high output proportion, the impact on the total bill can be larger.
    • Ignoring cache write fees: cache hits are cheap, but if prefix reuse is low, write costs can cancel out the savings.
    • Assuming batch is always cheaper: if tasks can’t be delayed, or batch queuing affects the business, the discount may not be worth it.
    • Assuming a plan always saves money: when quota isn’t fully used, the model isn’t supported, or time windows don’t match, a plan can be worse than pay-as-you-go.
    • Ignoring retry and timeout billing: some retried requests can incur extra input and output charges.
    • Ignoring regional and version changes: overseas regions, old-model retirement, and new-version price changes can all affect long-term budgets.

    Implementation checklist

    • Measure the output token proportion: if output exceeds 40% of tokens, prioritize optimizing generation length and model tier.
    • Assess cache value: when stable prefixes reach over 1,000 tokens and repeated calls make up a high proportion, evaluate enabling caching; also confirm whether it must be explicitly enabled and whether cache write fees apply.
    • Estimate batch savings: enable batching when the deferrable-task proportion, batch discount rate, and scheduling cost still yield a net positive; reserve acceptable latency for offline tasks.
    • Evaluate subscription plans: consider a subscription when baseline usage covers most of the plan’s quota, the model is within the plan’s supported range, and call times match off-peak discounts.
    • Build bill attribution: split input, output, cache, write fees, regional fees, and retry fees by business line, model, and call channel to find the biggest cost drivers.
    • Verify billing items: use the platform’s latest official billing documentation, and check for newly added billing items this period, such as long context, thinking tokens, cache writes, and retry fees.
    • Watch region and version: for cross-border businesses, factor overseas regional price coefficients into the budget, and keep tracking model version iterations, retirement notices, and migration costs.

    FAQ

    How are cache hits calculated?
    Cache hits are usually billed at the cache-hit price, while the missed portion is billed at the regular input price. The premise is that the prefix matches, the cache has been written, and it hasn’t expired. Platforms differ on automatic caching, explicit opt-in, write fees, and TTL tiers.

    How much can batch save?
    How much batch saves depends on the discount rate, the batchable proportion, output length, and cache-hit rate. In general, the higher the proportion of delay-tolerant tasks and the larger the batch discount, the more obvious the savings.

    When is a plan not worth it?
    A plan may be worse than pay-as-you-go if monthly usage fluctuates a lot, quota isn’t fully used, the target model isn’t in the plan’s supported range, or off-peak discounts can’t cover the main call windows.

    Conclusion

    “Same unit price, doubled bill” reminds us that LLM API cost optimization is essentially a systems-engineering effort around token structure, billing rules, call channels, and business scheduling—not simply comparing price tables. Send offline tasks to batch, high-frequency real-time traffic to subscriptions, stable prefixes to cache, and delay-tolerant calls to off-peak windows, then layer on tiered routing between tasks and models—only then can you get a lower real bill at the same unit price.