Context Window
The maximum number of tokens an LLM can process in a single inference call, including both input (prompt, context, history) and output (generated response).
The context window is the LLM's working memory. Everything the model processes in a single inference call (your system prompt, conversation history, retrieved documents, tool outputs and the response it generates) must fit within this limit.
Input vs output tokens
Context window size usually refers to the total token budget, and both input and output count against it. Output is also capped separately. GPT-6 Luna, for example, has a 1.05M-token window, a 922K-token input cap and a 128K-token output cap, so a very long prompt plus a long answer must fit all three limits.
How models handle long contexts
At inference time, models use the KV cache to avoid recomputing earlier tokens at every step. Even so, longer contexts cost more (APIs bill per token) and run slower. Some models also recall information in the middle of a very long context less reliably than information near the start or end, an effect known as "lost in the middle".
Current context window sizes
One million tokens has become the standard for frontier and even budget models in 2026:
- Claude Opus 5.5 and Claude Haiku 5.5: 1M tokens
- GPT-6 Astra and GPT-6 Luna: 1.05M tokens, with up to 922K input and 128K output
- Gemini 4 Argon: 1M tokens shared between input, thinking and output; output is capped at 65K tokens by default and can use the full window with long decode
- Open-weight models such as Mistral Large 4 and DeepSeek V4 Flash: 1M tokens
- Smaller open models for local use: Gemma 4 offers 128K tokens on its E2B and E4B models and 256K on the larger ones, including Gemma 4 12B
Long-context pricing differs by provider. Claude Haiku 5.5 charges five times more per input token once a prompt exceeds 100K tokens, and GPT-6 Astra and GPT-6 Luna bill the whole request at twice the input rate and 1.5 times the output rate above 272K input tokens. Claude Opus 5.5, by contrast, charges the same per-token rate across its full 1M window. See our model index for every model's limits.
Practical implications
Larger context windows don't remove the need for RAG (Retrieval-Augmented Generation). Putting an entire knowledge base into every prompt is expensive and can lower answer quality. Retrieving only the relevant pieces and assembling them into a focused prompt is often cheaper and more accurate. Very long contexts (above 100K tokens) are most useful for tasks like codebase Q&A, long document analysis and keeping long conversation histories.
Related terms
Models relevant to Context Window
Claude Opus 5.5
Anthropic's current Opus and its recommended starting model, priced at $4/$20 per 1M tokens
View model →GPT-6 Luna
OpenAI's cheapest GPT-6 model, and since October 2026 the default for free ChatGPT users
View model →Gemini 4 Argon
Google's frontier model for real-world coding, enterprise knowledge work, and cybersecurity defense
View model →