Core concepts
Token
Definition
A token is the unit of text an AI model reads and writes — roughly four characters or three-quarters of a word in English. Models price by the token and cap context by the token, so token count determines both what you pay and what fits.
Language models do not see letters or words. Text is first broken into tokens by a tokenizer, and each token is mapped to a number the model can process. Common words are usually a single token; rare words, names and non-English text split into several.
The practical consequences are immediate. Every API bills per million input and output tokens, so a prompt that is twice as long costs twice as much. Every model has a context window measured in tokens, so token count decides whether your document fits at all.
A useful rule of thumb for English: 1 token ≈ 4 characters ≈ 0.75 words. So 1,000 words is roughly 1,350 tokens. Code, JSON and languages that don't use the Latin alphabet tokenize less efficiently — often 2-3x more tokens for the same visible length.
Example
"The cat sat on the mat" is 6 tokens. "Antidisestablishmentarianism" is a single word but around 7 tokens, because the tokenizer splits it into familiar fragments.
Related terms
Context window
The context window is the maximum number of tokens a model can consider at once — your prompt, any attached documents, the conversation history, and the response it generates. Exceed it and the earliest content gets dropped.
Tokenizer
A tokenizer is the component that splits text into tokens before a model processes it. Different model families use different tokenizers, which is why the same text can have different token counts on GPT versus Claude.
Temperature
Temperature controls how random a model's word choices are. Low values (0-0.3) make output focused and repeatable; high values (0.8-1.2) make it more varied and creative but less reliable.
Inference cost
Inference cost is what you pay to run a model on a request, almost always billed per million input and output tokens. Output tokens typically cost three to five times more than input tokens.
Prompt
A prompt is the input you give an AI model to produce an output. Effective prompts specify five things: the role the model should adopt, relevant context, the specific task, the output format, and any constraints.
Prompt engineering
Prompt engineering is the practice of designing model inputs that reliably produce the output you want. It combines clear instruction-writing, structured formatting, worked examples, and systematic testing.
Put this into practice
Understanding the term is step one. Our free courses and tools let you actually use it.