How text becomes tokens
Before a model reads your prompt, a tokenizer splits it into tokens and turns each one into a number. A common word like "the" is usually a single token. A rarer or longer word, such as "tokenization", may be split into several pieces. Numbers, code and non-English text often take more tokens than you'd expect for their length.
Each model family has its own tokenizer, so the same sentence can come out as a different number of tokens on different models.
Why tokens matter
Tokens decide two practical things:
- Cost. You pay for the tokens you send and the tokens you get back. On luv13 the price is a flat $0.33 per 1 million tokens on every model, with input and output at the same rate. See Pricing.
- Length. Every model has a maximum number of tokens it can handle in one request, counting both your prompt and its reply. See Context Window.
Seeing your token count
An OpenAI-compatible API reports tokens in the usage field of each response:
"usage": {
"prompt_tokens": 12,
"completion_tokens": 30,
"total_tokens": 42
}The numbers above are an example. prompt_tokens is what you sent, completion_tokens is what the model wrote, and total_tokens is the two added together. See Input vs. Output Tokens for more.
