Tokens and billing
Models meter input and output in tokens. Knowing how tokens are counted helps you predict cost more accurately.
What is a token?
A token is the smallest unit a model reads or writes. Your text is split into tokens by the model's tokenizer, and you're billed by the token count.
Tokenizers differ between vendors and model generations, so the same text can produce noticeably different counts on different models. The usage field returned by the API is the exact number.
Rough conversions for English and Chinese
These rules of thumb are for rough estimates only; actual counts depend on the model's tokenizer. Code, numbers, rare characters and emoji usually take more tokens.
| Content | Approx. tokens |
|---|---|
| 1 English word | about 1.3 |
| 1,000 English characters | about 250 |
| 1 Chinese character | about 0.6 – 1.5, tokenizer-dependent |
| 1,000 Chinese characters | about 600 – 1,500 |
How input, output and cache are billed
For token-billed models, the cost of a request is the sum of the parts below; every price is quoted per million tokens:
- Input (prompt tokens): system prompt, earlier messages, tool definitions and file contents all count as input, billed at the input price.
- Output (completion tokens): what the model generates, billed at the output price — usually several times the input price.
- Cache reads: input tokens served from the context cache are billed at the cache-read price, typically a small fraction of the input price.
- Cache writes: some models (such as Claude) charge a cache-write price the first time content is written to the cache.
- Per-call models (common for images and video) charge a fixed price per request, regardless of tokens.
Cost = input × input price + output × output price + cache reads × cache-read price + cache writes × cache-write price
Example with this model's “China Models” group: a request with 2,000 input tokens and 500 output tokens costs about ¥0.0037 (input ¥0.00246, output ¥0.00123).
Reasoning tokens count as output
Reasoning (thinking) models produce internal reasoning before the answer. Those tokens may not be returned to you, but they count as output (reasoning tokens in usage) and are billed at the output price.
So the same question usually costs more output tokens on a reasoning model. For tasks that don't need deep reasoning, lower the reasoning effort or use a non-reasoning model.
Images and audio are converted to tokens too
Multimodal models convert images into input tokens based on resolution — larger images and higher detail settings cost more — and audio is usually converted by duration. The exact conversion varies by model; check the usage field.
Where to see what each call cost
In the console, Usage lists every call with its model, group, input / output / cache token counts and the amount charged, with filters and export.
In code, the usage field in each response gives the token counts; for streaming requests, turn on include_usage.
Ways to spend less
- Pick the right group: the same model costs different amounts in different groups — the Pricing tab ranks them by cost, balance or reliability.
- Use the cache: put stable system prompts and reference documents at the start of your messages to raise cache hits.
- Limit output: set max_tokens and ask for concise output formats.
- Trim context: summarize long conversations instead of resending the full history every turn.
- Mix model sizes: send simple classification or extraction to cheaper models and save flagship models for hard tasks.
- Lower the reasoning effort on reasoning models when you can.