LLM API Pricing Guide: How to Choose the Right Tier by Cost Efficiency

    As major LLM providers restructure their API pricing, per-token price alone no longer predicts your real bill. This guide breaks down how input, cached-input, and output tokens combine to determine cost, introduces a simple cost formula with output-to-input and cache-hit ratios, maps three workload tiers to three selection strategies, and lists common cost pitfalls plus engineering practices such as prompt layering, tiered routing, budget guardrails, and result reuse. It also outlines how to build a call-metering-attribution-alerting loop on Baidu AI Cloud without quoting unconfirmed numbers.

    1. After the Price Hikes, “Cheap Per Token” No Longer Means Cheap

    Over the past two years, developers choosing an LLM have typically looked first at the price per million tokens, treating unit price as the only metric. Once mainstream providers began adjusting their price structures, that intuition stopped working. The reason is simple: a real bill is not determined by unit price alone, but by the combination of how your usage splits across three token types and how their unit prices relate to each other.

    From a billing perspective, a single request is usually split into three parts: regular input tokens, input tokens that hit the cache, and output tokens. Their unit prices are often on very different scales. Cached input typically costs around one tenth of regular input, while output is priced significantly higher than input. One typical structure mentioned in the original text is a model family with three tiers—complex professional tasks, a balance of capability and cost, and cost-sensitive high concurrency—where the output price is six times the regular input price in every tier. That “six times” is not an arbitrary choice by one provider but the prevailing shape of the industry today, because the generation stage consumes far more compute and GPU memory than the prefill stage.

    Conclusion one: when evaluating cost efficiency, first work out your workload’s output-to-input ratio, then look at unit price. Otherwise, you may easily end up with the option that has the lowest input price but the highest final bill.

    2. Turn the Billing Model into a Formula, and Do the Math Before Choosing

    Let the input token count be Tin, cached input tokens be Tcache, and output tokens be Tout, with unit prices Pin, Pcache, and Pout respectively. The cost of a single call is:

    1. Cost = Tin * Pin + Tcache * Pcache + Tout * Pout

    Then define two key ratios:

    1. R_io = Tout / Tin # output-to-input ratio
    2. S_cache = Tcache / Tin # cache hit rate

    Substituting Pout = k * Pin (with k≈6 in the original scenario) gives:

    1. Cost ≈ Pin * (Tin + k * Tout) * (1 - S_cache * (1 - Pcache/Pin))

    This expression tells you three things:

    1. When R_io is large (long-form generation, code completion, report writing), cost is dominated by the output price, so choosing the tier with cheaper output matters more than choosing the one with cheaper input.
    2. When R_io is very small (classification, extraction, intent recognition, short Q&A), cost is dominated by input, so you should prioritize lowering the input price and raising the cache hit rate.
    3. The cache hit rate is a multiplicative lever. Raising the hit ratio from 0 to 0.7 can cut overall cost by nearly half without affecting any model capability.

    It is worth fixing this table in your project’s capacity-planning document. Each time you switch models, you only replace the three unit-price parameters and can then compare the real cost of different tiers and different providers side by side, instead of being pulled along by the “lowest unit price” on a marketing page.

    3. Tiering by Scenario: Three Workload Types, Three Strategies

    The first type is cost-sensitive high-concurrency workloads, such as log summarization, pre-filtering for content moderation, tagging, and batch text classification. They are characterized by short inputs, even shorter outputs, and enormous call volume. The strategy is to pick the lowest tier, push R_io below 0.1, and use prompts to constrain output to a fixed enumeration or a very short structure, avoiding the multiplied billing that comes from the model “saying one extra sentence.”

    The second type is balanced business workloads, such as intelligent customer service, knowledge base Q&A, structured information extraction, and first drafts of marketing copy. These tasks place some demands on capability, but output length is controllable. The strategy is to pick the middle tier and turn the system prompt, domain knowledge, and few-shot examples into a stable prefix so you capture the cache discount. This is the tier where cost efficiency improves most noticeably.

    The third type is complex professional workloads, such as long-chain reasoning, repository-level code understanding, complex document review, and multi-step planning. Here capability comes first, and cost is amortized through engineering means: segmented processing, routing to a small model first with a large model as fallback, and persisting intermediate results for reuse to avoid paying twice.

    A practical routing sketch:

    1. def route(task):
    2. if task.est_output_tokens < 200 and task.difficulty == "low":
    3. return "tier_low" # cost-sensitive tier
    4. if task.requires_reasoning and task.input_tokens > 30000:
    5. return "tier_high" # complex professional tier
    6. return "tier_mid" # balanced tier

    The value of routing is that it sends 80% of simple requests to the cheap tier and lets only the 20% of hard requests consume the expensive quota. Overall cost typically drops by an order of magnitude, with almost no change in perceived quality for users.

    4. Cost Black Holes That Are Easy to Miss

    The first is runaway output. Because the output price is several times the input price, a single “please explain in detail” can multiply the cost of one call several times over. State explicit word limits in the system prompt, ask for bullet points, and use stop conditions to truncate when necessary.

    The second is replaying the full context. In multi-turn conversations, carrying the complete history every turn makes input tokens grow linearly with the number of turns. A workable approach is rolling summarization plus retaining key fragments, rather than blindly concatenating everything.

    The third is cache misses. Caches usually require an exactly identical prefix, so inserting any timestamp, random ID, or user nickname at the beginning of the prompt will drop the hit rate to zero. Moving dynamic content to the end is a zero-cost optimization.

    The fourth is failed retries and overlong completions. Retry policies should distinguish retryable errors from business errors, and set a hard cap on maximum output length to avoid huge bills in abnormal situations.

    5. An Engineering Optimization Checklist

    • Layer your prompts: put the stable prefix (role, rules, examples) first and dynamic data last to maximize cache hits.
    • Structure your output: constrain length with fixed fields, enumerated values, and short sentences, which saves cost and makes downstream parsing easier.
    • Route by tier: let small models do initial screening and drafts, and reserve large models for final review and fallback.
    • Add budget guardrails: set token quotas and alert thresholds per tenant or per endpoint, and use logging and monitoring/alerting services for usage attribution.
    • Go asynchronous and batched: send non-real-time tasks through a queue to smooth peaks, buffer with a message queue, and scale elastically on a container platform to improve resource utilization.
    • Reuse results: write cacheable inference conclusions to object storage or a cache layer to avoid being billed repeatedly for the same question.
    • Evaluate first: build a small regression set and run a quality comparison before switching models, so you don’t “save money but lose points.”

    6. Notes on Implementation with Baidu AI Cloud

    If you use Baidu AI Cloud’s LLM-related capabilities, it is still best to do budget estimation with the same framework of “three token types plus output multiplier.” For specific unit prices and quotas, refer to the official documentation and what is shown in the billing console; this article does not cite any unconfirmed numbers. On the engineering side, you can combine general-purpose capabilities such as object storage, message queues, container platforms, logging, and monitoring/alerting to build a closed loop of “call—meter—attribute—alert,” turning cost from a month-end bill into a real-time observable metric.

    7. Closing Thoughts

    The price hikes themselves are not what is frightening; what is frightening is continuing to make selection decisions with single-dimension thinking. Once you formalize the cost formula, tier your workloads, and treat cache usage and output length as first-class citizens to be governed, cost efficiency stops being an adjective in a vendor’s marketing copy and becomes an engineering metric you can calculate, reproduce, and keep optimizing.