LLM API Unit Prices Stay Flat, So Why Do Real Costs Keep Rising?

    A flat per-token price after a model upgrade is easy to read as a pure win on cost-efficiency, but the arithmetic does not support that conclusion. This article breaks the API bill into its real variables, shows why token volume, cache-hit rate, and task success rate drive actual spend, and lays out how to make cost per task a first-class metric through stable-prefix caching, scenario-based evaluation, and basic cost observability.

    1. The Overlooked Premise: Unit Price Is Only One Factor in the Cost Formula

    When a model version upgrade keeps the published per-million-token price identical to the previous generation while noticeably improving aggregate benchmark scores, it is usually read as a one-sided improvement in cost-efficiency. That conclusion does not hold up arithmetically. A real API bill is made up of at least four variables: the input token price, the output token price, the cached-input token price, and the total number of tokens actually consumed to complete a business task. The provider sets the first three; the fourth is determined jointly by model behavior, prompt design, and how you make the calls.

    Writing cost as a computable expression makes the problem clear:

    1. Cost per task =
    2. input tokens × input price
    3. + output tokens × output price
    4. + cache-hit tokens × cache input price
    5. + cache-miss tokens × input price
    6. + failed retries and timeouts × retry count × the terms above

    A flat unit price only guarantees that the coefficients on the right-hand side stay unchanged; the token counts are variables. Once a new model produces more content to complete the same task, total cost drifts upward. A common pattern in the industry is that capability gains come with longer reasoning chains, more thorough explanations, and more tool-call rounds; a 10–20% rise in output tokens is not unusual. Given the widespread pricing structure where the output price is several times the input price, expansion on the output side amplifies the bill far more than expansion on the input side.

    2. Make “Cost per Task” a First-Class Metric

    A more decision-relevant metric than unit price is cost per task: the average spend required to complete a standardized business task. Computing it needs three inputs: the task’s average input tokens, average output tokens, and success rate. Success rate must enter the formula, because failed tasks are still billed and often trigger retries.

    An illustrative estimation function (all values are assumed and used only to demonstrate the calculation logic):

    1. def estimate_task_cost(in_tok, out_tok, cache_hit_tok,
    2. price_in, price_out, price_cache,
    3. success_rate, retries=0):
    4. billable_in = in_tok - cache_hit_tok
    5. cost = (billable_in * price_in
    6. + cache_hit_tok * price_cache
    7. + out_tok * price_out)
    8. attempts = 1 + retries + (1 - success_rate)
    9. return cost * attempts / 1_000_000

    When aggregate capability scores are close, differences in cost per task between implementations usually come from the engineering side rather than the model side: redundant prompts, resending the full context every time, cache misses, and rework caused by missing result validation. This means most of the room for cost optimization is in the caller’s hands.

    3. Cache Hits Are an Underrated Lever

    The cached-input price is typically well below the standard input price, effectively a sizable discount on repeated prefixes. To actually capture that discount, request construction must satisfy one hard constraint: a stable prefix.

    • Put the system prompt, tool definitions, and few-shot examples at the very front, and replace them wholesale on version upgrades rather than inserting changes locally;
    • Move fields that change over time (timestamps, random IDs, user nicknames) to the end of the prompt;
    • Within a session, keep history growing in append-only fashion, with no mid-stream rewriting or reordering;
    • Reuse the same session context across turns in a multi-turn task instead of reassembling it every turn.

    A single counterexample makes the point: inserting a dynamic timestamp in the middle of a long prompt changes the hash of the entire prefix, invalidates the whole cache, and sends input cost back to full price.

    4. How to Use Capability Scores

    An aggregate intelligence index is good for coarse screening, not for a final selection decision. It is a weighted summary of multiple benchmarks and usually does not match the distribution of your specific business. Production selection should run scenario-based evaluation on your own datasets, covering at least: task success rate, output format compliance rate, average number of turns, average token consumption, and a usability rate from manual spot checks. Only by converting evaluation results directly into cost per task can you align them with the bill.

    For capabilities such as coding, defensive security analysis, and long-horizon agent tasks, the evaluation focus should shift from “is the answer correct” to “is the process controllable”: whether tool calls converge, whether invalid loops appear, whether context overflows, and whether failures can be detected and terminated safely.

    5. Cost Observability and Governance

    No measurement, no optimization. A recommended minimum loop:

    1. Log the input, output, and cache-hit token counts plus a task identifier for every call, writing them uniformly to a logging service;
    2. Use monitoring and alerting to aggregate cost per task by business line, with period-over-period thresholds;
    3. Build model routing: send simple requests to a low-cost configuration and escalate complex ones to a higher-capability configuration, with routing rules driven by evaluation data;
    4. Set caps and a chunking strategy for overly long outputs to keep single-task cost from spiraling;
    5. Before a version upgrade, run A/B tests on a fixed evaluation set, comparing both capability metrics and cost per task rather than looking at unit price alone.

    6. Conclusion

    “A flat unit price with rising capability” is a favorable signal, but it is not a cost conclusion. What really determines the bill is three engineering variables: tokens consumed per task, cache-hit rate, and task success rate. Bring cost per task into the metric system on par with accuracy, trade stable prefixes for cache discounts, and replace leaderboard rankings with scenario-based evaluation, and you can hold the cost line beyond the capability race. The next phase of competition is likely not about who scores higher, but about who can push single-task cost lower at the same level of intelligence.