LLM API Pricing Logic and Technical Selection Practices
This article breaks down how LLM API pricing actually works and why token prices alone are a poor basis for technical selection. It contrasts cost-based pricing with market-positioning pricing, shows how to model the real cost of each request, and outlines architecture practices such as tiered routing, semantic caching, batching, and context observability for cost governance. Readers will learn to evaluate models by cost per unit of useful intelligence rather than by headline price per million tokens.
1. The Problem: Tokens Are Being Sold as a Standard Commodity
Over the past six months, one of the most frequent moves in the LLM industry has been price cuts. A leading model vendor announced a long-term reduction for its flagship API series, with the largest drop approaching two orders of magnitude. A cloud platform cut the invocation prices of its hosted models at the same time. Other vendors introduced peak and off-peak time-based pricing, then cut again when new models launched.
These numbers spread easily: the percentage of the reduction, the lowest price per million tokens, how many times cheaper a solution is than comparable ones. The better the numbers spread, the more likely people are to form an implicit judgment — that LLMs have already been commoditized, that tokens from different vendors are interchangeable, and that price is therefore the only dimension of competition.
That judgment does not hold up in engineering terms. Tokens do unify the billing unit, but what they unify is the measurement standard, not the cost structure, and certainly not the output of intelligence per unit. For the same token, the inference cluster utilization, cache hit rate, context length distribution, and batching strategy behind different vendors are completely different. For the same business request, the number of tokens, retries, and proportion of manual fallback required to achieve the goal also vary enormously across models.
Pricing a model is therefore never purely a market decision. It is simultaneously a means of screening customers, allocating compute, improving profit structure, and communicating a technical narrative externally. Understanding pricing logic is a prerequisite for technical selection and cost governance.
2. The Essential Difference Between Two Pricing Logics
Setting aside marketing language, LLM API pricing today falls into two broad categories.
1. Cost-Based Pricing: Working Backward from Depreciation and Payback Period
The calculation path for cost-based pricing is straightforward: first estimate the marginal cost of continuously delivering the service, then add the expected profit to arrive at a price. The cost here typically includes only inference compute, network, storage, and operations. It excludes the amortization of upfront model R&D, as well as operating expenses such as sales and management.
A model vendor’s public statement is a typical example of this approach: the API business targets recovering its equipment investment in about ten months, considers that an acceptable return, and sees no need to push the price toward revenue or profit maximization.
Translated into engineering language: a ten-month payback and an approximately five-year depreciation period correspond to a revenue scale of roughly six times the cost. Considering depreciation alone for the moment, the required gross margin is approximately:
Gross margin = 1 - 1/6 ≈ 83.3%
According to third-party media reports, the vendor’s API business gross margin over the reporting period was about 82.9%, closely matching the calculation above. This indicates that its pricing is not a temporary promotion but a result derived steadily from a depreciation model. It also explains why such vendors’ subsequent price adjustments tend to follow a stepped downward pattern as costs fall, rather than reactive moves around competitors’ prices.
The advantage of cost-based pricing is predictability and resilience to price wars. The cost is that when the business mix changes — for example, when the share of long-context requests rises — the model needs to be recalibrated, or the margin will be eroded.
2. Market-Positioning Pricing: Expressing Performance Position Through Price
Most vendors lean toward the second logic. Rather than starting from a depreciation schedule, they first determine who they want to serve and where they stand on the performance spectrum, then price accordingly. As a result, a clear price gradient appears within the same vendor: the flagship model handles extreme performance and complex reasoning, the lightweight model handles high-concurrency and low-cost scenarios, and the mid-tier is used to absorb traffic downgraded from the flagship.
The pricing anchor for this approach is the customer’s perceptible switching cost. If the caller originally needed longer prompts, more attempts, or more complex workflows to achieve the same result, a model with a higher unit price but a higher first-attempt success rate is still economical. Conversely, when the performance gap is not enough to cover the price difference, prices are quickly pulled level — which is the deeper reason for the industry-wide rapid price decline.
3. Reducing Pricing to a Computable Cost Model
Regardless of which logic a vendor uses, the consumer needs its own measurement method. It is advisable to break the cost of each invocation into the following structure:
Cost per request ≈ (input tokens × input price + output tokens × output price)+ retry and failure losses+ extra input from retrieval and context assembly+ storage and logging overhead+ manual fallback and review costs
Three variables are the most easily underestimated:
- Context inflation. In multi-turn conversations, if each turn carries the full history, input tokens grow quadratically. In engineering terms, summarization and compression, sliding windows, and retrieval augmentation should be used to inject only the necessary fragments.
- Output share. Output tokens usually carry a higher unit price and are hard to cache. If the business requires long-form generation, costs will be significantly higher than for short answers with the same input volume.
- Failed retries. Raising the first-attempt success rate from 85% to 95% often reduces real cost by more than a unit price cut does.
A simplified budgeting script can be organized like this:
def estimate_cost(reqs, price_in, price_out, retry_rate=0.0, overhead=1.0):total = 0.0for r in reqs:base = r["in_tokens"] * price_in + r["out_tokens"] * price_outtotal += base * (1 + retry_rate)return total * overhead / 1_000_000 # prices are per million tokens
4. Architecture Practices for Cost Governance
In an environment where unit prices keep falling, improving profit by “waiting for price cuts” is a passive strategy. A more reliable approach is to build cost governance into the architecture:
- Tiered routing. Use lightweight models for deterministic tasks such as intent recognition, format conversion, and summarization, and route only complex reasoning to high-capability models. This can significantly reduce the average unit price.
- Semantic caching. Cache results for high-frequency repeated requests and return the cached portion directly. This is one of the highest-return optimization measures.
- Batching and asynchrony. Use asynchronous batch interfaces for offline tasks, which usually yields better unit costs while smoothing compute peaks.
- Context observability. Instrument telemetry to record the distribution of input and output tokens, cache hit rate, and retry rate, build a cost dashboard by business line, and set budget thresholds with monitoring and alerts.
- Capacity and elasticity. Run inference services on a container platform and combine them with a message queue to shave peaks, avoiding long-term idle compute reserved for peak load.
5. Selection Advice: Match by Scenario, Not by Unit Price
Overall, cost-based solutions suit large-scale invocations with stable traffic, clear task boundaries, and extreme sensitivity to unit cost. Market-positioning solutions suit complex tasks with high requirements for first-attempt success rate and obvious costs of failure. The general capabilities that Baidu AI Cloud provides in model services and compute scheduling can serve as the foundation for implementing the tiered routing and elastic scaling strategies described above.
The real organizational capability to build is a “cost per unit of intelligence” metric: not just how much a million tokens costs, but how much it costs to complete one effective business outcome. Once this metric becomes a shared understanding within the technical team, price cuts will genuinely translate into profit rather than merely becoming a number that spreads more easily.
