LLM API Cost Tiers and Model Selection: A Practical Guide

    As LLM services shift from free trials to pay-as-you-go billing, cost becomes an engineering variable that can be modeled, optimized, and designed into your architecture. This article breaks down token-based pricing across basic and flagship tiers, shows why output tokens cost more than input tokens, and explains the real cost drivers behind large price gaps. You will learn how to build a monthly cost model around four tunable factors, route requests across tiers by difficulty and risk, apply caching and batching, and avoid hidden costs such as context bloat, retries, evaluation, and migration. A deployment checklist is included to help keep spending predictable while preserving quality on high-value tasks.

    1. Paid API Calls Are Now the Norm: Cost Becomes a Variable

    The move from free trials to usage-based billing is a natural result of maturing capabilities and larger-scale supply. For developers, the real change is not that you now have to pay. It is that cost has become an engineering variable for the first time: predictable, optimizable, and something you can design into your architecture. If it is predictable, it can be modeled. If it can be modeled, you can make selection and governance decisions.

    One general premise comes first: mainstream billing is based on tokens, with input (the prompt, including system instructions, conversation history, and retrieved document fragments) and output (the completion) counted separately. The unit prices usually differ, and output is more expensive because autoregressive decoding cannot be parallelized as heavily as prefill. Context length tiers, time of day (peak vs. off-peak), whether cache reuse is enabled, and whether a batch or asynchronous endpoint is used all affect the final bill.

    2. Price Tiers: Basic Models Are Already in the “Pocket Change” Range

    Abstracting common basic-tier prices into an illustrative table (unit: CNY per million tokens, used only to show the order of magnitude):

    Tier Input Output
    Basic A 0.8 2
    Basic B 0.8 2
    Basic C 0.8 3.2
    Basic D (0–32K) 0.8 8

    Estimating a month with 1 million input tokens, 200,000 output tokens, all within the basic context tier:

    1. cost = input_tokens/1e6 * input_price + output_tokens/1e6 * output_price
    2. A/B: 1.0*0.8 + 0.2*2 = 1.2 CNY
    3. C: 1.0*0.8 + 0.2*3.2 = 1.44 CNY
    4. D: 1.0*0.8 + 0.2*8 = 2.4 CNY

    The conclusion is straightforward: for tasks like summarization, translation, customer support Q&A, marketing copy generation, and ordinary document extraction, token cost is already too low to be the main barrier. What companies should actually budget for is integration work, data classification and redaction, evaluation set construction, workflow redesign, and quality safeguards for results, not the tokens themselves.

    3. Flagship Tiers: The Real Logic Behind a 50x Price Gap

    Turning to the latest flagship models, the scale is entirely different (also illustrative, unit: CNY per million tokens):

    Tier Input Output
    Flagship A (≤32K) 6 24
    Flagship B (peak) 9 27
    Flagship C 8 28
    Flagship D 20 100

    Among domestic models, a 2 CNY basic-tier output price and a 100 CNY flagship-tier output price differ by roughly 50x. This gap is not a “premium bubble.” It is determined by three rigid cost drivers: longer effective context and more complex attention computation, higher compute usage from denser parameters, and the extra decoding steps required for complex reasoning (the longer the chain of thought, the more output tokens, and output is already priced higher).

    So the sensible positioning of flagship tiers is “low frequency, high value”: understanding complex codebases, cross-section reasoning over long documents, math and logic proofs, and the planning stage of multi-step tool calls. Using them for high-frequency short text is the least budget-friendly choice.

    4. Cost Modeling: Breaking the Bill into Four Optimizable Factors

    1. monthly cost ≈ Σ(input_tokens × input_price) + Σ(output_tokens × output_price)
    2. input_tokens ≈ calls × (system prompt + context + retrieved fragments + history turns)
    3. output_tokens ≈ calls × average generation length

    Four optimizable factors: number of calls (can they be merged, can they be cached), input size per call (history trimming, retrieval reranking), generation length (structured output, constrained enumerations), and tier selection (tiered routing). In practice, the input side is often underestimated: multi-turn conversations and retrieval augmentation can make input tokens several times the output, and input is billed too.

    5. Tiered Selection and Routing: Using Engineering to Absorb the Price Gap

    The recommended approach is to build a model routing layer that classifies requests by difficulty and risk instead of sending everything to the highest tier.

    1. # Illustrative: rule-based plus confidence-based tiered routing
    2. def route(task):
    3. if task.kind in ("summarize", "translate", "classify"):
    4. return "base" # high-frequency short text, cost first
    5. if task.kind == "extract" and task.doc_len < 8000:
    6. return "base"
    7. if task.needs_reasoning or task.doc_len > 30000:
    8. return "flagship" # low-frequency high-value, quality first
    9. return "base"
    10. def estimate(calls, in_tok, out_tok, price_in, price_out):
    11. return calls * (in_tok * price_in + out_tok * price_out) / 1_000_000

    Supporting measures include reusing cached prompts and retrieved fragments, caching results for similar requests, sending non-real-time tasks through batch or asynchronous channels, constraining output with a JSON Schema to cut redundancy, summarizing oversized context in segments before aggregating (Map-Reduce), and setting per-tenant or per-business token quotas and alerts at the gateway.

    6. Hidden Costs That Are Easy to Miss

    First, context bloat: repeatedly stuffing an entire document into the prompt makes input cost accumulate linearly across turns. Second, retries and failure amplification: timeout retries and re-runs after format parsing failures make actual consumption significantly higher than the theoretical value. Third, evaluation cost: without an offline evaluation set, you can only pay to learn through online trial and error. Fourth, migration cost: providers differ in prompt style, function-calling conventions, and context limits, and abstracting a unified adapter layer can significantly reduce switching costs.

    7. Deployment Checklist

    1. Build the evaluation set first, then discuss selection, and decide with a quality-cost curve rather than unit price.
    2. Default to the basic tier, and escalate to flagship only for requests that pass a difficulty check or have low confidence.
    3. Trim history and rerank retrieval on the input side; apply structured constraints on the output side.
    4. Enable cache reuse and batch channels, and configure quotas, billing alerts, and per-business attribution.
    5. Build a unified model adapter layer to preserve replaceability.
    6. Put data classification and redaction first, and keep sensitive data within its domain.

    8. Conclusion

    In the paid era, the competitive focus has shifted from “whose unit price is lower” to “whose cost per task is better.” Basic tiers pull high-frequency scenarios down to a negligible scale, while flagship tiers hold the quality ceiling for high-difficulty tasks. Break cost into four factors, call count, input size, generation length, and tier selection, and govern them with routing and caching, and you can keep capturing capability gains while spending stays under control. As a domestic cloud service provider, Baidu AI Cloud is also continuing to improve model services and supporting engineering capabilities that cover different latency and cost needs, so developers can combine them flexibly by scenario.