Category · Models and how they work
What is a token?
A token is a unit of text, often a piece of a word, that the model reads and produces. Billing, quotas and limits are all counted in tokens. French generally uses a little more of them than English.
By Laurent Poupet, Claude trainer and artificial intelligence architect · Updated
How it works
- How text is split into tokens depends on the model; the same text does not count the same number of tokens from one model to another, which changes the cost.
- French generally uses a few more tokens than English for the same content, because tokenizers were designed mostly on English text.
- They are counted before sending with the provider’s tokenizer library, to reject in advance a request that would exceed the context limit.
The trap to avoid
The trap is forgetting the invisible tokens; the system prompt, the tool descriptions and the history are billed on every call, not just the question.
Related terms
- InferenceModels and how they work
- Structured outputModels and how they work
- TransformerModels and how they work
- Context windowModels and how they work
- PromptModels and how they work
Where this is taught
Track 4 · Programming with Claude and going live
Messages API (application programming interface) and Choosing Your Modellesson 2 · 1 hour
Lesson content (step-by-step instructions, exercises with solutions, quizzes) is for students only, with an access code received after the first lesson.