How to Read LLM Usage: Token Consumption and Cost Estimation
Learn how to interpret large language model usage data, understand input and output tokens, estimate API costs with Python, choose models by task complexity, and control production spending through monitoring, caching, routing, and quality regression testing.
1. Why LLM Usage Data Matters
A third-party aggregation platform recently published large language model usage data for the previous week, from November 9 to 15. The statistics showed that the models included in the ranking processed approximately 211 trillion tokens during the week, representing week-over-week growth of about 0.48%. Models from companies based in China accounted for approximately 119.1 trillion tokens, up about 2.51% week over week, while models from U.S.-based companies accounted for about 14.83 trillion tokens. Four of the top five models came from companies based in China.
These figures indicate the level of market adoption, but their value to developers goes beyond the rankings themselves. Usage volume is directly related to three engineering concerns: the cost of each request, service capacity limits, and which types of models are suitable for different tasks. To interpret usage data correctly, you first need to understand the underlying unit of measurement and the statistical methodology.
2. What Is a Token?
A token is the basic unit that a large language model uses to process text. Models do not process raw characters or words directly. Instead, they first split the input into a sequence of tokens and then perform computations on that sequence.
The same text may produce different token counts in Chinese and English. Tokenization methods also vary between models, so identical text can result in significantly different token counts depending on the model being used.
Usage and pricing are typically divided into two categories:
- Input tokens: Prompts, context, conversation history, and retrieved materials included in the request.
- Output tokens: The response generated by the model.
Most services charge more per output token than per input token because output generation requires the model to perform inference token by token. As a result, a classification task with a long input and a short output has a very different cost structure from a writing task with a short input and a long output.
3. Important Considerations When Reading Usage Statistics
Weekly usage rankings can provide useful context, but relying on them directly for technical decisions can be misleading for several reasons:
- The sample may be biased. An aggregation platform only covers requests routed through its channels and cannot represent the actual traffic of every enterprise.
- Usage volume does not equal quality. High usage may result from low prices, generous free quotas, or ease of integration. It does not necessarily mean that a model delivers the best results.
- Week-over-week changes require a baseline. When the overall volume is relatively stable, a small change in an individual model’s usage may simply be random variation rather than evidence of a trend.
- Model performance varies by use case. Code generation, customer support, and long-document summarization require different capabilities.
Usage data is therefore best treated as an indicator of changing industry behavior, not as the sole basis for model selection. Model selection should also be based on evaluation datasets that reflect your own business requirements.
4. Converting Token Usage into Cost
Cost estimation is the first step in putting an LLM system into production. The basic formula is:
Per-request cost =Input tokens ÷ 1,000,000 × Price per million input tokens+ Output tokens ÷ 1,000,000 × Price per million output tokens
The following example uses placeholder prices for demonstration only. These are not the actual prices of any service. Replace them with the official pricing for the service you choose.
from dataclasses import dataclass@dataclassclass ModelPrice:input_per_million: float # Price per million input tokensoutput_per_million: float # Price per million output tokensdef estimate_call_cost(input_tokens: int, output_tokens: int, price: ModelPrice) -> float:"""Estimate the cost of a single model call."""input_cost = input_tokens / 1_000_000 * price.input_per_millionoutput_cost = output_tokens / 1_000_000 * price.output_per_millionreturn input_cost + output_costdef estimate_monthly_cost(daily_requests: int,avg_input_tokens: int,avg_output_tokens: int,price: ModelPrice,days: int = 30,) -> float:"""Estimate monthly cost based on average daily request volume."""per_call = estimate_call_cost(avg_input_tokens, avg_output_tokens, price)return per_call * daily_requests * daysif __name__ == "__main__":demo_price = ModelPrice(input_per_million=2.0, output_per_million=8.0)total = estimate_monthly_cost(daily_requests=10_000,avg_input_tokens=1_200,avg_output_tokens=300,price=demo_price,)print(f"Example monthly cost: {total:.2f}")
Two points are especially important when estimating costs. First, average token counts should be calculated from real logs rather than guessed. Second, retries, system prompts, and content returned by tool calls must also be included as input or output. Otherwise, the estimate will be too low.
5. Selecting Models by Task Complexity
Using the same model for every request is often inefficient. A more practical approach is to route requests according to task complexity:
- Simple tasks: Classification, keyword extraction, and format conversion can usually use smaller models with lower per-token prices.
- Moderate tasks: General question answering and summarization are suitable for models with balanced general-purpose capabilities.
- Complex tasks: Multi-step reasoning, long-document analysis, and code modification require more capable models.
Production systems can add a routing layer. Based on input length, task type, or historical failure rates, the router can determine which model tier should handle each request.
A fallback strategy should also be defined. If a higher-tier model times out or is rate-limited, the system can automatically switch to a backup model and record the fallback event.
6. Monitoring and Cost Controls
After an LLM service goes into production, usage and quality should be monitored continuously. At a minimum, consider implementing the following capabilities:
- Usage instrumentation: Record input tokens, output tokens, request latency, and error codes by tenant, feature module, and model name. These records can be aggregated through a logging service and used to configure monitoring alerts.
- Budget alerts: Set daily, weekly, and monthly spending limits. Notify the responsible team as usage approaches a threshold, and restrict non-critical features when the limit is exceeded.
- Caching and reuse: Cache frequently repeated questions or fixed system prompts to reduce duplicate charges.
- Prompt reduction: Remove unnecessary conversation history and irrelevant context to control input length.
- Quality regression testing: After changing models or prompts, use a fixed evaluation dataset to compare accuracy and other relevant quality metrics. This helps prevent cost reductions from degrading system performance.
7. Conclusion
LLM usage data reflects market adoption and usage intensity. For engineering teams, its practical value lies in highlighting the importance of token accounting, cost structure, and model tiering.
Developers should treat market statistics as background information, use real business logs to estimate costs, and use internal evaluation datasets to select models. Instrumentation, budget alerts, fallback routing, and quality regression testing are also essential for keeping LLM services stable, predictable, and cost-controlled.
