AI agent glossary
Token
The unit of text a language model reads and writes, usually a word or part of a word, and the basis for context limits and pricing.
Models do not see letters or whole words. They break text into tokens, which are common chunks of characters. A short common word might be one token, while a long or unusual word might be several. Code, numbers, and non-English text often use more tokens than you might expect.
Tokens matter for three practical reasons. Context windows are measured in tokens. API pricing is charged per token, with output tokens usually costing more than input tokens. And the more tokens a model reads and writes, the longer a response takes.
For agents, token use adds up quickly, because each turn of the loop resends the growing conversation. Watching token counts is one of the simplest ways to control cost.
An agent that pastes a whole 5,000-line log into its context each turn burns far more tokens than one that searches the log and keeps only the matching lines.
Learn more in the course
Related terms
Go from definitions to doing
Learn to use and build AI agents in 65 practical lessons.