Are LLM API Costs Really About Price Per Token?
A practical framework for evaluating LLM API costs beyond sticker price. Learn why a 2.5x higher price per token does not necessarily mean higher costs, and how throughput, latency, task success rate, retries, and total cost of ownership determine the real cost per completed task. Includes capacity estimation logic, evaluation metrics, and a cost optimization checklist.
1. The Question: Does a 2.5x Higher Price Mean 2.5x Higher Costs?
Whenever a new generation of large models becomes available, the most common reaction in the community is that “the price went up.” When the listed price of a new flagship model is about 2.5x that of the previous flagship generation, the discussion usually splits into two camps: one argues that the premium is unreasonable, while the other insists that the actual experience is “cheaper instead.”
Both conclusions can be true at the same time because they measure different things. The first compares the listed price per token; the second compares the real cost of completing a business task. In engineering practice, the latter is the cost from a financial perspective, while the former is only an intermediate variable.
To judge whether an API is expensive, the question needs to be broken down into four quantifiable dimensions:
- Price: the listed price per million input/output tokens;
- Throughput and latency: how much useful content can be produced per unit of time, along with time to first token and output speed;
- Task success rate: first-pass rate, retry rate, and manual rework rate;
- Total cost of ownership: the monthly bill after folding the above three factors into a real business workflow.
2. Why “Price Per Token” Is a Misleading Metric
2.1 Differences in Billing Models
Mainstream billing usually distinguishes between input tokens and output tokens, and the output price is generally higher than the input price. This means the same claim of a “2.5x price increase” has completely different implications under different workloads: the cost structure of long-document summarization (input-heavy) differs by several times from that of code or copy generation (output-heavy).
2.2 Effective Tokens vs. Wasted Tokens
What you are billed for is not “the content you want” but “the content the model actually generates.” If the model is verbose, repetitive, or off-topic, you pay for wasted tokens and then pay again for retries. A model with more concise output and better instruction following can be cheaper even with a higher price per token.
2.3 Retries and Manual Costs Are Systematically Ignored
Raising the first-pass rate from 70% to 90% reduces the number of retries by about two-thirds. Retries consume not only tokens but also queue time, add complexity to the pipeline, and may trigger rate limiting. The hidden costs of manual review and rework are usually far higher than the token costs themselves.
3. Throughput and Latency: The Underestimated Cost Factor
Output speed (tokens/s) and time to first token (TTFT) directly determine user experience and system capacity.
- For interactive applications (AI coding assistants, customer service, writing tools), output speed determines “how long users wait,” and low speed can significantly hurt retention;
- For batch applications (offline labeling, bulk summarization), throughput determines how many tasks can be completed per unit of time, which in turn determines how much concurrency capacity needs to be reserved;
- TTFT affects “perceived responsiveness” and is especially critical in streaming output scenarios.
A key selection principle here: compare different tiers under the same service level. Comparing a high-performance tier against another platform’s “fast” or “economy” tier is not a valid comparison; the right approach is to align on the same speed range and service level, then compare price and quality.
Illustrative capacity estimation logic (pseudocode):
Output per task = average number of output tokensTime per task ≈ TTFT + output tokens / output speedRequired concurrency ≈ peak QPS × time per taskMonthly token volume ≈ daily tasks × (input tokens + output tokens) × 30Monthly cost ≈ input volume × input price + output volume × output price + retry overhead
Making “retry overhead” explicit in the formula is the most easily omitted yet most decisive factor in cost evaluation.
4. Task Success Rate: Quality Expressed in Financial Terms
Quality is not an abstract metric; it can be translated into money. It is recommended to build a small, repeatable evaluation set for each business scenario (usually a few dozen to a few hundred real samples are enough) and fix the following metrics:
- First-pass rate: the proportion of outputs usable without modification;
- Structured output compliance rate: the parsing failure rate for formats such as JSON or tables;
- Factual error rate and hallucination rate;
- Average number of rework rounds and the proportion of cases requiring manual intervention.
When running evaluations, always fix the prompt, sampling parameters such as temperature, and the evaluation version; otherwise the data is not comparable. When a new generation of models significantly raises the first-pass rate, the end-to-end cost can still decrease even with a higher price per token—this is exactly where the feeling of “cheaper” comes from.
5. Total Cost of Ownership: Putting the Bill Back into the Business Workflow
A practical cost accounting framework has five layers:
- Model invocation costs: input, output, and retries;
- Infrastructure costs: fees generated by common cloud product categories such as container platforms, object storage, message queues, logging services, and monitoring and alerting;
- Operations labor: prompt maintenance, version upgrade regression, and rate limiting and fallback strategies;
- Quality costs: rework, complaints, and compliance risks;
- Migration costs: the adaptation and validation effort required to switch providers or tiers.
The conclusion is often counterintuitive: on a high-quality tier, item 1 goes up, but items 3 and 4 go down, so the total may stay flat or even decrease.
6. Cost Optimization Checklist
- Tiered routing: send simple tasks to lightweight tiers and complex reasoning to the flagship tier, using rules or a small model for upfront classification;
- Context governance: deduplicate, compress, and rerank retrieved snippets to cut wasted input tokens;
- Output constraints: use format constraints and length limits to compress redundant output;
- Cache reuse: apply semantic caching to high-frequency repeated requests, where a cache hit costs nothing;
- Batching and asynchrony: run offline tasks during off-peak hours in exchange for better pricing tiers;
- Observability: build monitoring, alerting, and dashboards for token consumption, latency, and failure rates, and attribute costs by scenario.
Illustrative implementation of tiered routing:
def route(prompt: str, task_meta: dict) -> str:# Select the service tier based on task complexity; avoid using the highest tier for everythingif task_meta.get("need_reasoning") or len(prompt) > 8000:return "flagship"if task_meta.get("need_speed"):return "fast"return "lightweight"
7. Conclusion
A price that is “2.5x the previous generation” alone proves neither that an API is expensive nor that it is cheap. Price becomes comparable only when output speed, first-pass rate, and retry overhead are included in the calculation together. For most interactive and generative scenarios, if the new tier offers clear improvements in speed and instruction following, its end-to-end cost may actually decrease; for batch scenarios with extremely long inputs and very simple tasks, a lightweight tier combined with caching and batching should be preferred.
The final advice for developers is: do not make decisions based on the listed price; make decisions based on the cost per successfully completed task. Build your own evaluation set and cost dashboard, and let data rather than impressions drive tier selection. On platforms such as Baidu AI Cloud, you can combine general capabilities like monitoring, alerting, and logging services to attribute costs to specific business scenarios and optimize continuously.
