Skip to content
Best AI Ever

AI guides

Context windows explained: limits, long-context pricing and recall

A context window caps how many tokens a model can handle in one request, prompt and answer included. This guide explains input versus output limits, long-context price tiers, why recall drops in long prompts, and the ranges across current models.

By Updated

In short

  • A context window is the total number of tokens a model can work with in one request: your prompt, everything attached to it, and the answer it writes.
  • The maximum output is a second limit, usually much smaller. As of October 2026 it ranges from 4,000 to 1,048,576 tokens among the models in our catalog that publish one (the top figure needs Gemini 4 Argon's long-decode mode).
  • Most current flagship models accept around one million tokens, but several providers charge more per token once a prompt passes a threshold between 100K and 272K tokens.
  • A large window is a ceiling, not a guarantee: recall gets less reliable as prompts grow, so what you put in matters as much as how much fits.

What a context window is

A language model does not remember earlier requests. Each time you call it, it sees one block of tokens and generates a response from that block alone. The context window is the maximum size of that block. Anthropic describes it as the model's "working memory": all the text the model can reference while generating, including the response itself [1]. It is separate from the training data: what a model learned during training takes up no space in the window.

What counts toward the window is broader than the question you type. Anthropic's documentation lists the system prompt, every message in the conversation (including tool results, images and documents), the tool definitions, and the output generated for the turn, including any extended thinking [1]. In a chat or an agent, the window fills up turn by turn, because each request resends the conversation so far.

Context windows are measured in tokens, not words or pages. Token counts depend on the tokenizer and the language, so treat any conversion as rough. As one orientation point, Google estimates that one million tokens corresponds to about 50,000 lines of code at 80 characters per line, or eight average-length English novels [2].

Input limit and maximum output

Model pages usually show two numbers: the context window and the maximum output. They are not independent, and providers describe them in different ways:

  • One shared window (Anthropic). Input and output share one budget. The current Claude models have a 1M-token context window, and a single request can generate up to 128K output tokens. If the input alone exceeds the window, the API rejects the request; on Claude 4.5 and newer models, a request whose input plus max_tokens exceeds the window is accepted, and generation stops when it reaches the limit [1].
  • A window with a separate input cap (OpenAI). GPT-6 Sol lists a 1,050,000-token context window, a maximum of 922,000 input tokens and 128,000 output tokens [3]. The two caps add up to the window, so the space reserved for output cannot be used for input.
  • Separate input and output limits (Google). Gemini 3.x model pages list an input token limit and an output token limit; for Gemini 3.8 Flash these are 1,048,576 and 65,536 tokens [4].
  • Context length plus maximum output (DeepSeek). DeepSeek lists a 1M context length and a maximum output of 384K for V4 Pro and V4.1 Flash [5].

On reasoning models, the hidden reasoning also uses up output. Anthropic counts thinking tokens as part of max_tokens and bills them as output [1], and Google's output prices for Gemini models include thinking tokens [6]. A task that needs long reasoning and a long answer can hit the output limit while the input side is far from full.

For many tasks, the input limit is the number that matters: you send a lot and get a short answer back. The maximum output becomes the binding constraint when the answer itself is long, such as rewriting a long document, translating a contract or generating many files of code. As of October 2026, among the catalog models that publish a limit, the maximum output ranges from 4,000 tokens (Cohere Command R7B and Command R) to 1,048,576 tokens (Gemini 4 Argon, which shares one 1,048,576-token window between input and output and caps a synchronous response at 65,536 tokens; longer answers need its background long-decode mode) [7]. The next highest limit is 393,216 tokens (DeepSeek V4 Pro and V4.1 Flash).

Attribute Claude Sonnet 5.5Anthropic GPT-6 SolOpenAI Gemini 3.8 FlashGoogle DeepSeek-V4-ProDeepSeek
Pricing
Input tokensbase tier $2.00 per 1M tokens $2.00 per 1M tokens tiered $0.75 per 1M tokens $1.32 per 1M tokens
Cached input tokensbase tier $0.10 per 1M tokens $0.20 per 1M tokens tiered $0.075 per 1M tokens $0.044 per 1M tokens
Cache writesbase tier $2.50 per 1M tokens $2.50 per 1M tokens tiered No data No data
Cache writes (1-hour retention)base tier $4.00 per 1M tokens No data No data No data
Cache storagebase tier No data No data $0.50 per 1M tokens per hour No data
Output tokensbase tier $10.00 per 1M tokens $10.00 per 1M tokens tiered $3.75 per 1M tokens $3.96 per 1M tokens
Batch input tokensbase tier $1.00 per 1M tokens $1.00 per 1M tokens tiered $0.375 per 1M tokens No data
Batch output tokensbase tier $5.00 per 1M tokens $5.00 per 1M tokens tiered $1.875 per 1M tokens No data
Tool and search requestseach price with what it covers
  • Web search tool on the Claude API: per 1,000 searches, plus standard token costs for search-generated content; a search that ends in an error is not billed: $10.00 per 1,000 requests
  • Web search tool (pricing page, Tools table: all models): per 1,000 calls, plus search content tokens billed at model rates: $10.00 per 1,000 requests
  • Grounding with Google Maps: $14.00 per 1,000 requests Paid tier: 5,000 free requests per month (shared across all Gemini 3 and newer models), then USD 14 per 1,000 search queries
  • Grounding with Google Search: $14.00 per 1,000 requests Paid tier: 5,000 free search requests per month (shared across all Gemini 3 and newer models), then this price; each Google Search query triggered by a request is charged
  • Search / Fetch API: $0.75 per 1,000 requests Separate Search and Fetch API endpoints: per 1,000 successful requests each; failed, empty and timed-out requests are not billed. Calls by server-side tools in DeepSeek Harness, Claude Code or Codex are free until billing starts at 16:00 UTC on 2026-10-31 (00:00 Beijing time, 2026-11-01).
Othereach price with what it covers No data
  • 12-hour cache writes: $5.00 per 1M units 12-hour cache write (prompt_cache_options.ttl "12h", Responses API, added 2026-10-20), billed at 2.5x the uncached input rate; Standard, prompts up to 272K input tokens (pricing page)
  • 12-hour cache writes, > 272K input tokens: $10.00 per 1M units 12-hour cache write, long-context column of the pricing page Standard table (prompts with more than 272K input tokens)
No data
  • Off-peak cached input: $0.022 per 1M units Cache hit. Off-peak rate (half of the peak rate): all hours outside 01:00-04:00 and 06:00-10:00 UTC Monday to Friday, including weekends and Chinese public holidays
  • Off-peak input: $0.66 per 1M units Cache miss. Off-peak rate (half of the peak rate): all hours outside 01:00-04:00 and 06:00-10:00 UTC Monday to Friday, including weekends and Chinese public holidays
  • Off-peak output: $1.98 per 1M units Off-peak rate (half of the peak rate): all hours outside 01:00-04:00 and 06:00-10:00 UTC Monday to Friday, including weekends and Chinese public holidays
Specs
Context window 1,000,000 tokens 1,050,000 tokens 1,048,576 tokens 1,048,576 tokens
Max output 128,000 tokens 128,000 tokens 65,536 tokens 393,216 tokens
License Proprietary Proprietary Proprietary Open source
Release date 2026-09-28 2026-09-22 2026-09-02 2026-08-13
Availability Available Available Available Available
Knowledge cutoff June 2026 April 2026 March 2026 No data
Capabilities
Text input Yes Yes Yes Yes
Image input Yes Yes Yes No
Audio input No No Yes No
Video input No No Yes No
File input Yes Yes Yes No
Text output Yes Yes Yes Yes
Image output No No No Unknown
Audio output No No No Unknown
Reasoning Optional Optional Native Optional
Tool calling Yes Yes Yes Yes
Web search Yes Yes Yes Yes
Benchmarks
AutomationBenchv1.0.6; high effort, higher is better No data 31.2 % 29.68 % No data
AutomationBenchv1.0.6; medium effort, higher is better No data 26.9 % 29.68 % No data
FrontierMath Tiers 1-3 (v2)max effort; Epoch harness (Python tool), higher is better No data 89.8 % No data 64.6 %
Text ArenaOverall, style control on; high effort, higher is better No data No data 1,496 1,465
Best for
Codingrank in "Best AI for coding" #4 of 20 #8 of 20 #10 of 20 No data
Writing No data No data No data No data
Researchrank in "Best AI for research" #4 of 14 No data No data #10 of 14
Reasoningfrom structured data (no ranking mapped)
  • Reasoning: Optional
  • Reasoning: Optional
  • Reasoning: Native
  • Reasoning: Optional
Strengths and weaknesses
Strengths
  • 1M-token context window; 128K max output tokens (up to 300K on the Message Batches API with the output-300k beta header)
  • Comparative latency rated "Fast" at $2 / $10 per million input / output tokens
  • Cache reads at 0.05x base input ($0.10 per million tokens; reduced from $0.20 on 2026-10-07 per the API release notes)
  • Up-front thinking can be turned off with the between_tools setting at high effort or below
  • 1,050,000-token context window (maximum 922,000 input tokens) and 128,000 max output tokens
  • Reasoning can be switched off (none) or raised up to max
  • $2 input / $10 output per 1M tokens (Standard, up to 272K input tokens)
  • Named by OpenAI as the replacement for the deprecated gpt-5.1 and gpt-5.3-codex
  • 1,048,576-token input context and 65,536-token output limit
  • Accepts text, image, video, audio and PDF input
  • Supports function calling, code execution, file search, Google Search and Google Maps grounding, URL context, structured outputs and computer use (preview)
  • Available via Batch, Flex and Priority inference; Batch token prices are 50% of Standard
  • 1M-token context window and up to 384K (393,216) output tokens
  • Thinking mode with low, high and max effort levels, plus JSON output and tool calls
  • Server-side web_search tool in the Responses API (ignored for deepseek-flash)
  • Available through the OpenAI-compatible Chat Completions and Responses APIs and the Anthropic-compatible API
  • Weights published on Hugging Face under the MIT License
Weaknesses
  • Thinking type 'disabled' is rejected; between_tools is the lowest thinking setting
  • Forced tool use (tool_choice any/tool) and non-default temperature/top_p/top_k return a 400 error
  • Thinking blocks work only in the account that produced them or a linked account
  • Its model page refers to GPT-6.1 Sol as the newer Sol model; cached input costs $0.20 per 1M tokens versus $0.10 for GPT-6.1 Sol
  • Function calling in Chat Completions works only with reasoning_effort none
  • No audio or video input; text output only
  • Text output only; no image or audio generation
  • The minimal thinking level is not supported, and Google states the model can use more tokens on longer running and complex tasks
  • Current prices are introductory until 2026-12-31; Standard list prices double from 2027-01-01 ($1.50 input / $7.50 output per 1M tokens)
  • No image input (the pricing page marks Vision as not supported)
  • Higher prices than deepseek-flash ($1.32 per 1M input tokens and $3.96 per 1M output tokens at peak) and a lower concurrency limit (500 vs 2,500)
  • Future availability is uncertain: the 2026-09-10 announcement says DeepSeek is phasing out V4-Pro, while the changelog says its API continues after 2026-09-14 until further notice

"No data" means we have no verified value; it is never an estimate. Benchmarks are compared only within the same setting.

Current ranges across the catalog

As of October 2026, 65 models in our catalog return text and list a context window. Of these, 37 accept roughly one million tokens or more (including some preview models), 17 sit between 200K and 1M, and 11 are below 200K.

  • Around 1M tokens: the current Claude lineup (Fable 5.1, Opus 5.5, Sonnet 5.5 and Haiku 5.5) at 1,000,000; the GPT-6 family at 1,050,000; the Gemini 3.x text models and DeepSeek V4 at 1,048,576; Qwen3.7-Plus and the Qwen3.8 models, Grok 4.20, Grok 4.3, Llama 4 Maverick and Amazon Nova 2 Lite at 1,000,000.
  • 200K to 500K: Grok 4.5, 4.6 and 4.7 at 500,000; Amazon Nova Pro and Nova Lite at 300,000; most Mistral models (Medium 3.5, Small 4, Large 3 and Ministral 3) and Cohere Command A at 256,000.
  • Below 200K: gpt-oss-120b and gpt-oss-20b at 131,072; Amazon Nova Micro and most Cohere Command models at 128,000. The smallest windows belong to two of Google's image models, Nano Banana Pro and Nano Banana 2 Lite, at 65,536.
  • Outlier: Meta's open-weight Llama 4 Scout is listed with a 10M-token context window [8]. With open weights, the context you can use in practice depends on the hardware or hosting service you run the model on.

Two details stand out. First, "1M" is a label rather than a fixed number: the exact limits differ by up to 50,000 tokens between providers. Second, newer is not always larger: Grok 4.7 (released September 2026) lists 500,000 tokens, while Grok 4.20 (March 2026) and Grok 4.3 list 1,000,000 [9]. Check the model pages for the exact figure of the version you plan to use.

Long-context pricing tiers

A bigger window does not always come with the same price per token across the whole window. As of October 2026, the catalog shows two patterns:

  1. Flat pricing across the window. Claude Fable 5.1, Opus 5.5 and Sonnet 5.5 charge the same per-token rate whether a request uses 9K or 900K tokens [10]. Gemini 3.8 Flash, 3.6 Flash and 3.5 Flash-Lite also list a single rate [6], as does Qwen3.8-Max [11]. DeepSeek's V4 models have no length tier either; their rates vary by time of day instead [5].
  2. A threshold that reprices the request. Once the prompt passes a set size, higher rates apply to input, cached input and output.

Thresholds and rates for the second group, as of October 2026 (input / output per million tokens):

  • OpenAI GPT-6 Sol: $2 / $10 up to 272K input tokens, $4 / $15 above. OpenAI states that the higher rates apply "for the full request" [3]; the other GPT-6 models use the same 272K threshold [12].
  • xAI Grok 4.7: $2 / $6 below 200K prompt tokens, $4 / $12 from 200K. Once the prompt reaches the threshold, xAI bills all tokens in the request at the higher rate, and the other Grok text models in the catalog use the same 200K threshold [9].
  • Google Gemini 3.1 Pro (preview): $2 / $12 for prompts up to 200K tokens, $4 / $18 above [6].
  • Alibaba Qwen3.7-Plus: $0.40 / $1.60 up to 256K input tokens, $1.20 / $4.80 above. These are list prices; the pricing page also shows a limited-time discount [11].
  • Anthropic Claude Haiku 5.5: $0.10 / $0.50 for prompts up to 100,000 tokens, $0.50 / $2.50 above. The prompt length counts all input tokens, including cache reads and writes [10].

Because the whole request is repriced, the threshold works like a step rather than a gradual increase. On GPT-6 Sol, a 270,000-token prompt costs $0.54 in input; a 280,000-token prompt costs $1.12, more than double for about 4% more tokens. On Claude Haiku 5.5, going from 99,000 to 101,000 prompt tokens raises the input cost from about $0.0099 to $0.0505, roughly five times as much. If your prompts regularly land just above a threshold, trimming them below it can save more than switching models.

The table below shows current base-tier prices. A "tiered" badge marks models with higher rates for long prompts; each model page lists all tiers.

ModelInput tokensCached input tokensOutput tokens
GPT-6 Sol OpenAI $2.00 per 1M tokens tieredverified 2026-10-25 $0.20 per 1M tokens tieredverified 2026-10-25 $10.00 per 1M tokens tieredverified 2026-10-25
Grok 4.7 xAI $2.00 per 1M tokens tieredverified 2026-10-25 $0.50 per 1M tokens tieredverified 2026-10-25 $6.00 per 1M tokens tieredverified 2026-10-25
Gemini 3.1 Pro Google $2.00 per 1M tokens tieredverified 2026-10-25 $0.20 per 1M tokens tieredverified 2026-10-25 $12.00 per 1M tokens tieredverified 2026-10-25
Qwen3.7-Plus Alibaba Cloud (Qwen) $0.40 per 1M tokens tieredverified 2026-10-25 $0.08 per 1M tokens tieredverified 2026-10-25 $1.60 per 1M tokens tieredverified 2026-10-25
Claude Haiku 5.5 Anthropic $0.10 per 1M tokens tieredverified 2026-10-25 $0.01 per 1M tokens tieredverified 2026-10-25 $0.50 per 1M tokens tieredverified 2026-10-25
Claude Sonnet 5.5 Anthropic $2.00 per 1M tokensverified 2026-10-25 $0.10 per 1M tokensverified 2026-10-25 $10.00 per 1M tokensverified 2026-10-25

Prompt caching lowers the cost of context you resend often, but it does not free up space: cached tokens still occupy the window [1], and on Haiku 5.5 they also count toward the 100K threshold. To estimate costs for long prompts, enter the number of requests in the AI cost calculator along with your token totals: it then picks the price tier from the average request size and leaves out models whose window is too small. The AI pricing overview lists current rates for all models.

Practical limits: what the model actually uses

Fitting a document into the window does not mean the model uses all of it equally well. Anthropic's documentation states that accuracy and recall degrade as the token count grows, which it calls "context rot" [1]. Google notes that models can reach high accuracy when retrieving a single fact from a long context, but not with the same accuracy when several pieces of information must be found, and that performance varies widely with the context [2].

Research points the same way. A 2023 study found that models performed best when the relevant information sat at the beginning or end of a long input, and noticeably worse when it sat in the middle, including models built for long contexts [13]. The RULER benchmark (2024) showed that models scoring almost perfectly on simple "needle in a haystack" tests often dropped sharply on harder tasks as the context grew; of 17 models claiming at least 32K tokens, only about half performed satisfactorily at 32K [14]. Both studies predate the models in today's catalog, so their numbers do not apply directly, but the pattern does: a provider's maximum is a hard limit, not a measure of how well a model reasons over that much text.

Long prompts also cost time. Google notes that longer inputs increase latency, mainly the time to the first token [2]. For interactive use, a very long prompt can feel slow even when its price is acceptable.

Working within the window

The providers' own guidance converges on a few practices:

  • Put long material first and the question last. Anthropic recommends placing long documents above the query and instructions, and reports that queries at the end can improve response quality by up to 30 percent in its tests, especially with complex inputs made of several documents [15]. Google gives the same advice for long prompts [2].
  • Label your documents. When sending several documents, wrap each one in tags with its source and other metadata, and ask the model to quote the relevant passages before it answers [15].
  • Send what the task needs. Anthropic stresses that curating what goes into the context matters as much as the available space [1]. For large collections, searching first and passing only the relevant passages is often cheaper and more reliable than sending everything.
  • Cache the stable part. If many requests share the same long prefix, such as a manual or a codebase, context caching reduces what you pay for it [2].
  • Manage long conversations. Anthropic offers server-side compaction (in beta), which summarizes earlier turns so a conversation can continue past the limit, and context editing to clear old tool results [1].
  • Count before you send. Anthropic points to its token counting API for estimating a request before sending it [1]. Leave headroom for the output as well.

What to check before choosing a model

  1. Your typical and largest prompt, including system prompt, tools and conversation history.
  2. The longest answer you need, compared with the model's maximum output.
  3. Whether that prompt crosses a pricing threshold, and what the full request costs above it.
  4. How well the model handles your material at that length, tested on your own examples.

Use compare to put context windows, output limits and prices side by side. How we collect and verify catalog data is described in our methodology.

Sources

  1. Context windows - Claude Docs
  2. Long context | Gemini API | Google AI for Developers
  3. GPT-6 Sol Model | OpenAI API
  4. Gemini 3.8 Flash | Gemini API
  5. Models & Pricing | DeepSeek API Docs
  6. Gemini Developer API pricing
  7. Gemini 4 Argon | Gemini API
  8. meta-llama/Llama-4-Scout-17B-16E-Instruct model card
  9. API Pricing
  10. Pricing - Claude Platform Docs
  11. Alibaba Cloud Model Studio model pricing
  12. Pricing | OpenAI API
  13. Lost in the Middle: How Language Models Use Long Contexts
  14. RULER: What's the Real Context Size of Your Long-Context Language Models?
  15. Prompting best practices - Claude Docs