A 📝Token is the basic unit of text a 📝Large Language Model (LLM) reads and writes, typically a word fragment of a few characters, and the unit by which model context, speed, and cost are measured.
Before a model processes text, a tokenizer splits it into tokens drawn from a fixed vocabulary. Common words often map to a single token, while rare words, code, and non-English text split into several. A rough rule for English is that 100 tokens equal about 75 words, though the ratio varies by model and tokenizer.
Tokens set both the limits and the price of model use. A model's 📝context window is measured in tokens and must hold the prompt, attached files, tool definitions, and the response. Providers bill input and output tokens separately, with output usually costing several times more, and every 📝Application Programming Interface (API) call reports both counts.
Token budgets shape most agent design decisions. Long system prompts, large tool schemas, and verbose memory files consume tokens on every turn, which is why practices such as prompt caching, model routing, and progressive disclosure exist. 📝Token Optimization covers the discipline of managing that spend, and 📝Token Inflation describes tokens a harness adds that the user never sees.
