How Much Does 200 Million Tokens Cost? A Practical Cost Estimation Method
A clear walkthrough of how LLM token costs are actually calculated, the five variables that drive the final bill, and a reusable Python function for estimating your own usage. Instead of memorizing a single quote, you learn the formula and plug in your real numbers.
1. The Short Answer: Cost Depends on Price and Usage
Claims like “200 million tokens costs only a few yuan” usually come from a single personal test. Whether a number is usable for budgeting depends on three things: which model the test used, what unit price it was billed at, and whether the test volume actually reached 200 million tokens. If only a small batch of requests was run and then scaled up proportionally, the result will be distorted.
So the right way to answer this question is not to memorize a quote, but to understand the calculation method and plug in your own actual usage.
2. Understanding Tokens: The Billing Unit
A token is the smallest unit the model uses to process text. Before a piece of text is fed into the model, a tokenizer splits it into tokens, and the model reads and generates content token by token. Billing is typically based on tokens as well.
There is no fixed conversion between tokens and character counts. Different tokenizers split Chinese, English, code, and punctuation differently, so the same passage can produce very different token counts across models. For estimation, the most reliable basis is the usage statistics returned by the API, not a rough guess based on character count.
Most services split usage into two categories:
- Input tokens: everything you send to the model, including system instructions, conversation history, retrieved documents, and the current question.
- Output tokens: the content the model generates in its reply.
The unit prices for the two categories are usually different. In most cases the output price is higher than the input price, because generating content requires more computation.
3. The Core Formula
The cost of a single call can be broken into three parts:
Total cost = input tokens ÷ 1,000,000 × input unit price + output tokens ÷ 1,000,000 × output unit price
Unit prices are generally expressed as “CNY per million tokens.” Since 200 million tokens equals 200 million-token units, the cost can be written directly as:
Cost of 200 million tokens = 200 × unit price (CNY per million tokens)
Plugging different assumed unit prices into this formula produces very different results. The numbers below only demonstrate the calculation and do not represent any platform’s real pricing:
| Assumed unit price (CNY per million tokens) | Cost of 200 million tokens (CNY) |
|---|---|
| 0.5 | 100 |
| 5 | 1000 |
| 20 | 4000 |
The 10 CNY mentioned in the original post corresponds to a unit price of about 0.05 CNY per million tokens. That figure is clearly below the common estimation range, and the reason may be that most input hit the cache, a low-cost model was used, free credits were applied, or the test volume was far smaller than 200 million tokens. You should confirm these conditions before drawing conclusions.
4. Five Variables That Affect Cost
1. The input-to-output ratio. For the same 200 million tokens, if all are input the cost is far lower than if all are output. Chat-style applications usually have more input and less output, while content-generation applications have a higher output share. Confirm your workload’s read/write ratio before estimating.
2. Context repetition in multi-turn conversations. In a multi-turn conversation, each turn typically resends the history to the model. The input for turn n is roughly the sum of all previous turns, so input tokens grow with the number of turns and far exceed the number of characters the user actually typed. Controlling history length—for example, keeping only the most recent few turns or summarizing the history—is the most direct way to reduce cost.
3. Cache hits. When multiple requests share the same prefix content, such as a fixed system instruction or a long document, some services charge a lower unit price for the input that hits the cache. Whether caching is available, along with its validity period and billing rules, depends on the specific service and should follow the rules published by that service.
4. Model choice. Within the same service, unit prices across different capability tiers can differ significantly. Many tasks—such as classification, extraction, and format conversion—can be handled by a smaller model, so there is no need to default to the most powerful one.
5. How you call the model. Offline batch processing and real-time online calls may be priced differently. Concurrency and retry counts also affect total usage. Retries of failed requests consume tokens again, a point that is often overlooked.
5. Estimating Cost with Code
The example below wraps the rules above into a function. The price parameters need to be replaced with the actual prices of the service you use.
from dataclasses import dataclassfrom typing import Optional@dataclassclass Pricing:input_per_million: float # CNY per million input tokensoutput_per_million: float # CNY per million output tokenscached_per_million: Optional[float] = None # CNY per million cached tokens; None if there is no cache pricedef estimate_cost(input_tokens: int, output_tokens: int,cached_tokens: int, price: Pricing) -> float:"""Estimate the cost (CNY) of a single or batch call. cached_tokens is the portion of the input that hits the cache."""fresh_input = max(input_tokens - cached_tokens, 0)cost = fresh_input / 1_000_000 * price.input_per_millioncache_price = (price.cached_per_millionif price.cached_per_million is not Noneelse price.input_per_million)cost += cached_tokens / 1_000_000 * cache_pricecost += output_tokens / 1_000_000 * price.output_per_millionreturn round(cost, 4)if __name__ == "__main__":# Hypothetical prices, only to demonstrate the calculationdemo_price = Pricing(input_per_million=2.0,output_per_million=8.0,cached_per_million=0.4)# 200 million tokens: 160M input (80M of which hit the cache), 40M outputtotal = estimate_cost(input_tokens=160_000_000,output_tokens=40_000_000,cached_tokens=80_000_000,price=demo_price)print(f"Estimated cost: {total} CNY")
With the assumptions in the example, the 80 million tokens of uncached input cost 160 CNY; the 80 million tokens that hit the cache cost 32 CNY; the 40 million output tokens cost 320 CNY, for a total of 512 CNY. For the same 200 million tokens, changes in caching and in the input/output ratio can make the cost differ by several times, which shows why estimation must separate these dimensions.
6. How to Verify a Reported Test Result
When you see someone else’s measured number, check it in this order:
- Whether the model name and version are clearly stated.
- Whether the count covers input plus output, or only one part of it.
- Whether free credits or promotional discounts were active during the test.
- What proportion of the input hit the cache.
- Whether the total token count was actually close to 200 million, or extrapolated proportionally.
If you cannot answer these questions, the number is only a reference sample and is not suitable for direct use in a budget.
7. Practical Recommendations
Measure your real usage first. Log the input, output, and cached token counts for each request in your call logs, and track them continuously for about a week to obtain your workload’s read/write ratio and average daily usage.
Choose models by scenario. Split tasks into simple and complex ones, use low-cost models for simple tasks, and upgrade to stronger models only for complex ones. Tiered routing is usually cheaper than using a single model for everything.
Control context length. Truncate or summarize conversation history, and put only the material relevant to the current question into the prompt.
Set budget alerts. Define usage thresholds by day or month, and notify the responsible person through monitoring alerts when they are exceeded, to avoid abnormal bills caused by runaway loops or retries.
Leave a buffer. Actual usage is often higher than the initial estimate, so reserve a certain percentage of headroom in your budget and refine it with real data after launch.
