LLM Token Billing Ledgers: What Transparent Compute Costs Mean
A simple 1+1 query billed at 62 input tokens and 5 output tokens shows how LLM APIs meter usage. This article explains why tokens are the unit of billing, how input/output prices, off-peak rates, and cache misses work, and how developers can estimate cost and optimize prompts.
A simple “1+1” query shows how fine-grained billing is
In a live test, a user sent a large language model the simplest math request: “compute 1+1.” The model replied “1+1=2.” The billing breakdown was more interesting than the answer. The request was metered at 62 input tokens and 5 output tokens. Using standard rates for an off-peak window with a cache miss—about 1 yuan per million input tokens and 4 yuan per million output tokens—the estimated charge was 0.000082 yuan. The page still labeled the call as free and offered no top-up flow.
The point is not the amount. It is that previously hidden compute cost was laid out in full. Counting 62 input tokens and 5 output tokens means every request is sliced and measured. Tiered prices (input vs. output, off-peak vs. peak, cache hit vs. miss) reflect how supply is scheduled. For developers, that is a practical “compute ledger.”
Why tokens are the unit of LLM billing
Models do not process text as raw characters or words. A tokenizer first splits input into tokens—the smallest semantic units. A token may be a Chinese character, part of an English word, or punctuation. Inference cost scales with context length, so tokens are a natural meter.
Technically, token billing has several properties:
- It tracks compute. Transformer inference time and GPU memory grow roughly linearly—or worse—with sequence length. Token count is a proxy for real resource use.
- Input and output are priced differently. Output tokens are generated autoregressively, one by one, and cannot be parallelized like the prefill of the prompt. Output rates are therefore usually higher; 4 yuan vs. 1 yuan in the example is typical.
- Each call can be audited. Input and output tokens per request can be counted and summed, which makes pay-as-you-go checkable.
Estimating cost in code
For teams that call an LLM API, folding billing into a cost monitor is straightforward. A sketch:
def estimate_cost(input_tokens, output_tokens,input_price=1.0, output_price=4.0):"""input_price / output_price: currency per million tokensreturns estimated cost of one call"""cost = (input_tokens / 1_000_000) * input_price \+ (output_tokens / 1_000_000) * output_pricereturn cost# Replay the measured case: 62 input + 5 outputfee = estimate_cost(62, 5)print(f"Cost per call: {fee:.6f}") # about 0.000082
At those rates, 10,000 identical calls would cost about 0.82. Lightweight requests have a tiny marginal cost, but at tens of millions of calls, wasted tokens become real spend. Transparency only helps if you can see the numbers.
Time-of-use pricing and cache hits: scheduling on the bill
The example used “off-peak, cache miss” rates. Both dimensions matter.
Time-of-use pricing treats inference capacity like electricity. Clusters are sized for peak load, so nights and other troughs leave idle GPUs. Lower off-peak prices push batch jobs (bulk text processing, offline labeling) off the peak and raise utilization. Users trade latency flexibility for a lower rate.
Cache pricing targets repeated content. The same system prompt or long document often appears across many requests. If the serving stack caches processed prefixes, those tokens need not be recomputed and can be cheaper. Developers should put stable text first and keep it consistent, and put changing text last, to raise hit rates. Some platforms’ logs and alerts can export per-request token usage so teams can attribute cost at that grain.
What cost transparency means for developers and companies
- Budgets can be estimated and attributed. When tokens and unit prices are visible, teams can give each product line its own cost account and put model spend in the engineering budget instead of a opaque invoice after the fact.
- Optimization has a handle. Separate input and output meters point to concrete levers: shorter system prompts, less context, constrained output (for example short structured answers), and putting high-frequency repeats on the cache—all measurable.
- Billing becomes comparable. An open compute ledger turns “are LLM calls expensive?” into numbers you can compare. Users can estimate TCO from real rates and their own volume. Mainstream model platforms, including Baidu AI Cloud, commonly meter by tokens with tiered, usage-based prices; that pattern is becoming a shared language.
- “Free” needs a second look. The example was billed to six decimal places and still labeled free. Free usually means cost is absorbed elsewhere or is a promotional subsidy. Plan scale-out spend on ledger terms so you do not treat subsidy economics as the long-run baseline.
Conclusion
A “1+1” call at 0.000082 looks like a marketing detail. It is actually a compact lesson in compute cost: token metering, input vs. output prices, time-of-use and cache rules, and what transparent billing looks like. For developers, reading that ledger is the baseline skill for cost models in the LLM era—make every unit of compute visible, then make every call worth it.
