Large Language Model API Pricing Logic and Technical Selection Guide
This article breaks down how LLM API pricing actually works and why tokens are not a commodity. It compares the two dominant pricing models—cost-based pricing and market-positioning pricing—and explains how depreciation assumptions, architecture optimizations such as KV Cache, and peak/off-peak mechanisms flow through to the prices developers see. It then offers a practical playbook: building a cost-per-success model, three-tier model routing, configuration-driven scheduling, and a vendor evaluation checklist. The goal is to help developers treat cache hit rates, task deferability, success rates, and tier selection as a single cost table rather than chasing the lowest headline price.
1. Behind the Price War: Tokens Are Not a Commodity
Over the past six months, LLM API price adjustments have become increasingly frequent. Some model families have announced long-term price cuts ranging from 90% to 97%; some platforms have introduced peak/off-peak differentials; others have cut prices again with each new release. The messaging is highly consistent—only a few cents per million tokens, several times cheaper than comparable offerings.
But if you treat tokens as a standard commodity, you will reach the wrong conclusions. Tokens standardize only the billing unit. They do not standardize three things:
- Unit cost differs: For the same token, GPU memory usage, bandwidth demand, cache hit rate, and batching efficiency can vary completely.
- Value of intelligence differs: For the same thousand tokens, the business return of one successful call can differ by several orders of magnitude.
- Constraints differ: Context length, rate-limit thresholds, available time windows, and stability commitments are all part of the price.
So before looking at price, you must look at pricing logic. The industry currently uses essentially two approaches: cost-based pricing and market-positioning pricing.
2. Cost-Based Pricing: Anchoring Price to the Compute Ledger
The formula for cost-based pricing is straightforward:
Price = unit cost of sustainably delivering service ÷ (1 - target gross margin)Unit cost ≈ inference compute depreciation + network + storage + operations
Note two boundaries: it excludes upfront R&D amortization, and it excludes sales and administrative expenses. It therefore calculates a “marginal service ledger,” not a “company-wide ledger.”
2.1 Depreciation Period Determines Gross Margin
Assume equipment is depreciated over 5 years. If the requirement is to recover the equipment investment within 10 months, the annualized return is roughly 6 times depreciation, which corresponds to a required gross margin of about 83%. This is a directly verifiable anchor: when a vendor publicly reports a gross margin in the 82%–84% range, you can reasonably infer that it uses cost-based pricing and targets “reasonable profit” rather than “profit maximization.”
2.2 How Architecture Optimization Passes Through to Price
The defining characteristic of cost-based pricing is that cost reductions are immediately passed through as price cuts, and where the cut lands depends on which layer the optimization occurred in.
Take KV Cache as an example. In autoregressive inference, the cache must be held in high-bandwidth GPU memory. When a new architecture reduces that demand to one quarter of the previous generation and reduces solid-state drive demand to one eighth, both the “GPU memory” and “storage” items in the cost structure shrink simultaneously. As a result, cache hit price and output token price are cut first—because those are precisely the cost items that were optimized.
Corresponding engineering optimizations include:
- Cache tiering: hot data in GPU memory, warm data on local SSDs, cold data in object storage;
- Prefix reuse: fixing system prompts and long-document prefixes to raise hit rates;
- Quantization and sparsification: reducing per-token GPU memory usage;
- Continuous batching: increasing throughput per unit of compute.
3. Market-Positioning Pricing: Price as Narrative and Filter
Most vendors lean more toward market positioning: price is not strictly equal to cost, but instead serves four functions.
| Function | Manifestation | What it means for developers |
|---|---|---|
| Filter customers | Low prices attract elastic workloads that tolerate fluctuation | Offline batch processing benefits first |
| Allocate compute | High prices at peak, low prices off-peak | Shift tasks to off-peak windows |
| Improve profit | High tiers correspond to long context and strong reasoning | Upgrade tiers only when necessary |
| Technical narrative | “Extreme performance” positioning supports a premium | Test it yourself rather than trust marketing |
Peak/off-peak pricing is a typical product of this logic: it essentially writes compute supply and demand across the time dimension explicitly into the price, letting schedulable workloads fill the valleys.
4. A Practical Playbook for Developers
4.1 Build Your Own Unit Economics Model
Do not look only at unit price; calculate “cost per successful task”:
cost_per_success = (tokens_in * price_in+ tokens_out * price_out+ cache_hit_tokens * price_cache_hit) / success_rate
Here success_rate must account for retries, format errors, and timeouts. A low-price model with a low success rate may actually cost more.
4.2 Three-Tier Model Routing
L1 rules/small model → return on hit (lowest cost)L2 main model → handles 80% of routine requestsL3 high-capability tier → complex reasoning, long documents, low fault tolerance
Combined with caching and batching, this can push overall cost down to the 30%–50% range of a single tier (the exact ratio depends on your workload distribution and must be measured).
4.3 Make Scheduling a Configuration Item
routing:fallback: [L2, L3]cache:prefix_key: system_prompt_v3ttl_seconds: 3600schedule:peak_price_multiplier: 1.0 # published by the platformoff_peak_window: "00:00-08:00"defer_non_urgent: true
4.4 Evaluation Checklist
- Beyond unit price, does the vendor publish cache hit pricing and separate input/output pricing?
- Is there a peak/off-peak mechanism and documented rate limiting?
- Do context length and concurrency limits meet your peak demand?
- Are supporting capabilities such as logging services, monitoring and alerting, and message queues available to support async work and retries?
- Vendor lock-in risk: abstract a unified invocation layer and preserve the ability to switch.
5. Conclusion
LLM API pricing is essentially a composite of cost structure, compute supply and demand, and technical narrative. Cost-based pricing makes price cuts predictable and derivable; market-positioning pricing makes price serve filtering and scheduling functions. For developers, the right approach is not to chase the lowest unit price, but to put cache hit rate, task deferability, success rate, and tier selection into a single cost table—and to build a measurable, portable, schedulable invocation system on top of general-purpose capabilities from platforms such as Baidu AI Cloud (object storage, container platforms, logging and monitoring). That is the key to long-term cost control.
