What are LLM tokens?
LLM tokens are the basic unit of work for a large language model. Before a model processes a prompt, a tokenizer splits the text into pieces from a fixed vocabulary. Common words often become a single token, while rarer words are split into several, and spaces and punctuation are part of tokens too. The model then predicts its response one token at a time.
Because tokens are what the model actually handles, they are also how AI is measured and priced. A provider's limits on how much text a model can consider at once, called the context window, are expressed in tokens. So is the bill: usage is charged per token, usually quoted per million tokens, with separate rates for input and output.
The common rule of thumb for English text is that one token is about four characters, so 100 tokens is roughly 75 words. The ratio varies with language, code and formatting, and each model family uses its own tokenizer, so the same text can produce different token counts on different models.
Why do LLM tokens matter?
LLM tokens matter because they connect what people do with AI to what it costs and what it can handle.
- Cost: spend equals tokens multiplied by each model's price per token, so token volume and model choice drive the bill.
- Capacity: the context window caps how much conversation, code or documentation a model can work with at once.
- Speed: generating more output tokens takes longer, so verbose responses are slower as well as costlier.
- Rate limits: providers often limit tokens per minute as well as requests per minute.
How do LLM tokens work?
LLM tokens work through tokenization on the way in, generation on the way out and metering on every call.
Input tokens
Everything sent to the model counts as input: the user's prompt, system instructions, conversation history, attached files and the descriptions of any tools the model can use. In a long conversation, earlier turns are typically resent with each new message, so input grows as the conversation continues.
Output tokens
Everything the model generates counts as output. Major providers generally price output tokens higher than input tokens.
Reasoning tokens
Some models produce internal reasoning before answering. Those tokens are typically billed as output even when they are not all shown to the user, which is one reason harder tasks cost more.
Cached tokens
Some providers discount input that repeats a previously processed prefix, such as a long system prompt, through prompt caching.
Metering
Each API response reports the tokens used. Gateways and platforms read those counts, apply each model's price and deduct the cost from a budget.
LLM tokens vs words and characters
Tokens are not the same as words or characters, and estimating cost from word counts is only an approximation.
- Unit: a word may be one token or several; a token may be part of a word, a space plus a word, or punctuation.
- Language: many non-English languages and scripts use more tokens for the same meaning.
- Code and data: source code, JSON and logs often tokenize less efficiently than prose.
- Model dependence: different tokenizers produce different counts for identical text.
Why do AI agents use so many tokens?
AI agents use many tokens because they work in loops. An AI coding agent may read files, call tools, inspect results and try again, and each step is a model call that resends growing context and generates new output. Two people doing the same task can therefore consume very different amounts: one writes a precise instruction and finishes in a few steps, another iterates, changes direction and asks the agent to retry. An agent that misreads its goal can keep going until a limit stops it.
Common situations where token counts matter
- Budgeting a course: estimating what a lab exercise costs per learner on a given model.
- Choosing a model: comparing price per token against the quality the task needs.
- Designing prompts: trimming instructions and history to reduce repeated input.
- Working with large documents: checking that material fits within the context window.
- Comparing cohorts: explaining why one group's AI usage differed from another's on the same exercise.
- Setting rate limits: sizing tokens-per-minute limits so a whole class can work at once.
Best practices for managing token usage
- Measure real token usage by running the exercise yourself rather than estimating from word counts.
- Restrict models where possible; price per token varies far more between models than usage does between careful users.
- Cap spend per user, since token consumption is hard to predict per person.
- Keep system prompts and tool descriptions concise, because they are resent on every call.
- Teach learners to give clear, specific instructions; it saves tokens as well as time.
How Heropa helps
You do not need to count tokens to keep AI in labs under control. Heropa's AI Lab Keys let you set a budget, allowed models and duration for each key, one key per user. Usage for every environment updates in Heropa in real time, learners see their remaining AI budget as they progress, and when a key's cap is hit AI usage stops while the environment carries on. That turns unpredictable token consumption into a fixed per-seat AI budget, a core part of AI spend management.
For more on why tokens behave differently from other lab costs, read 3 reasons why implementing AI in virtual labs is challenging.
Frequently asked questions
How many words is 1,000 tokens?
For typical English text, about 750 words, using the rule of thumb that one token is roughly four characters or three quarters of a word. Code, data formats and many other languages use more tokens per word, and different models' tokenizers give different counts.
Why are output tokens more expensive than input tokens?
Generating output requires the model to produce tokens one at a time, which uses more compute per token than reading input that can be processed in parallel. Major providers reflect this by pricing output tokens higher than input tokens.
What is a context window in tokens?
The context window is the maximum number of tokens a model can consider in a single request, covering instructions, conversation history, attached content and its own response. Content beyond the limit must be shortened, summarized or left out.
How do I estimate token costs for an AI training lab?
Run the exercise yourself on the intended model, including a less efficient beginner-style attempt, and read the token usage or cost reported. Multiply by the number of learners and add headroom. Then cap each learner with a per-seat budget so estimates cannot be exceeded.