← All articles

LLM API Context Window Limits Across Providers: Max Tokens, Pricing Tiers, and What Actually Works (2026)

A cross-provider reference for LLM API context window limits in 2026. Compare max input tokens, max output tokens, long-context pricing surcharges, and practical constraints across OpenAI, Anthropic, DeepSeek, DashScope, Google Gemini, Kimi, and SiliconFlow.

· updated 2026-08-07· TheRouter

Every major LLM API now advertises a context window measured in hundreds of thousands — sometimes millions — of tokens. The practical question for operators is not which number is biggest, but what the window actually costs, what output limit comes with it, and where the provider silently degrades or surcharges above a threshold.

OpenAI-compatible means a provider exposes a chat-completions endpoint whose request and response shape matches the OpenAI API contract closely enough that an unmodified OpenAI SDK call works against it after swapping three values: API key, base URL, and model name. The minimum surface in practice is POST /v1/chat/completions with messages, model, and an OpenAI-shaped streaming response.

Sources: OpenAI API Pricing, retrieved 2026-08-07; Anthropic Models Overview, retrieved 2026-08-07; DeepSeek Models & Pricing, retrieved 2026-08-07; DashScope Model Pricing, retrieved 2026-08-07; Google Gemini 3.5 Flash Model Card, retrieved 2026-08-07; Kimi K3 Guide, retrieved 2026-08-07.

TL;DR — Context Window Comparison Table

ProviderModelContext windowMax outputLong-context pricingOpenAI SDK compatible
GoogleGemini 3.5 Pro2M64KSurcharge above 128KVia base_url override
OpenAIGPT-5.6 Sol/Terra/Luna1.05M128K2x input, 1.5x output above 272KNative
AnthropicClaude Opus 4.8 / Sonnet 51M128K (300K batch)No surchargeVia base_url override
DeepSeekV4 Pro / V4 Flash1M384KNo surchargeNative
DashScopeQwen3.8-Max / Qwen3.7-Max1M128KTiered pricing (see below)Via OpenAI-compatible endpoint
KimiK31M——Via base_url override
SiliconFlowVaries by hosted modelUp to 1M (model-dependent)Model-dependentNo surcharge (follows upstream model)Native
GoogleGemini 3.5 Flash1M64KSurcharge above 128KVia base_url override

Note: Numbers as of August 2026. "Context window" means the maximum total tokens (input + output) the model accepts in a single request unless otherwise noted. Always verify against the provider's current documentation.

OpenAI — Long-Context Costs 2x

OpenAI introduced explicit short-context and long-context pricing tiers with the GPT-5.6 family. The boundary sits at 272K tokens of total context.

GPT-5.6 context limits:

ModelContext windowMax outputShort-context inputLong-context inputShort-context outputLong-context output
GPT-5.6 Sol1.05M128K$5.00$10.00$30.00$45.00
GPT-5.6 Terra1.05M128K$2.00$4.00$12.00$18.00
GPT-5.6 Luna1.05M128K$0.20$0.40$1.20$1.80

The jump is steep: 2x on input tokens and 1.5x on output tokens the moment your request crosses the 272K boundary. The short/long boundary applies to the entire request — not token-by-token.

Caching helps. Cached input tokens cost 90% less ($0.50/M vs $5.00/M for Sol at short context). Cache writes cost 125% of base input price. If your long-context workload reuses the same prefix across requests, caching can cut the effective long-context input cost from $10.00/M to $1.00/M.

Older models: GPT-5.5 supports 1.05M context at 128K max output with the same 272K short/long boundary. GPT-5.4 supports up to 272K context. GPT-5.4-mini and GPT-5.4-nano have no long-context tier at all — they top out at standard context lengths.

For more on OpenAI's model lineup, see GPT-5.6 Sol, Terra, and Luna Model Tier Comparison.

Anthropic — 1M Context, No Surcharge

Anthropic made 1M-token context generally available for Claude Opus 4.8 and Claude Sonnet 5 in March 2026 without adding a long-context pricing tier.

Claude context limits:

ModelContext windowMax outputInput priceOutput price
Claude Opus 4.81M128K (300K batch)$5.00$25.00
Claude Sonnet 51M128K (300K batch)$2.00$10.00
Claude Sonnet 4200K128K$3.00$15.00
Claude Haiku 3.5200K8K$0.80$4.00

The lack of a long-context surcharge makes Claude one of the cheapest options for workloads that routinely hit 300K–1M tokens. Prompt caching brings cached input down to 10% of the base price ($0.50/M for Opus 4.8, $0.20/M for Sonnet 5).

Extended thinking consumes output tokens from the same budget. A request that uses 60K thinking tokens leaves 68K for the visible response (128K total). On the batch API, the 300K output limit gives more room for thinking-heavy workloads.

