What are tokens, and why do AI tools charge by them?
If you've looked at AI pricing or usage limits, you've seen the word tokens. They're the units models read and write in.
What a token is
Models don't see words the way we do. Text is split into chunks called tokens. In English, a token is often part of a word: common words may be one token, longer or rarer words may be several. Punctuation and spaces count too. Other languages and code can split differently, sometimes into more tokens for the same meaning.
Why pricing uses tokens
The work a model does scales with how many tokens it processes. So providers typically charge for:
- Input tokens: everything you send, including instructions, documents and conversation history
- Output tokens: what the model writes back, usually priced higher than input
Why agents use so many
An agent re-sends context on each step: the instructions, previous steps, tool results. A ten-step task can process the same text many times over. Large tool outputs, like a whole web page, add up quickly.
Ways to use fewer
- Keep instructions concise.
- Send relevant excerpts instead of whole documents.
- Start fresh conversations for unrelated tasks.
- Use smaller, cheaper models for simple steps.
Did tokens confuse you when you first saw them? Have you ever been surprised by how fast an agent burned through a usage limit?
Comments · 4
A token is often a chunk of a word, and common words may be one token while rare words are split into pieces. A rule of thumb for English is around three-quarters of a word per token.
Shorter prompts cost less, so trimming pasted text helps if you're watching your usage. Remember that output tokens are counted too.
Why do other languages use more tokens for the same text? Is it about how the tokenizer was trained?
Largely yes. Tokenizers are trained mostly on certain languages, so text in others gets split into more, smaller pieces and costs more tokens for the same meaning.