Why Identical LLM API Unit Prices Can Produce Bills That Differ by Nearly Half

    This article explains why comparing per-million-token input and output prices does not reveal the real cost of an LLM workload. It breaks a bill into components that can be recalculated, including uncached input, cached input, output, cache-related charges, batch processing, subscription quotas, time-based pricing, retries, and output control. It shows how each component changes total spend and recommends a monthly review method based on cost per valid task.

    1. Define the Comparison: Unit Price or Total Cost to Complete the Work

    The most intuitive way to evaluate LLM API costs is to compare the price per million input tokens and per million output tokens. However, this only shows what one billing unit costs. It does not show what it costs to complete the same set of business tasks.

    A token is the basic unit a model uses to process text. It is not the same as a Chinese character, an English word, or a character. The same text can produce different token counts under different tokenization methods, so a bill cannot be estimated from text length alone when comparing models.

    Even with the same model and the same text, the final cost can still be affected by the following factors:

    • Whether the input qualifies for cache hits;
    • Whether cache writes, cache reads, and cache retention are billed separately;
    • Whether the task runs as real-time calls or as asynchronous batch processing;
    • Whether the user has purchased subscription quotas with usage restrictions;
    • Whether time-based, regional, or channel-specific pricing rules apply;
    • Whether timeouts, retries, or redoing work after quality failures create extra usage;
    • Whether free credits and promotions have expiration dates or usage limits.

    Therefore, a rigorous comparison should measure the total cost of completing all business tasks, given the same task scope, output quality, completion deadline, and service constraints.

    All numbers in this article are assumptions used to illustrate the calculation method. They do not represent actual service prices or commitments.

    2. Establish a Common Basis: Split the Bill into Items You Can Recalculate

    1. Separate the Three Core Types of Usage

    Under a common pay-as-you-go model, model consumption can be divided into the following categories:

    • Uncached input tokens: input not billed at the cache-hit price;
    • Cache-hit tokens: input that meets the service’s billing conditions and is charged at the cache-read price;
    • Output tokens: content generated by the model and metered under the service’s rules.

    If a service bills cache writes or cache storage separately, add the corresponding items.

    A general formula is:

    Base model cost = Uncached input cost + Cache-read cost + Output cost + Separate cache-related costs.

    Note that these items must follow the service’s actual billing definitions and must not be double-counted. If cache writes are already included in uncached input costs, the same tokens cannot be charged again as full cache writes. If writes have a separate rate, the bill should state clearly how that rate relates to standard input pricing.

    Cache retention charges should not be assumed to scale directly with token count. Some billing structures depend on both capacity and retention time, so the calculation should use the metric that the billing system defines.

    2. Extend the Base Model Cost to the Full Bill

    Total spending can be expressed as:

    Monthly spend = Fixed subscription fee + Costs for usage beyond the subscription + Other resource costs - Discounts that actually apply.

    Usage covered by a subscription should not be priced once at metered rates and then added again to the fixed fee. The correct method is to apply the subscription coverage rules first and then calculate the cost of the usage that exceeds them.

    Other resource costs may come from object storage, task queues, result storage, log retention, and network transfer. For small experiments, these costs may be minor. For large-scale document processing, they can become cost items that need separate management.

    Each discount also needs to be verified individually. Free credits may apply only to specific models, time periods, or billing items. They may also be unable to combine with other offers.

    3. Why the Same Unit Price Can Lead to a Difference Close to Half

    1. Use a Complete Example as the Baseline

    Assume a business workload has the following metered monthly usage:

    • Total input: 100 million tokens;
    • Of which cache hits: 60 million tokens;
    • Uncached input: 40 million tokens;
    • Total output: 10 million tokens.

    Assume the applicable prices are:

    Billing item Assumed price
    Uncached input 20 CNY per million tokens
    Cache read 2 CNY per million tokens
    Output 100 CNY per million tokens

    To keep the example simple, this calculation excludes separate cache write, storage, and other resource costs.

    The baseline bill is:

    • Uncached input: 40 × 20 = 800 CNY;
    • Cache read: 60 × 2 = 120 CNY;
    • Output: 10 × 100 = 1000 CNY.

    The total is 1920 CNY.

    If there were no cache hits at all, the cost for the same input and output volume would be:

    100 × 20 + 10 × 100 = 3000 CNY.

    Under these assumptions, changing only the cache-hit ratio reduces the cost by 1080 CNY, a 36% decrease. This change does not come from a different unit price. It comes from usage moving into different billing categories.

    This result assumes no extra cache costs. In practice, any new cache write, retention, or maintenance costs must be subtracted from the savings.

    2. Batch Discounts Also Change the Settlement

    Using the 1920 CNY baseline above, assume a billing plan states that eligible asynchronous batch tasks are charged at 60% of the standard cost for all of the above items, and that this discount can be combined with the applicable cache billing rules.

    If all tasks qualify, the cost is:

    1920 × 60% = 1152 CNY.

    Compared with 1920 CNY, this is a 40% reduction. It is not a 60% reduction. Charging 60% of the original price and cutting costs by 60% are different things.

    If only half of the baseline cost comes from batch-eligible tasks, the total cost is:

    1920 × 50% + 1920 × 50% × 60% = 1536 CNY.

    This shows that the same discount rate can produce different total savings depending on the share of eligible work.

    If other applicable discounts are also stacked, the total may approach half of the baseline. However, such a result must be recalculated item by item. It cannot be inferred from a discount label.

    4. Cache Optimization: Focus on Reusable Stable Prefixes, Not Repeated Requests

    1. Content That Suits Reuse

    In LLM applications, content that should stay stable usually includes:

    • Long-term system instructions;
    • Fixed format requirements and field definitions;
    • Background material shared across many tasks;
    • Rule documents in a fixed version;
    • Frequently reused example sets.

    For caching mechanisms that rely on prefix matching, the stability of the beginning of the input matters a great deal. If the current time, a random identifier, or changing user information is inserted at the very start of every request, it can prevent reuse of the long text that follows.

    A more effective structure is usually:

    Put stable instructions and shared material first, and put the dynamic question and request-specific information last.

    Whether a cache hit occurs, the minimum length requirement, the validity period, and the cache scope should all be confirmed against the service’s actual rules. Sending similar text repeatedly does not guarantee cache-read pricing.

    2. Define the Denominator for Hit Rates

    Track the following metrics separately:

    • Request hit rate: the share of requests that include at least one cache hit;
    • Token hit rate: the share of all input tokens that are cache-hit tokens.

    Cost analysis usually depends more on the token hit rate. A thousand short requests with cache hits may save less money than one hit on a very long document.

    The net benefit of caching must satisfy the following condition:

    The saved uncached input cost must be greater than the added cache write, retention, and related call costs.

    For material used only once, repeated tasks with long gaps between runs, or prefixes that change constantly, actively building a cache may not be economically worthwhile.

    5. Asynchronous Batch Processing: Separate Tasks That Can Wait from the Real-Time Path

    Typical tasks for batch processing include historical data labeling, offline summarization, periodic reporting, document structuring, and bulk quality evaluation. These tasks usually do not need to finish within the few seconds a user would wait.

    However, batch processing is more than a change in billing method. The system design also needs to change:

    1. Queue the task. Store the task ID, input version, and deadline.
    2. Submit asynchronously. Control batch size and submission pacing.
    3. Track status. Distinguish pending, running, succeeded, failed, and expired tasks.
    4. Validate results. Check structure, required fields, and business rules.
    5. Retry selectively. Redo only the failed items to avoid billing an entire batch again.

    Note that the share of tasks is not necessarily the same as the share of cost. If only 20% of tasks suit batch processing but they are all long documents, they may account for most of the cost. Conversely, moving 80% of short tasks to batch may save only a small amount.

    Therefore, the value of batch processing should be evaluated by the share of cost that can be moved to batch, not by request count alone.

    6. Subscription Quotas: Calculate Utilization Before Looking at the Headline Discount

    The economics of a subscription depend on whether actual usage matches the plan’s structure.

    In a simplified scenario, assume the monthly fee is 300 CNY and the plan covers up to 500 CNY worth of eligible usage at pay-as-you-go prices. Usage beyond that is still billed at standard prices.

    Then:

    • If the month uses only 200 CNY worth of eligible usage, the subscription costs 300 CNY, which is 100 CNY more than pay-as-you-go;
    • If the month uses 500 CNY worth of eligible usage, the subscription costs 300 CNY, saving 200 CNY;
    • If the month uses 800 CNY worth of eligible usage, the cost is 300 + 300 = 600 CNY, saving 200 CNY.

    This example shows that subscription savings may be capped, and that low utilization can make a subscription more expensive.

    Real plans may also limit the eligible models, input and output offset ratios, validity periods, concurrency, usage time windows, and whether unused quota carries over. If a plan limits input, output, or call counts separately instead of using a monetary quota, the simplified method above cannot be applied directly.

    For production workloads, also check whether the subscription quota can handle peak traffic. A sufficient total quota does not guarantee enough instantaneous throughput.

    7. Time-Based and Regional Optimization: Cost Is Not the Only Constraint

    1. Evaluate Time-Based Discounts Together with Deadlines

    If a billing plan does offer discounts during specific hours, non-real-time tasks can be scheduled for later. Consider the following points:

    • Whether all tasks can finish within the discount window;
    • Whether concentrated submissions create queues;
    • Whether retries after failures would extend past the discount window;
    • Whether the discount depends on submission time, execution time, or completion time;
    • Whether additional waiting affects business value.

    For this reason, “run at night” should not be treated as a guaranteed saving. A more reliable approach is to set a deadline for each task and then choose the lowest-cost execution window that still meets that deadline.

    2. Choosing a Region Is Not Just Finding the Lowest Price

    Different service regions may differ in price, model availability, quotas, and billing currency. Region choice also affects network latency, cross-region data transfer, data residency, and compliance requirements.

    The correct order is to meet data and service requirements first, then compare costs among the options that remain. Do not reduce model fees by shifting network costs or data governance risks to other parts of the system.

    8. Retries and Output Control: Often Overlooked Sources of Cost

    1. A Timeout Does Not Mean No Usage Occurred

    When a client times out, the caller only knows that it did not receive a result within the expected time. That alone does not show whether the server executed the request, generated content, or incurred charges.

    Avoid retrying every failure indiscriminately. A safer strategy is to:

    • Stop immediately on unrecoverable problems, such as invalid parameters;
    • Retry transient failures with capped exponential backoff;
    • Store task state to prevent the application from submitting duplicate requests;
    • Use idempotency controls when the service supports them;
    • For partially successful batches, retry only the failed items.

    When analyzing bills, distinguish between network failures, model response failures, business validation failures, and manual quality rejections. Each type has different cost implications and requires different fixes.

    2. Output Control Should Be Bounded by Task Quality

    In the example bill, output costs account for a large share. Clarifying output fields, reducing repeated explanations, and limiting unnecessary elaboration can therefore produce fairly direct savings.

    However, over-compressing output can omit important information and lead to follow-up questions or rework. The goal is not the shortest possible output every time. The goal is to complete the task with the lowest total usage.

    For multi-turn conversations, manage the conversation history as well. Carrying the full history forward increases input size. Depending on business needs, you can use summaries, selected relevant excerpts, or saved stage-based state. Verify that these methods do not drop key constraints.

    9. Build a Verifiable Monthly Cost Dashboard

    Record the following information by business unit, task type, model configuration, and execution mode:

    Dimension What to record
    Ownership Project, environment, task type, cost owner
    Billed usage Uncached input, cache reads, output, and other separate items
    Execution mode Real-time or batch, region, submission and completion times
    Run results Success status, failure type, retry count, quality validation results
    Settlement details Applicable price version, subscription coverage, discounts applied, final cost

    Logs should also follow the principle of minimum necessary data. Do not record sensitive raw content indiscriminately just to track costs.

    A monthly review can be done in three steps.

    First, summarize the metered usage from call records and align it with the usage shown on the bill.

    Second, check the price version, cache classification, batch eligibility, and subscription coverage.

    Third, trace any unexplained difference back to specific business tasks. Determine whether the cause is traffic growth, more retries, longer outputs, or an expired discount.

    A more useful metric than “average cost per request” is:

    Cost per valid task = Total related cost ÷ Number of tasks that pass business quality acceptance.

    This metric counts failures, retries, and quality losses in the denominator, so it reflects business results more accurately.

    10. Conclusion: Optimize the Billing Structure Rather Than Chase the Lowest Unit Price

    The same metered unit price can produce very different monthly bills depending on cache hits, the share of batch-eligible work, subscription utilization, and how calls are made. However, any claim of “saving half” must state the baseline, the conditions that apply, and whether additional costs are included.

    A reliable practice starts by defining tasks and quality standards consistently, then splitting billed usage into categories. Measure real traffic before evaluating caching and subscriptions. Separate real-time work from offline work before designing scheduling and retry mechanisms. Finally, verify results continuously against the bill instead of relying on a one-time price comparison.

    What matters is not the lowest number in a pricing table. What matters is achieving a lower, more stable, and more explainable cost per valid task while meeting quality, latency, security, and operability requirements.