For a deeper dive into the Claude API, see Anthropic Claude API Complete Guide.

DeepSeek — 1M Context, 384K Output, Cheapest Per Token

DeepSeek V4 offers the largest max output of any production API at 384K tokens, paired with a 1M context window and no long-context surcharge.

DeepSeek V4 context limits:

ModelContext windowMax outputInput (cache miss)Input (cache hit)Output
V4 Flash1M384K$0.14$0.0028$0.28
V4 Pro1M384K$0.435$0.003625$0.87

The cache hit discount is 98% — the most aggressive of any provider. For workloads with high prefix overlap, DeepSeek V4 Flash with caching produces effective input costs under $0.003/M tokens, regardless of context length.

Both models support OpenAI and Anthropic API formats natively. The concurrency limit is 2,500 for V4 Flash and 500 for V4 Pro.

Important: DeepSeek has announced plans to raise API pricing significantly. Current prices may not last. See DeepSeek API Complete Guide for the latest.

DashScope (Alibaba Bailian) — Tiered Pricing by Context Length

DashScope stands out for applying tiered pricing that increases per-token cost as context length grows within a single request.

Qwen3 Max-series context limits (Beijing region, RMB per 1M tokens):

ModelContext windowMax outputInput ≤32KInput 32K–128KInput 128K–1MOutput
Qwen3.8-Max1M128K¥12¥12 (flat)¥12 (flat)¥36
Qwen3.7-Max1M128K¥12 (promo ¥6)¥12 (promo ¥6)¥12 (promo ¥6)¥36 (promo ¥18)
Qwen3-Max256K128K¥2.5¥4¥7¥10–¥28

The Qwen3.8-Max and Qwen3.7-Max models use flat pricing up to 1M tokens — a simplification from the older Qwen3-Max tiered structure. At current promo rates, Qwen3.7-Max costs roughly $0.83/M input (¥6) and $2.48/M output (¥18), making it competitive with DeepSeek V4 Pro on long-context workloads when you factor in DashScope's context caching discounts.

Older Qwen3-Max still uses stepped pricing: ¥2.5/M at ≤32K, ¥4/M at 32K–128K, ¥7/M at 128K–256K. The pricing applies to the entire request based on total input token count, not incrementally.

For the full Qwen lineup, see DashScope Qwen3.7 Series Complete Guide.

Google Gemini — 2M Context on Pro, 1M on Flash

Google offers the largest production context window at 2M tokens on Gemini 3.5 Pro.

Gemini context limits:

ModelContext windowMax outputInput priceOutput priceLong-context surcharge
Gemini 3.5 Pro2M64KVariesVariesAbove 128K
Gemini 3.5 Flash1M64K$1.50$9.00Above 128K
Gemini 3.6 Flash1M64K———

The 64K max output is the lowest among flagship models in this comparison. Workloads that need to generate long documents or detailed analysis within a single response will hit this ceiling before exhausting the context window.

Google's pricing documentation applies surcharges for requests exceeding 128K context tokens. The exact multiplier varies by model and has changed between releases. Prompt caching is supported with a context caching API.

Kimi K3 — 1M Context, Open Weights

Moonshot's Kimi K3 ships with a 1M context window and 2.8 trillion parameters. Weights were released on July 27, 2026.

Kimi K3 context limits:

ModelContext windowMax outputInput priceOutput price
K31M (1,048,576)—$0.35$2.00
K3 (thinking tokens)1M——$1.40

K3 supports reasoning effort control (currently only max is available). Thinking tokens are billed at a discounted output rate. The model is also available on DashScope as a hosted third-party model.

For integration details, see Kimi K3 API Integration Guide.

SiliconFlow — Hosted Open-Weight Models

SiliconFlow hosts 200+ open-weight models with an OpenAI-compatible API. Context window limits depend on the underlying model:

Hosted modelContext windowMax outputPrice (input/output per 1M)
DeepSeek V4 Flash (hosted)Up to 1MModel-dependentFree tier available
Qwen3 series (hosted)32K–128KModel-dependentVaries
Other open-weight4K–128KModel-dependentFree tier on select models

SiliconFlow does not add long-context surcharges. Free-tier models have rate limits that may constrain high-throughput use. For details, see SiliconFlow Free Models Routing Guide.

Decision Tree: Choosing a Provider by Context Needs

  1. Do you need >1M context? → Google Gemini 3.5 Pro (2M) is the only option.
  2. Do you need >128K output tokens? → DeepSeek V4 (384K max output) is the only option.
  3. Is your average request <272K tokens? → OpenAI GPT-5.6 Luna ($0.20/$1.20) or DeepSeek V4 Flash ($0.14/$0.28) offer the lowest cost.
  4. Do you regularly send 300K–1M token requests? → Anthropic (no surcharge) or DeepSeek (no surcharge + cheapest base rate) beat OpenAI (2x surcharge above 272K).
  5. Do you need China-region deployment? → DashScope Qwen3.7-Max or Qwen3.8-Max (1M context, RMB billing, Beijing/Singapore regions).
  6. Do you want free-tier access for prototyping? → SiliconFlow (free tier on select models) or DashScope (free quota on new accounts).

