Same List Price, Different Bill: How LLM Billing Rules Determine Your Real Costs

    The list price per million tokens is only one factor in your actual LLM spending. Usage structure, invocation method (real-time vs. batch), and pricing plan (pay-as-you-go vs. subscription) all shape the final bill. This article breaks down the four token types and the base cost formula, examines six billing rules that affect costs—batch discounts, subscription plans, cache pricing, regions, free quotas, and model deprecation—provides Python code for monthly cost estimation, and offers engineering practices and a vendor-evaluation checklist for cost optimization.

    1. Same List Price, Different Bill

    When evaluating LLM services, many teams start by comparing price tables. A price table only shows the base price per million tokens—it does not equal actual spending. Even if two platforms publish identical list prices, the final bills can diverge significantly because of different billing rules.

    Actual spending is determined by three things: usage structure (how much is input, output, and cached), invocation method (real-time vs. offline), and pricing plan (pay-as-you-go vs. subscription with overage). The list price is just one multiplier. Ignoring the other two factors leads to the wrong conclusion that “same unit price means same cost.”

    When judging cost, look at the bill’s composition first, then the unit price. The following sections proceed in that order.

    2. Anatomy of a Bill: Four Token Types and the Base Formula

    LLM calls are typically billed per token, with different prices for different token types. The four common types are:

    1. Input tokens (cache miss): New content that must be fully processed on each request. Among the highest-priced categories.
    2. Cached input tokens (cache hit): The request prefix matches a previous request, so the server reuses already-computed results. Usually priced well below regular input.
    3. Cache write tokens: The cost of writing a prefix into the cache for the first time. May be priced above regular input.
    4. Output tokens: Content generated by the model. Typically priced significantly higher than input.

    The base formula for monthly cost:

    Monthly Cost = Σ (tokens of each type × unit price) ÷ 1,000,000 × invocation method factor

    The invocation method factor is 1 for real-time calls. For offline batch calls that receive a discount, use the discount ratio published by the platform. Unit prices are expressed per million tokens, consistent with most pricing pages.

    The key insight is that output prices and cache-hit prices can differ dramatically. If your workload is dominated by long-form generation, output tokens will account for most of the cost. If it is dominated by multi-turn dialogue or long system prompts, the cache hit rate determines how much you spend.

    3. Six Billing Rules That Affect Cost

    3.1 Real-Time vs. Batch Asynchronous Calls

    Batch asynchronous APIs let you submit a set of requests and receive results within a given time window. Platforms typically offer discounts for this type of call, at the cost of unpredictable latency—results may take hours.

    Workloads suited to batch APIs include data labeling, offline document summarization, historical corpus cleaning, and overnight report generation. These tasks are latency-insensitive but consume large numbers of tokens.

    User-facing interactive features are not suited to batch: online customer service, real-time translation, and code completion all require real-time calls. Don’t sacrifice response speed for the discount.

    A sound approach is to split requests into two queues at the architecture level—real-time and offline—each billed separately and independently.

    3.2 Pay-as-You-Go vs. Subscription with Overage

    Some platforms offer subscription plans: a fixed monthly fee that includes a quota, with usage beyond the quota billed on demand. Deciding which option is cheaper requires a break-even analysis.

    Let the fixed monthly fee be F, the included quota be Q, and the overage unit price be p. For actual usage U, the subscription total is F + max(0, U − Q) × p. Pay-as-you-go costs U × p₀, where p₀ is the on-demand unit price.

    Once monthly usage exceeds a certain threshold, the subscription becomes cheaper. But if usage fluctuates widely and often falls below the quota, the fixed fee becomes waste. Collect three months of usage distribution data before deciding whether to subscribe.

    3.3 Cache Pricing and Prefix Design

    Caching works by reusing repeated prefixes. Most platforms require the prefix to match exactly for a cache hit. Caches also have a TTL; after expiration, the prefix must be written again.

    Cache cost can be estimated with a simple formula. Let d be the write premium over regular input (write price minus regular input price) and s be the savings per hit relative to regular input. A prefix’s write cost pays for itself after d ÷ s average reuses.

    Using example prices: regular input at 10 per million tokens, cache write at 12.5, cache hit at 1. The write premium is 2.5, the hit savings is 9, and break-even requires roughly 0.28 reuses—in other words, as long as the prefix is hit at least once, writing it is worthwhile.

    In practice, follow these design principles:

    • Place unchanging system prompts, tool definitions, and knowledge-base snippets at the very front of the request.
    • Place user input and anything that changes per request at the end.
    • Avoid inserting timestamps, random IDs, or other per-request fields into the prefix.
    • For scenarios where intervals exceed the TTL, evaluate whether scheduled warming is worth it, or simply accept the rewrite cost.

    3.4 Region and Deployment Location

    Prices for the same platform may differ across regions. Region selection also affects network latency, data residency requirements, and compliance boundaries.

    Consider three factors together: where your users are, whether data can be transferred across borders, and whether the price difference outweighs the latency cost of a distant region. For latency-sensitive workloads, deploying closer to users may be the better choice even at a slightly higher price. For offline tasks, the cheaper region usually wins.

    3.5 Free Quotas and Promotions

    When new models launch, platforms often offer free token quotas or limited-time discounts. These help with testing and cold starts, but should not be the basis of long-term budgets.

    Build budgets on the official list price and record promotions as extra savings. That way, the budget stays intact when the promotion ends.

    3.6 Version Migration and Deprecation Risk

    Model versions iterate, and older versions may enter a deprecation process—closed to new users and eventually retired. If your code hardcodes the model name, migration creates extra rework and risk.

    Mitigations include: putting the model name in a configuration file or environment variable; maintaining an offline evaluation set for critical workloads so you can compare output quality and cost between versions before migrating; and reserving a parallel-run period to shift traffic gradually.

    4. Cost Estimation Code

    The following Python example estimates monthly cost. The unit prices are illustrative values for demonstration only—not any platform’s actual pricing. Replace them with verified figures from the official pricing page.

    1. from dataclasses import dataclass
    2. @dataclass
    3. class Pricing:
    4. """Unit prices, in currency per million tokens"""
    5. input_per_m: float # Input tokens (cache miss)
    6. cache_hit_per_m: float # Cache-hit input tokens
    7. output_per_m: float # Output tokens
    8. cache_write_per_m: float = 0.0 # Cache write tokens
    9. @dataclass
    10. class Usage:
    11. """Token usage over one month, in tokens"""
    12. input_tokens: int
    13. cache_hit_tokens: int
    14. cache_write_tokens: int
    15. output_tokens: int
    16. def monthly_cost(pricing: Pricing, usage: Usage, batch_ratio: float = 1.0) -> float:
    17. """Monthly cost for one invocation type. batch_ratio is the price factor
    18. for that invocation type; use 1.0 for real-time calls."""
    19. base = (
    20. usage.input_tokens * pricing.input_per_m
    21. + usage.cache_hit_tokens * pricing.cache_hit_per_m
    22. + usage.cache_write_tokens * pricing.cache_write_per_m
    23. + usage.output_tokens * pricing.output_per_m
    24. ) / 1_000_000
    25. return base * batch_ratio
    26. if __name__ == "__main__":
    27. # Example prices, for demonstration only
    28. plan = Pricing(
    29. input_per_m=10,
    30. cache_hit_per_m=1,
    31. output_per_m=50,
    32. cache_write_per_m=12.5,
    33. )
    34. realtime = Usage(
    35. input_tokens=200_000_000,
    36. cache_hit_tokens=600_000_000,
    37. cache_write_tokens=50_000_000,
    38. output_tokens=40_000_000,
    39. )
    40. offline = Usage(
    41. input_tokens=100_000_000,
    42. cache_hit_tokens=0,
    43. cache_write_tokens=0,
    44. output_tokens=20_000_000,
    45. )
    46. all_realtime = monthly_cost(plan, realtime) + monthly_cost(plan, offline)
    47. split = monthly_cost(plan, realtime) + monthly_cost(plan, offline, batch_ratio=0.6)
    48. print(f"All real-time: {all_realtime:.0f}")
    49. print(f"Offline via batch: {split:.0f}")

    The result: 7,225 when everything runs real-time, versus 6,425 when the offline portion goes through batch—about 11% saved purely by splitting invocation methods. Actual savings depend on the share of offline traffic and the platform’s discount.

    The value of this code is that the rules are parameterized. When a platform changes prices or discounts, you only adjust parameters to recompute, without rewriting business logic.

    5. Engineering Recommendations

    5.1 Route by Call Type

    Tag every request at the gateway or scheduling layer with a category such as “real-time,” “offline,” or “evaluation.” Route each category to the appropriate invocation method and region, and track costs separately.

    5.2 Record Usage by Token Type

    Logs should record cache-miss input, cache-hit input, cache write, and output tokens separately—not just a total. Only with categorized records can you judge whether the caching strategy works and locate cost anomalies.

    5.3 Set Budgets and Alerts

    Set a monthly budget for each business line and environment, and trigger alerts at defined consumption levels. Common thresholds are 50%, 80%, and 100%. Alerts should monitor both total token volume and average cost per request, since the latter quickly surfaces problems like prompt bloat.

    5.4 Tier Model Selection

    Not every task needs the most powerful model. Simple tasks like classification, extraction, and format conversion can use cheaper models; reserve expensive models for complex reasoning and long-form generation. Routing rules should be based on offline evaluation results, not intuition.

    5.5 Control Context Length

    Input tokens grow linearly with context length. Periodically prune irrelevant history, compress long documents, and keep only snippets relevant to the current question. This reduces both cost and latency.

    6. Evaluation Checklist

    When comparing platforms or plans, check each of the following:

    • Does the list price cover all token types—especially cache write and cache hit prices?
    • What are the batch API’s discount ratio, time window, and supported model range?
    • Are the subscription’s fixed fee, included quota, overage price, and validity period clearly defined?
    • How is cache TTL calculated, and what conditions must a prefix meet to hit?
    • What are the price and latency in the target region, and does it meet data residency requirements?
    • When do free quotas or promotions end, and what is the regular price afterward?
    • What is the deprecation timeline and migration path for older models, and has migration been evaluated?

    7. Conclusion and Caveats

    The same unit price produces different bills under different billing rules. The main paths to cost optimization are: move offline tasks to batch APIs, hand repeated prefixes to the cache, choose subscription or pay-as-you-go based on real usage, and avoid hardcoding model names and price assumptions into business code.

    Note that prices and rules change over time. All estimates should be based on the latest official pricing pages and re-verified before key decisions. The formulas and code in this article apply to any service with a similar billing structure—just substitute the parameters.