- Glossary
- Token counting
Glossary term
Token counting
Measuring how many tokens a request will use before sending it, for example with a token-counting endpoint.
Also called count tokens, count_tokens.
Open lesson 3.3
Estimating tokens for text, code and images · Chapter 3, and 3 more lessons below
In plain words
Use it to check a request fits in the context window and to estimate cost, rather than guessing from character counts.
Taught in
Also in these lessons
Autoregressive generationByte-pair encoding (BPE)Cache hitInput tokensLarge language model (LLM)max_tokensMessages APINext-token predictionParametersPDF supportStop reasonStop sequence