What is a token? How LLM APIs bill you
A token is the unit a model reads and writes in, and the unit LLM APIs bill by. How tokens map to words, what counts as input and output, and what one request and one month cost at live prices.
A token is the smallest unit a large language model reads and writes, and the unit LLM APIs bill by. In English one token is about 4 characters or 0.75 words; for Chinese it depends on the model, with common characters around one token each. Prices are usually quoted per million tokens, with input and output priced separately.
Tokens versus words
Models do not read characters directly. A tokenizer first splits text into tokens: common words become one token, rare words are split into several pieces. Token counts track text length, but there is no fixed ratio:
| Text | Rough conversion |
|---|---|
| English | 1 token ≈ 4 characters; 1,000 tokens ≈ 750 words |
| Chinese | Common characters ≈ 1 token each; rare characters and symbols take more |
| Code, JSON | Lots of symbols, so usually more tokens than prose of the same length |
The same text produces different token counts on different models because each vendor has its own tokenizer. Use the table for a first budget, then check real usage numbers once you are live.
Input tokens and output tokens
A request's cost has two parts:
- Input tokens: everything you send — the system prompt, chat history, retrieved documents, tool (function) definitions and images converted to tokens.
- Output tokens: everything the model generates. A reasoning model's thinking counts as output too, so output can be large even when the final answer is short.
Output usually costs several times as much as input. Live prices for a few common models in their cheapest groups:
| Model | Vendor | Cheapest group | Input ¥/1M | Output ¥/1M | Per request ¥ |
|---|---|---|---|---|---|
| deepseek-v4.1-flash | DeepSeek | China Models | ¥2.8 | ¥11.2 | — |
| gpt-5.4-mini | OpenAI | Standard | ¥1.5 | ¥9 | — |
| Claude Sonnet 5.5 | Anthropic | Claude Lite | ¥3.2 | ¥16 | — |
| gemini-3.8-flash | Standard | ¥1.5 | ¥7.5 | — |
Prices in CNY, cheapest group for each model; updated Nov 12, 2026, 8:17 PM.
What one request costs
For token-billed models, the cost of a request is:
cost = input tokens ÷ 1,000,000 × input price + output tokens ÷ 1,000,000 × output priceTake a support chat turn: about 2,000 tokens of system prompt and history, and a 500-token answer. With deepseek-v4.1-flash:
Cost estimate · deepseek-v4.1-flash (China Models)
- Unit price
- input ¥2.8 / output ¥11.2 (per 1M tokens)
- Usage per request
- 2,000 input tokens, 500 output tokens
- Requests
- 1
- Cost per request
- ¥0.0112
Total about ¥0.0112Prices in CNY, cheapest group for each model; updated Nov 12, 2026, 8:17 PM.
The same turn 100,000 times a month:
Cost estimate · deepseek-v4.1-flash (China Models)
- Unit price
- input ¥2.8 / output ¥11.2 (per 1M tokens)
- Usage per request
- 2,000 input tokens, 500 output tokens
- Requests
- 100,000
- Cost per request
- ¥0.0112
Total about ¥1,120Prices in CNY, cheapest group for each model; updated Nov 12, 2026, 8:17 PM.
For another model, swap in its prices. Every model's price in every group is on Models and pricing.
Context length is counted in tokens too
Each model has a context limit: the maximum number of input plus output tokens in one request. Go over it and the request fails or the answer is cut off (finish_reason is length). In long conversations the history keeps taking up input tokens, which costs money and crowds the context, so trim it or summarize it regularly.
How to see real usage
- Every response returns this request's input and output tokens in
usage; in Chat Completions they areprompt_tokensandcompletion_tokens. - The Usage page in the console lists model, tokens and cost for every request, and you can export it.
- To estimate before sending, use the vendor's tokenizer tool — but
usageis what you are billed on.
Ways to use fewer tokens
- Trim the system prompt: remove repeated instructions and examples.
- Keep only the last few turns of a conversation and summarize the rest.
- Cap answer length with
max_tokensormax_completion_tokens. - Put long, unchanging prefixes (system prompt, product docs) behind context caching so the cached part is billed at a lower price — see What context caching is and how it saves money.
- Use a small, cheap model for simple tasks and a large one only where needed — see How to choose a model for your use case.
FAQ
How many tokens is one word?
In English, about 0.75 words per token, or roughly 4 characters per token. Chinese depends on the model's tokenizer; common characters are usually around one token each on newer models. Estimate with these ratios, then calibrate with the usage field your requests return.
How are images and files counted?
Vision models convert an image into a number of input tokens that depends on its size, and each vendor converts differently. Billing follows the usage field in the response and the Usage page in the console.
Why do output tokens cost more than input tokens?
Input is processed in parallel, but output has to be generated one token at a time, which costs more compute. That is why output prices are usually several times input prices. Keeping answers short usually saves more than trimming the prompt.
Where can I see how many tokens a request used?
Every response returns input and output tokens in its usage field, and the Usage page in the console lists tokens and cost for each request.