Basics
Context window
A context window is the most tokens a language model can work with in one request: the prompt, the conversation so far and the answer it writes. Text beyond it can't be sent in that request.
Also called Context length, Context size
Checked November 29, 2026
At a glance
- Measured in
- Tokens
- Holds
- The prompt, the conversation so far and the answer, reasoning included
- Claude models
- Up to 1M tokens, depending on the model (Anthropic)
- Bigger isn't always better
- Accuracy and recall degrade as the count grows (Anthropic)
- On /model
context_lengthper model inGET /v1/models; too long a prompt gets 400context_length_exceeded
Anthropic calls it the model's working memory, as opposed to the data it was trained on: all the text the model can refer to while it answers, the answer included, up to 1M tokens depending on the model. A bigger window isn't automatically better: as the token count grows, accuracy and recall degrade (Anthropic).
What counts toward it
- Everything you send: the system prompt, every message so far, tool definitions, images and documents.
- The answer the model writes, reasoning included. Reasoning tokens aren't visible, but they take up space in the context window (OpenAI).
- Cached input. Reading part of the prompt from a cache makes it cheaper, not smaller.
Past the limit
At Anthropic, a prompt that alone is longer than the window gets a 400 error, "prompt is too long". On Claude 4.5 models and newer, a request whose prompt plus max_tokens exceeds the window is accepted, and if the answer reaches the limit it stops with stop_reason model_context_window_exceeded (Anthropic).
Long-prompt prices
Some models charge more per token once a prompt passes a length. At Anthropic, Claude 4.6 and later models have their full 1M-token window at standard prices, except Claude Haiku 5.5, which charges more for prompts over 100,000 tokens, cache reads and writes included (Anthropic).
Context windows on /model
Each model's context_length and max_output_tokens are in GET /v1/models, which needs no key, and on its model page, such as Claude Opus 5.5. A prompt that doesn't fit is refused with a 400 context_length_exceeded: shorten the conversation, or pick a model with a larger context_length (Errors).
Where it applies on /model
Questions
Does the answer count toward the context window?
Yes. The window holds the prompt and the answer together, reasoning included, so a prompt that nearly fills it leaves little room for a reply.
What happens when a conversation outgrows the window?
The request is refused until the conversation is shorter. Apps make room by dropping or summarizing the oldest turns.
Where do I see a model's context window on /model?
In GET /v1/models, as context_length, and on each model's page, such as GPT-6.1 Sol.
Sources
The makers' own pages, each opened on November 29, 2026.