Long-Context Pricing: What a 500K-Token Request Actually Costs

The following table shows the real cost of a single 500K input / 10K output request across providers, before and after prompt caching:

ProviderModel500K in + 10K out (no cache)With 80% cache hit
OpenAIGPT-5.6 Sol$5.45 (long-context rate)$1.35
OpenAIGPT-5.6 Luna$0.21$0.05
AnthropicClaude Opus 4.8$2.75$0.50
AnthropicClaude Sonnet 5$1.10$0.22
DeepSeekV4 Flash$0.073$0.004
DeepSeekV4 Pro$0.226$0.012
DashScopeQwen3.7-Max (promo)≈$0.47≈$0.10
GoogleGemini 3.5 Flash≈$0.84—

DeepSeek V4 Flash with caching is roughly 1,300x cheaper than OpenAI GPT-5.6 Sol for identical long-context workloads. Even without caching, the gap is 75x. This is the single largest cost variable in multi-provider routing.

Practical Constraints Beyond the Headline Number

Effective vs. advertised window. Some providers enforce an effective window smaller than the advertised limit. OpenAI's Codex product, for example, has been reported to expose only ~258K tokens of GPT-5.6's 1.05M window. The API and the product surface may differ.

Throughput at long context. Filling a 1M-token context window takes time — both to transmit and to process. Time-to-first-token (TTFT) and tokens-per-second (TPS) degrade as context length increases across all providers. DeepSeek V4's CSA/HCA attention mechanisms specifically target long-context efficiency, claiming 90% KV cache reduction vs. V3.2.

Token counting differences. Providers use different tokenizers. The same document produces different token counts across OpenAI (tiktoken), Anthropic (Claude tokenizer), and DeepSeek (custom tokenizer). A 1M-token window on one provider does not hold exactly the same amount of text as 1M tokens on another.

Truncation behavior. Providers differ in how they handle requests that exceed the context window. Some silently truncate the input (dropping oldest messages), some return an error, and some truncate but warn in the response metadata. Check your provider's documentation and test with oversized inputs before relying on any assumption.

TheRouter and Context-Length Routing

An OpenAI-compatible router like TheRouter can inspect incoming requests and make routing decisions based on estimated input length:

  • Short requests (under 32K tokens): route to the cheapest model (DeepSeek V4 Flash, GPT-5.6 Luna, or free-tier SiliconFlow models)
  • Medium requests (32K–272K tokens): still within OpenAI's short-context tier — route based on quality/cost preference
  • Long requests (272K+ tokens): route away from OpenAI to avoid the 2x surcharge — DeepSeek V4 or Anthropic Claude offer flat pricing
  • Ultra-long requests (1M+ tokens): only Google Gemini 3.5 Pro supports this range

This kind of context-aware routing is one of the highest-ROI optimizations available when operating across multiple providers. See LLM API Cost Optimization Routing Strategies and Model Fallback Routing for implementation details.

FAQ

Q: Which provider offers the best value for long-context workloads?

DeepSeek V4 Flash, by a wide margin. At $0.14/M input and $0.28/M output with no long-context surcharge and 98% cache discounts, it is the cheapest option for any context length up to 1M tokens. The trade-off is that DeepSeek has announced upcoming price increases.

Q: Can I use the full context window with extended thinking / reasoning mode?

Thinking tokens consume output budget, not context window budget. On Claude, 60K thinking tokens leave 68K for the visible response. On DeepSeek V4, the 384K max output provides ample room for thinking + response. On OpenAI o3/o4-mini, reasoning tokens are separate from the context window but affect cost.

Q: Does max output scale with context window?

Not proportionally. Google Gemini offers the largest context (2M) but the smallest max output (64K). DeepSeek offers the largest max output (384K) with a 1M context. There is no consistent ratio across providers.

Q: Are there models with unlimited or "infinite" context?

No production API offers unlimited context as of August 2026. 2M tokens (Gemini 3.5 Pro) is the current ceiling. Some research prototypes and local inference setups claim larger windows, but no publicly available API endpoint serves them reliably.

Q: How do I estimate token count before sending a request?

Use the provider's tokenizer library. OpenAI publishes tiktoken (open source). Anthropic provides a token counting API endpoint. For cross-provider estimates, a rough rule of thumb is 1 token ≈ 4 characters in English or ≈ 1.5 characters in Chinese, but actual counts vary by tokenizer.

Help & contact