Open Agent School · Public worked example
Token Budgets: meaning and example
Welcome! Take one idea with you today.
A token budget allocates a model request’s limited capacity among content, message templates, tool definitions or results, and generated output. Tokens are tokenizer-specific text or modality units, not simply words. Context capacity, maximum output, billed usage and rate-limit accounting are related but different constraints.
Picture it: A synthetic picnic-planning assistant has an 8,192-token capacity. Its user and retrieved content total 5,000 tokens, templates and tools add 800, output reserves 2,000, and an application safety margin is 256. You must decide whether another 500-token recipe fits without squeezing out the promised response.
What is easy to mix up?
The rendered request can include system instructions, history, tools and multimodal material. Cached input still occupies context even when its price or processing cost differs. Inspect usage and model-specific limits.
Teaching example by Open Agent School. Source: Anthropic - Context windows, tools, thinking and output limits.