What is an AI token?
Updated
An AI token is the unit of text a language model reads and writes: a whole word, part of a word, a punctuation mark or a few bytes, depending on the model's tokenizer.
Models never see letters or words. Before a request reaches the model, a tokenizer turns the text into a list of token IDs, and the model writes its answer back as token IDs. That is why API prices, context windows, rate limits and speeds are all counted in tokens.
How text becomes tokens
Most modern models use subword tokenization. Common words stay whole, and rare words split into smaller pieces the model already knows. The Hugging Face tokenizer guide gives the example annoyingly, which a tokenizer may split into annoying and ly.
The most common method is byte pair encoding (BPE). It starts from single characters or bytes and repeatedly merges the pair that appears most often in its training text, until the vocabulary reaches a target size. Byte-level BPE starts from the 256 possible byte values, so it can encode any text, including emoji and code, without an unknown token.
Each model family trains its own tokenizer, so the same sentence can be a different number of tokens on two models. The count your API response reports is the one you pay for.
How much text is one token
Model makers publish rules of thumb. They are averages for ordinary prose. Code, numbers, URLs and languages other than English usually take more tokens per character.
Turned around, 1M tokens of English prose is about 750,000 words, or about 3.3M characters. A 300-page novel of about 90,000 words is about 120,000 tokens.
Input, output and reasoning tokens
- Input tokens (prompt tokens) are everything you send: the system prompt, the conversation so far, tool definitions, files and images. Images are converted to tokens too.
- Output tokens (completion tokens) are everything the model writes back, including tool calls.
- Reasoning tokens are the model's thinking before it answers. They are output tokens: you pay for them at the output price even when your app does not show them.
- Cached input tokens are input tokens the provider has already processed in an earlier request with the same prefix. They cost less. See how prompt caching works.
Every response reports these counts. In the Chat Completions format they are usage.prompt_tokens, usage.completion_tokens, usage.prompt_tokens_details.cached_tokens and usage.completion_tokens_details.reasoning_tokens.
Why tokens matter
| Model | Context window | Max output | Input / 1M | Output / 1M |
|---|---|---|---|---|
| DeepSeek V4.1 Flash | 1,048,568 tokens | 384,000 tokens | $0.06 | $0.24 |
| GLM 5.3 Flash | 1,048,576 tokens | 131,072 tokens | $0.12 | $0.40 |
- Cost: you pay per token, with separate prices for input, cached input and output.
- Context: the context window is a token budget for the prompt plus the answer.
- Speed: output speed is measured in tokens per second. See tokens per second and time to first token.
Questions
How many words is 1,000 tokens?
About 750 English words, using the rule of thumb that 100 tokens is about 75 words. Code and other languages give fewer words per token.
Are tokens the same on every model?
No. Each model family has its own tokenizer, so the same text can produce a different token count. The usage field in each API response gives the exact count you are billed for.
Do reasoning tokens cost money?
Yes. Reasoning tokens are output tokens and are billed at the output price, even when they are not shown in the answer.