Most leading general-purpose AI APIs now cluster around a one-million-token Context Window. GPT-5.6 has 1,050,000 tokens, Gemini and Kimi K3 have 1,048,576, and the leading Claude 5 and Qwen3.8 models have 1,000,000. These figures are easy to compare and easy to misread because a Context Window is not simply an input allowance.
The context window is the model’s working space for the entire request. System instructions, conversation history, documents, tool data, tokenized media, reasoning tokens, and the generated answer all occupy it. More input leaves less room for a response, while a separate Output Limit can stop generation before the remaining context is used.
Prompt caching reduces the cost and latency of repeated content, but it does not remove those tokens from the window. A model can also accept a long prompt without using every part of it with equal accuracy.
The figures below refer to first-party APIs, where context and output limits belong to a specific model ID. ChatGPT, Claude.ai, Gemini Apps, Qwen Chat, Kimi Assistant, coding subscriptions, and third-party gateways can use different models and reserve additional space for their own instructions, tools, and file processing.
AI context window and Output Limit comparison
The largest number in each row is only the outer boundary. A request must still leave room for generated text, reasoning tokens when applicable, and tool traffic. Separate maximum-input and maximum-output values cannot both be filled when their combined use would exceed a shared context window.
| Model | Context Window | Output Limit |
|---|---|---|
| GPT-5.6 Sol | 1,050,000 | 128,000 |
| GPT-5.6 Terra | 1,050,000 | 128,000 |
| GPT-5.6 Luna | 1,050,000 | 128,000 |
| Claude Fable 5 | 1,000,000 | 128,000 |
| Claude Opus 5 | 1,000,000 | 128,000 |
| Claude Sonnet 5 | 1,000,000 | 128,000 |
| Claude Haiku 4.5 | 200,000 | 64,000 |
| Gemini 3.1 Pro Preview | 1,048,576 input | 65,536 |
| Gemini 3.6 Flash | 1,048,576 input | 65,536 |
| Gemini 3.5 Flash-Lite | 1,048,576 input | 65,536 |
| Qwen3.8 Max | 1,000,000 | 65,536 |
| Qwen3.7 Plus | 1,000,000 | 65,536 |
| Qwen Long | Up to 10,000,000 via files | 32,768 |
| Kimi K3 | 1,048,576 | Remaining context; 131,072 default |
| Kimi K2.7 Code | 262,144 | 32,768 default |
| Kimi K2.6 | 262,144 | 32,768 default |
Context window, input limit, and output limit are different
Three numbers shape a long request.
Context Window is the total working capacity available to the model for one request. It can contain text that the developer sends, content added by the platform, retained conversation, reasoning state, and model output.
Maximum input is the largest prompt that an endpoint accepts under the selected settings. It is smaller than the full context when the service reserves space for output, reasoning, or internal tokens. Qwen3.7 Max, for example, allows 991,808 input tokens inside a 1,000,000-token context.
Maximum output is the generation ceiling. It is not a promise that every request can produce that many tokens. The remaining context, model settings, endpoint rules, stop sequences, safety systems, and natural completion can end a response earlier.
Default output settings form a fourth limit. Kimi K3 defaults to 131,072 completion tokens even though its parameter accepts a larger value. Kimi K2.7 Code and K2.6 default to 32,768. A dashboard or SDK can also set a smaller value without changing the model’s technical capacity.
Reserve output space before sending a large prompt. If a task needs a 20,000-token report, budget for the report, hidden reasoning where the API counts it, tool results generated during the run, and a safety margin. Sending the largest accepted input can leave too little room for a complete answer.
GPT-5.6 context limits
OpenAI’s GPT-5.6 family uses the same 1,050,000-token Context Window and 128,000-token maximum output across Sol, Terra, and Luna. Capability, speed, and price distinguish the three tiers.
GPT-5.6 Sol is the flagship tier for complex professional work. Terra targets workloads that need a lower cost with strong reasoning, while Luna is good for high-volume and cost-sensitive requests. You can run the same long-context architecture across all three and route tasks by difficulty.
The equal context specification does not make the models interchangeable. A long legal analysis, code migration, or research synthesis still needs evaluation on each tier. Lower-cost models can read the same quantity of material while producing different retrieval accuracy, reasoning depth, and instruction compliance.
OpenAI applies a pricing threshold to very large GPT-5.6 prompts. Requests above 272,000 input tokens cost twice the standard input rate and 1.5 times the standard output rate for the entire request. This threshold matters before a workflow reaches the one-million-token ceiling. Chunking, retrieval, and cache reuse can cost less than sending a full corpus on every call.
Compare model rates: AI LLM API Pricing 2026: GPT-5.6, Gemini 3.6, Claude Opus 5, and More
OpenAI also counts reasoning tokens as output tokens. They consume the output budget even when the API does not expose the full internal reasoning text. Production tests should log input, cached input, reasoning, and visible output separately.
Claude context limits
Claude Fable 5, Claude Opus 5, and Claude Sonnet 5 each provide a one-million-token context and a 128,000-token maximum output for synchronous Messages API requests. Claude Haiku 4.5 provides a 200,000-token context and a 64,000-token maximum output.
Fable 5 is Anthropic’s highest-capability widely released model. Opus 5 targets complex agentic coding and enterprise work. Sonnet 5 emphasizes speed and intelligence. Haiku 4.5 has the smallest window in this group, paired with lower latency and lower token prices.
Claude’s context accounting includes the system prompt, messages, tool definitions, tool results, images, documents, output, and thinking content where applicable. Cached tokens remain part of the context even when their billing rate drops. Cache reuse changes computation and price; it does not create extra context capacity.
Claude’s one-million-token models can process large repositories, multi-document reviews, and long-running agent sessions. The 128,000-token output ceiling supports lengthy structured deliverables. You still need to preserve space for tool traffic and generated content across an agent loop. A tool result inserted near the end of a request consumes the same finite window as a document inserted at the start.
Message Batches has a separate output exception. Claude Opus 5 and Sonnet 5 can generate as many as 300,000 tokens in that asynchronous endpoint when the output-300k-2026-03-24 beta header is enabled. This does not raise the standard synchronous limit shown in the table.
Gemini context limits
Gemini 3.1 Pro Preview, Gemini 3.6 Flash, and Gemini 3.5 Flash-Lite each have an input token limit of 1,048,576 and an output token limit of 65,536. All three accept text, images, video, audio, and PDF input, with text output.
Gemini’s separate input and output properties are easy to misread as additive capacity. You apps should count the complete prompt, set an explicit output budget, and verify the accepted request before a production rollout.
Multimodal input also consumes tokens. A large PDF, long video, or group of high-resolution images can use a substantial part of the input allowance before the text instructions are counted.
Qwen context limits
Qwen3.8 Max and Qwen3.7 Plus each provide a 1,000,000-token context, a 991,808-token maximum input in standard mode, and a 65,536-token maximum output. Their thinking-mode input limit is 983,616 tokens. The lower value reserves more capacity for reasoning and the final answer.
Qwen aliases can move to newer snapshots, while a dated model ID preserves a specific version. Availability also varies by region. Confirm the selected Alibaba Cloud Model Studio deployment before moving an application among China, Singapore, Germany, Japan, Hong Kong, and the United States.
Release history: Qwen Timeline: Model & Product Release History
Qwen Long and the 10-million-token claim
The Beijing-region qwen-long-latest file service handles as many as 10 million tokens and generates up to 32,768 output tokens. The developer uploads documents, waits for parsing, and passes their file IDs in a system message. Each request bills the referenced file content as input tokens even though the client does not resend the entire file body.
This service is a specialist document workflow, not a direct replacement for Qwen3.8 Max or Plus. It accepts up to 100 referenced files, and direct text, request-body, region, and file-processing restrictions still apply. Use it for very large document collections that fit the file workflow, not as a universal 10-million-token chat endpoint.
Kimi context limits
Kimi K3 provides a 1,048,576-token context and keeps thinking enabled. Its max_completion_tokens parameter defaults to 131,072 and accepts values up to 1,048,576. The prompt and completion must share the same full window, which means the practical maximum output equals the unused portion after prompt tokens and other context are counted.
Kimi K2.7 Code and Kimi K2.6 each provide a 256K context, or 262,144 tokens. Their max_tokens setting defaults to 32,768. Neither model has a separately specified hard output ceiling.
The direct Kimi API is separate from Kimi Assistant, Kimi Code subscriptions, and API access through another cloud. A coding plan can offer a 256K session even when the direct K3 API model supports one million tokens. Check the exact model ID and billing product before comparing reported limits.
Prompt Cache comparison
Prompt caching reuses computation for an unchanged prefix. It can reduce input cost and time to first token when many requests share a system prompt, tool list, document set, or conversation prefix. Cache does not increase the Context Window, and cached tokens still count as input.
| Provider | Cache Type | Key Rules |
|---|---|---|
| OpenAI | Implicit and explicit | GPT-5.6 caches prefixes from 1,024 tokens; writes cost 1.25x and reads cost 0.1x input |
| Anthropic | Automatic and explicit | 5-minute default or 1-hour TTL; model minimums range from 512 to 4,096 tokens |
| Implicit or explicit by API | Interactions is implicit; GenerateContent supports cache objects and storage TTL | |
| Alibaba Cloud | Implicit and explicit | Implicit starts at 256 tokens for most models; explicit starts at 1,024 tokens with a 5-minute TTL |
| Kimi | Automatic | Reuses a stable prefix after the prior prompt exceeds 256 tokens; no cache ID or manual TTL |
OpenAI prompt caching
GPT-5.6 supports implicit caching and explicit breakpoints. The minimum cacheable prefix is 1,024 tokens. Cache writes cost 1.25 times the uncached input rate, cached reads cost one tenth of the standard input rate, and usage fields report cache writes and hits.
OpenAI manages retention for implicit cache entries. Explicit mode exposes prompt_cache_options.ttl for retention settings and replaces the older prompt_cache_retention field.
Keep stable material at the beginning of the prompt. System instructions, schemas, examples, and tool definitions should retain the same order and bytes across related requests. Changing content near the start invalidates the later prefix match. Explicit mode fits applications that need control over which reusable prefix creates a paid cache write.
Claude prompt caching
Claude supports automatic caching and as many as four explicit cache breakpoints. The default TTL is five minutes. A one-hour TTL costs twice the base input rate. Five-minute cache writes cost 1.25 times the base input price, while cache reads cost one tenth of that price.
Minimum cacheable prompt sizes vary by model on the direct Claude API. Fable 5 and Opus 5 start at 512 tokens, Sonnet 5 starts at 1,024, and Haiku 4.5 starts at 4,096. Platform-specific deployments can use different minimums. A cache entry becomes available after the first response begins, which affects parallel requests sent at the same instant.
Gemini context caching
The Gemini Interactions API uses implicit caching for Gemini 2.5 and newer models. The minimum cacheable prefix is 4,096 tokens for Gemini 3.1 Pro Preview and selected Gemini 3.5 models. For a model without a specified threshold, use the returned usage fields to confirm whether a repeated prefix produced a cache hit.
The GenerateContent API supports explicit cache objects. You select a TTL, reference the cached content in later requests, and pay for cache storage plus cached input. Its default explicit TTL is one hour. Cached content remains a prefix to the prompt and still counts toward the model’s token limit.
Qwen context caching
Alibaba Cloud Model Studio offers implicit and explicit Context Cache modes. Implicit cache is automatic and cannot be disabled on supported models. It charges cache hits at 20 percent of the standard input price. The minimum is 256 tokens for most supported models and about 1,000 tokens for the Qwen3.8 Max series.
Explicit cache requires a marker, starts at 1,024 tokens, and has a five-minute TTL that resets after a hit. Creation costs 125 percent of the standard input price, while a read costs 10 percent. The two Qwen cache modes are mutually exclusive for a request.
Kimi automatic caching
Kimi enables caching for regular model requests without a cache ID, TTL setting, or extra request parameter. A later request can hit the prefix cache when the earlier prompt exceeded 256 tokens. The service manages the cache lifecycle.
Stable content belongs at the start of the message sequence. Reordering tool definitions, editing the system prompt, or inserting changing data before the shared document reduces the chance of a hit. Kimi reports cached input in usage and prices it separately from uncached input.
Why the advertised context window is not the usable window
A model can accept a long prompt and still miss a fact inside it. Long-context research has documented lost-in-the-middle behavior, where retrieval quality drops for information placed far from the beginning or end. Newer models have improved, though position, document structure, distractors, and task difficulty still affect the answer.
Context rot describes a wider decline as prompts grow. More tokens introduce competing instructions, duplicate facts, stale tool output, irrelevant files, and weakly labeled sections. The model spends attention on all of that material. A clean 80,000-token prompt can outperform a disorganized 800,000-token prompt.
Measure usable context with representative tests. Place required facts at several positions, include realistic distractors, ask for exact citations to supplied passages inside your own evaluation, and score answer completeness. Repeat the test at 32K, 128K, 256K, and the expected production size. A single needle-retrieval result cannot establish reliable performance for synthesis, coding, or multi-step reasoning.
Long prompts also increase time to first token and memory demand. Cache hits reduce repeated prefix computation, though a cache miss still pays the full latency. Very large requests can face lower throughput, higher prices, stricter rate limits, or regional capacity constraints. Log prompt size, cache-hit tokens, time to first token, output length, errors, and task quality together.
Choose a context window by workload
Start with the smallest context that passes the workload evaluation. Retrieval-augmented generation is a better fit when each question needs a small part of a changing corpus. Full-context input fits tasks that depend on relationships across the entire document set. A hybrid design retrieves the most relevant material and keeps a limited recent history, with cache applied to the stable prefix.
| Workload | Recommended starting point | Main reason |
|---|---|---|
| Large repository analysis | GPT-5.6, Claude 5, Gemini, Qwen3.7, or Kimi K3 | About 1M context with tool support |
| Repeated document questions | Any supported model with cache or RAG | Lower repeat cost and latency |
| Very large document archive | Qwen Long file workflow | Up to 10M file-based tokens |
| Long generated reports | GPT-5.6 or Claude 5 | 128K maximum output |
| High-volume extraction | GPT-5.6 Luna or Gemini Flash-Lite | Large input with efficiency focus |
| Coding agent with 256K needs | Kimi K2.7 Code | Coding-focused model and fixed 256K context |
Output capacity can narrow the choice. GPT-5.6 and the leading Claude 5 models allow 128K output for standard synchronous requests. Gemini and Qwen3.8 allow 65,536, while Qwen Flash allows 32,768. Kimi K3 can assign the remaining context to completion, with a 131,072 default. Long report generation needs more output room than archive analysis that returns a short JSON object.
Estimate workload cost: Compare AI Costs: Free LLM API Price Calculator
API limits and chat product limits
Chat interfaces add their own rules. They can select a different model, reserve tokens for hidden system instructions and tools, summarize old messages, restrict file size, cap daily usage, or route requests through a smaller context tier. A subscription quota also measures access over time, while a context window measures capacity for one request.
For API work, use the model ID returned by the provider, count tokens at the endpoint, and inspect the usage object. For chat products, use the plan details and in-product model label. A ChatGPT Plus, Claude Pro, Gemini Advanced, Qwen Chat, or Kimi Membership limit does not define the corresponding API limit.
FAQs
Can two providers count the same prompt differently?
Yes. Tokenizers split text, code, punctuation, and multilingual content differently. A prompt that uses 100,000 tokens with one provider can have a different count with another. Run each provider’s token-counting method after formatting the complete request, including system instructions and tool definitions.
Why can an API reject a request below the stated Context Window?
The visible prompt does not always include every token that the endpoint counts. Tool schemas, retained messages, tokenized images, reasoning allowance, and the requested Output Limit can push the complete request over an input or shared-context ceiling. Error responses can also come from file, request-body, rate, or endpoint limits unrelated to context size.
Should production software use the full advertised limit?
Set an operating ceiling below the technical maximum. Base the margin on the largest expected tool result, output reservation, tokenizer variance, and performance tests. This prevents normal request growth from causing failures at the boundary and leaves room for a complete answer.
Can a prompt Cache be reused after changing models?
Treat cache entries as model-specific. A model or snapshot change can alter tokenization and cache keys. Expect the first request after a switch to miss and create a new prefix entry. Keep cache-hit monitoring in place during model migrations.
Related resources
- ChatGPT Token Limit: Free, Plus, Pro, and OpenAI API Limits
- OpenAI API Rate Limits: RPM, TPM, Tiers, and 429 Errors










