Home › Learn › AI Agents
AI Agents

What is Tokens?

The chunks of text a model reads and writes — roughly 3/4 of a word each — and the unit you're billed and rate-limited by.

How it works

Models don't see characters or words; they see tokens. Your prompt, the history, and the output all consume tokens, and the context window is measured in them. Understanding tokens is how you reason about cost and limits.

Example

In practiceA 1,000-word article is roughly 1,300 tokens; that plus your instructions has to fit under the context window on every call.

Why does cost spike on long tasks?

Every loop iteration resends the full history, so tokens compound. Cap iterations and keep tool results tight.

Go deeper: Deploy Your First AI Agent

The complete, step-by-step guide — every command, config, and the reasoning behind it.

Get the guide