Why LLM Token Billing Is Often Overlooked
This article explains why token-based billing is frequently hidden behind subscription or request-based pricing, even though tokens remain the underlying metering unit for all large language model services. It covers how tokenization works, why input and output tokens are priced differently, why coding assistants amplify input costs, and the risks of request-based plans. It also outlines practical cost-control methods such as context trimming, prompt simplification, caching, output constraints, observability, and tiered routing.
Why LLM Token Billing Is Often Overlooked
When people discuss the cost of using large language models, a common question comes up: why do some services rarely mention “tokens” in public discussions, while others always talk about them? The reality is not that certain models avoid tokens. Tokens have always been the underlying metering unit; what differs is how visible they are in different scenarios. This article looks at the issue from three angles—technical principles, cost structure, and usage scenarios—and ends with reusable methods for estimating and optimizing costs.
Tokens Are the Underlying Billing Unit, Not an Optional Concept
A token is the smallest unit of text that a large language model processes. The model does not read characters directly. It first splits the input into tokens, then maps them into vectors for computation. Chinese, English, code, and symbols are tokenized at different densities, so content that looks equally short can consume several times more tokens depending on the language and format.
Two basic conclusions follow:
- Any large language model service billed by usage can be converted to a token-based measure. The only difference is whether tokens are shown as the primary unit in the interface and documentation.
- When a service is presented as a package, a request quota, or a credit bundle, tokens have not disappeared. They are simply wrapped inside a coarser billing unit, which weakens user awareness.
In other words, “not hearing about tokens” is usually a matter of product packaging and billing presentation, not a missing technical capability.
Input and Output Costs Are Asymmetric, and This Is the Key to Understanding the Bill
Large language model inference has two stages: prefill, which processes the input, and decoding, which generates the output. Their computational characteristics are completely different:
- The input stage can be highly parallel, so the cost per token is relatively low.
- The output stage must generate tokens one by one through autoregression and cannot be fully parallelized, so the cost per token is significantly higher.
As a result, the industry generally adopts a pricing structure where the input price is lower than the output price. A common public pricing pattern is roughly 2 RMB per million input tokens and 3 RMB per million output tokens. This is only an order-of-magnitude illustration; actual figures should follow the provider’s current published pricing.
Once this is clear, many cases of “the price looks cheap but it does not actually save money” become easy to explain. If a workload is dominated by long inputs and short outputs, the price advantage is diluted by the input volume. Conversely, workloads with short inputs and long outputs are more sensitive to the output price.
Why Coding Scenarios Make the Token Advantage “Disappear”
Intelligent coding applications are a typical long-input workload. Their input is usually stacked from multiple parts:
- System prompts and tool descriptions;
- Repository retrieval snippets and multi-file context;
- Multi-turn conversation history;
- The user’s current instruction and error logs.
The output, however, is often just a code snippet or a change description of a few dozen to a few hundred tokens. This can push the input-to-output ratio to dozens to one or even higher. Under this structure, small differences in the input price are magnified, while any advantage in the output price is barely used. That is why the intuitive feeling that “usage-based billing looks cheap” disappears.
An illustrative estimation logic is as follows:
Cost per request ≈ input tokens / 1e6 * input price+ output tokens / 1e6 * output price+ cached portion calculated at the agreed discountDaily cost ≈ cost per request * average daily requests * (1 + retry rate)
The retry rate and the context inflation factor are the two items most easily underestimated. A failed generation often triggers another request, and repeated billing of historical content in multi-turn conversations can make the actual input volume far higher than intuition suggests.
Why Request-Based Billing Is Popular, and Its Risks
Once request-based or credit-based packages appear, users easily form the impression that billing has nothing to do with tokens. This design is not without value: it makes budgets predictable and lowers the accounting barrier. But it also raises several issues to watch:
- Usage is decoupled from cost, optimization signals are missing, and context can expand without limit.
- Fairness declines, as light-load users may subsidize heavy-load users.
- Migration becomes difficult; once a business gets used to request-based billing, it is hard to reassess real resource consumption.
- Capacity and quotas are opaque, and rate limiting may affect performance during peak periods.
A more prudent approach is to treat request-based packages as a budgeting tool while retaining internal observability at the token level.
Practical Cost Governance Methods
Regardless of the billing model, engineering teams should establish the following mechanisms:
- Context trimming: inject only the code snippets truly relevant to the current task, and control the number and length of retrieval results.
- Prompt and tool description simplification: merge duplicate instructions and remove long-invalid examples.
- Context caching: reuse caches for stable system prompts and repository summaries to reduce repeated input costs.
- Output constraints: make it clear that only the changed points should be output, avoiding lengthy explanatory output.
- Observability: log the input tokens, output tokens, and latency of each request in the logging service, and set thresholds with monitoring alerts.
- Tiered routing: send simple tasks to lightweight models and complex reasoning to more capable models.
A minimal usage-tracking structure can be designed like this:
{"request_id": "r-1024","input_tokens": 18320,"output_tokens": 260,"cache_hit_tokens": 12000,"retry": false,"task_type": "code_edit"}
With this kind of data, a team can answer where the cost is actually spent, instead of judging by feeling whether a given price tier is worthwhile.
Conclusion
Tokens have never been absent; they are simply hidden behind a friendlier billing shell. For developers, what really matters is not whether a service “mentions tokens,” but three things: the input-to-output ratio of their own workload, the hidden amplification caused by context inflation and retries, and whether token-level observability and governance are in place. If you need ready-to-use model services along with general cloud capabilities such as observability, storage, and containers, you can look into Baidu AI Cloud’s related offerings. But regardless of the billing model you choose, calculating the cost structure clearly is the fundamental way to keep bills from spiraling out of control.
