What is inference in AI?
Using a trained model to produce an answer. Training builds the model once; inference is every time someone asks it something, and it is what you pay for per token.
beginner · Also called Serving
A model has 2 lives. In the first it is trained: its billions of numbers are adjusted, again and again, until it predicts text well. That happens once, or once per version, and costs the maker a great deal. In the second it is used. Every question anyone sends it is a fresh run of the finished model. That second life is called inference.
During inference the model's numbers do not change. It takes your text, works through it, and produces a reply. Nothing you type teaches it anything new.
Why it is slow at the end and fast at the start
A language model reads your whole prompt in one go, but it writes its answer one TokenTokenThe small piece of text a language model reads and writes, often part of a word. Prices, limits and the context window are all counted in tokens. at a time, and each new token depends on everything before it. That is why a reply arrives as a stream of words. 2 numbers describe the wait. Time to first token is how long until the first word appears. Latency is the time until the whole answer is done. A bigger model, a busier server and a longer prompt all push both up.
Why it is what you pay for
When you use a model through an API, you pay per token of inference: one price for the tokens you send and a higher one for the tokens it writes. On Claude Opus 5.5 that is 4 dollars per million tokens in and 20 dollars per million out. Training costs are the maker's problem. Inference costs are yours.
How providers make it cheaper
Most of the engineering around serving models is about doing inference faster and with less memory.
- A KV cacheKV CacheWork a model saves from the text it has already read, so it is not redone for every new token. Prompt caching keeps that work between requests and charges less for it. keeps work from earlier tokens so it is not repeated for every new one.
- QuantizationQuantizationStoring a model's numbers with less precision, such as 4 bits instead of 16, so it needs far less memory and can run on smaller hardware, at some cost in accuracy. stores the model's numbers with less precision, so it fits on smaller hardware.
- Prompt caching lets a provider reuse the processing of a long prompt you send again and again, and charge you less for it.
When you see "inference" in a price list, a job advert or a chip maker's pitch, it means this second life: the model at work, answering.
Sources
Where each fact comes from
This page was last checked against these sources on 14 October 2026.
- 1How ChatGPT and our foundation models are developed
OpenAI Help Center · 25 September 2026
In training the model's parameters are adjusted slightly over millions of sentences. A model is a large set of numbers called weights or parameters.
- 2How caching works
Hugging Face, Transformers documentation · 14 October 2026
Generation is slow because the model predicts one token at a time and each prediction depends on all the previous context. A key-value cache should only be used for inference.
- 3Glossary
Anthropic, Claude API documentation · 14 October 2026
Latency is the delay between submitting a prompt and receiving the output. Time to first token measures how long the model takes to produce the first token of its output. Model size, hardware, network conditions and the length of the prompt and response affect both.
- 4Pricing
Anthropic, Claude API documentation · 25 September 2026
Opus 5.5 costs 4 dollars per million input tokens and 20 dollars per million output tokens.
- 5Prompt caching
Anthropic, Claude API documentation · 14 October 2026
Prompt caching reduces processing time and costs for prompts with repeated content. Cache reads are priced at a fraction of the base input price.
- 6Quantization overview
Hugging Face, Transformers documentation · 14 October 2026
Quantization lowers the memory needed to load and use a model by storing the weights in a lower precision while trying to keep as much accuracy as possible.