LLM Cost Optimization Guide: How to Cut Cost Per Task After the Price War Ends

    This article explains why the LLM price war has ended and how competition has shifted to cost per completed task. It covers three cost measurement standards you need to align on, a unified cost function, engineering techniques that reduce cost per task without changing list prices, peak and off-peak pricing strategies, the observability data required to run a cost program, and common pitfalls with a governance checklist.

    1. From Falling List Prices to Rebuilt Bills: Where Competition Is Heading

    Over the past two years, the LLM service market saw sharp price drops: input prices were pushed down to around one yuan per million tokens, with major vendors following each other within a week; chat products then went free, and list prices for a new generation of models were pulled down to one percent of leading overseas flagship models. According to industry monitoring data, the normalized average price of domestic token services briefly fell to a low of 6.8 yuan.

    One detail is often misread: this average was normalized from the list prices published at model launch, and it does not represent the average of what users actually pay. Real bills depend on call patterns, input-to-output ratio, context length, retry strategy, and cache hit rate, and the gap between the two can be several times.

    In the new phase, the market has not kept falling across the board. Instead, it has split by model tier: the value tier keeps dropping while the flagship tier has moved up collectively. On the same normalized basis, the average price has rebounded to around 13.46 yuan, nearly doubling. The flagship price increases did not trigger a wave of follow-ups; instead, they came with a shift in call volume and enterprise budgets. The stage of winning customers with a single low price is over, and the unit of competition has changed from “model list price” to “the money a customer actually spends to complete one task.”

    In mid-to-late October, several vendors released new models within ten days. The product form was still model plus API, and none of the five launches started a new price war: only one vendor cut its price, while the rest held steady from the previous generation. The real difference showed up in cost per task: one vendor cut cost per task from $0.40 to $0.26, another cut agent task cost by roughly 70%, another brought cost per task down to one eighth of an overseas flagship, and the only vendor that cut price saw almost no change in cost per task in third-party testing.

    The conclusion is clear: the price war is over, and the cost war inside real workloads is just beginning.

    2. Define “Cost” First: Three Measurement Standards to Align On

    The first step in the cost war is not optimization but alignment. The most common failure in practice is teams budgeting with list prices and reviewing with bills, so the two never match.

    1. List-price standard: input and output price per million tokens. Good for initial screening, not for budgeting.
    2. Normalized standard: the average price after converting different models and context tiers to the same baseline. Good for industry trends, not for your own bill.
    3. Task standard: the total cost of completing one acceptance-ready business task. This is the only metric that should enter OKRs and capacity planning.

    A single unified cost function is recommended:

    1. task cost = (input tokens × input price + output tokens × output price)
    2. × (1 + retry rate)
    3. × (1 - cache hit rate × discount factor)
    4. + retrieval and tool call cost
    5. + orchestration and gateway overhead

    This formula shows that unit price is only one multiplier. Retry rate, cache hit rate, and context bloat are the main reasons most teams lose control of their bills.

    3. Why Cost per Task Can Halve While Prices Stay Flat

    One new model’s release notes describe the update as a Pareto improvement in performance and cost, meaning cost drops without a drop in quality. Such improvements usually come from four engineering techniques rather than a simple price cut:

    • Context compression and retrieval refinement: trim irrelevant fragments before they reach the model. Cutting input tokens is often more effective than cutting unit price.
    • Shorter reasoning paths: merge multiple rounds of “think, verify, think again” into one high-quality generation plus one lightweight check.
    • Sparsification and scheduling optimization: route simple requests to tiered models during peak hours and reserve flagship compute for long-chain tasks.
    • Batched tool calls: merge multiple serial retrievals into one parallel call to reduce repeated context.

    Illustrative routing code:

    1. def route(task):
    2. if task.risk == "low" and task.steps <= 2:
    3. return cheap_model # handle high-concurrency simple requests
    4. if task.need_long_context:
    5. return long_ctx_model
    6. return flagship_model # use flagship only for complex chains

    The key point is that the routing strategy itself must be measurable; otherwise “cost reduction” turns into “quality reduction.”

    4. Peak and Off-Peak Pricing and Tiered Pricing: Turn the Load Curve into a Cost Advantage

    After flagship models introduced peak and off-peak pricing, output prices during peak hours can be several times those during off-peak. This is not a simple price increase but a way to make the supply-demand relationship of cloud resources explicit. There are three engineering responses:

    1. Shift load: schedule non-real-time work such as batch summarization, offline labeling, and log analysis into off-peak hours.
    2. Tier workloads: route online interaction to the peak tier and offline production to the off-peak tier, decoupled by queues.
    3. Combine reserved and elastic capacity: use reserved capacity for a stable baseline and elastic scaling for bursts, avoiding long-term payment for peak capacity.

    A related recommendation is to tag tasks with “latency sensitivity” and let the scheduler decide, rather than having each business service judge on its own.

    5. Observability: No Measurement, No Cost War

    The infrastructure for the cost war is observability. At minimum you need four kinds of data: token consumption by task, cache hit rate, retry and failure rate, and end-to-end latency. In practice you can combine general-purpose capabilities: a logging service to collect call details, monitoring and alerting for thresholds and anomaly detection, a message queue for peak shaving and load shifting, a container platform to host an elastic inference gateway, and object storage to retain evaluation sets and replay samples.

    A minimal instrumentation structure:

    1. {
    2. "task_id": "t-1024",
    3. "model_tier": "flagship",
    4. "input_tokens": 18200,
    5. "output_tokens": 900,
    6. "cache_hit": true,
    7. "retry": 0,
    8. "peak_flag": false,
    9. "cost": 0.026
    10. }

    With this detail table, a team can answer whether a 30% cost reduction came from unit price, caching, or routing.

    6. Common Pitfalls and a Governance Checklist

    • Pitfall 1: treating the launch price as the bill. Fix: budget strictly on the task standard.
    • Pitfall 2: defaulting to flagship models. Fix: build an evaluation set and route by task risk.
    • Pitfall 3: ignoring context bloat. Fix: set input limits and add a retrieval refinement step.
    • Pitfall 4: caching only results, not prefixes. Fix: place stable prefixes first to improve prefix cache hits.
    • Pitfall 5: no replay mechanism. Fix: retain request samples and run regression comparisons after model upgrades.

    7. Conclusion

    When list prices stop changing but bills keep falling, competition has moved from commercial terms to engineering capability. For enterprises, the real moat is not buying a cheaper API but breaking the task-based cost function down to every multiplier and governing each one. General-purpose capabilities from cloud providers such as Baidu AI Cloud, including container platforms, message queues, logging services, and monitoring and alerting, can serve as the foundation for this governance system; model selection and routing strategy, however, should always be driven by measurable evaluation results.