
Every flagship launch now comes down to one number before anything else: how many tokens fit. Qwen4-Max went live on November 16, 2026 with a figure that, unlike its benchmark scores, Alibaba has actually published: a context window of one million tokens, with room for about 390,000 tokens of output per the developer docs. That is the long-context story, and it is a strong one.
But a context window on a spec sheet and a context window you can rely on are different things. This post is the practical guide to the number: what a million tokens holds in real payloads, what a full-window call costs at list rates, where the window lies to you (the middle), and the chunking and caching patterns that stop a big window from quietly eating your credits or dropping your content. It is the companion to our context window explainer from preview week, updated for the launch id and the launch pricing.
What Alibaba has published about the window
The launch banner on the Model Marketplace reads “Qwen4-Max-Preview Launches on Token Plan” and lists the model with text, reasoning and visual understanding. The developer docs carry the numbers:
| Spec | Published value |
|---|---|
| Context window | 1,000,000 tokens |
| Max output | About 390,000 tokens |
| Model id | qwen4-max |
| Input modalities | Text, image (native vision) |
| Open weights | No |
| Input price | $1.50 / M tokens |
| Output price | $4.50 / M tokens |
| Cached input | $0.075 / M tokens |
Read the two window numbers as a pair. A 1M window with a 390K output ceiling means a single call can take in roughly 610K tokens of prompt and still return a very long answer. For coding agents, the output ceiling matters as much as the input window: it is the difference between a model that summarizes a large refactor and one that can write the refactor back out. The 3.8 generation’s listing on our board carries a 128,192-token max output, so the new ceiling, if it holds, is roughly triple.

The banner that launched the generation. The spec sheet behind it is thin in the ways spec sheets are thin: window and modalities published, quality curve across the window not published, and no model card. Treat the 1M as a capacity claim, not a recall guarantee.
What a million tokens actually holds
Numbers this large stop meaning anything, so here are rough real-world magnitudes:
| Payload | Approximate tokens | Fits in 1M? |
|---|---|---|
| A long technical book | 150,000 | Yes, with room to spare |
| A medium codebase, a few hundred files | 300,000 to 600,000 | Yes |
| A full monorepo with tests and assets | 800,000+ | Tight, chunk it |
| A legal discovery archive | 500,000 to 1,000,000 | Borderline |
| Six months of application logs | 1,000,000+ | No, filter first |
The output ceiling is the less-discussed half. Input windows get the headlines, but agents that write code, produce long reports or generate structured extraction at scale hit output limits long before context limits. A 390K output allowance means one call can emit a substantial artifact, not just a paragraph.
Two honest notes. First, the 1M figure matches the 3.8 generation’s window, so this is continuity, not a jump; the thing that would be new is measured recall across it, and that is not published. Second, third-party walkthroughs fill the gap with defaults, not specs: apidog’s guide shows a client configured with a 983,616-token context and a 32,768 max_tokens default. One integrator’s config, not a vendor limit.
The catch: big windows are easy to waste
A million-token window is not free capacity. Three failure modes eat it, and none of them are the model being small.
You pay for every token you send. At list rates, a full-window call, 610K input and 390K output, is $0.915 input plus $1.755 output, about $2.67 per call before caching. With half the input cached at $0.075 it falls to about $2.24. On the Token Plan the same call burns an unknown number of credits, which is the stronger argument for metering: a few careless full-window prompts can drain a Lite plan’s 20,000 credits faster than a week of normal chat.
Not all of the window is equally reliable. Long-context models can degrade in the middle of very long prompts, missing details buried far from the start and end. Alibaba has published the window size, not the quality curve across it. For anything critical, test recall at the depths you actually use rather than trusting the headline number.
Truncation is silent. Send more than the window, or hit the 390K ceiling mid-answer, and most clients just stop. You get a confident partial result, not an error. The chunking pattern below exists to make that failure visible.

The launch post that started it all. Note what it promises and what it skips: deeper knowledge, richer world understanding, stronger coding and agentic capabilities, and no recall curve for the window it advertises.
Defensive chunking pattern
The pattern checks the size of what you are about to send and splits it into chunks that fit a budget you set well under the published window, leaving headroom for the prompt and the output.
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["QWEN_API_KEY"],
base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)
MODEL = "qwen4-max"
# Leave headroom below the published 1M window for prompt + output.
INPUT_BUDGET = 600_000
def chunk(text, budget=INPUT_BUDGET):
paras = text.split("\n\n")
out, cur, cur_len = [], [], 0
for p in paras:
# ~4 chars per token is a rough English/code estimate.
n = len(p) // 4
if cur_len + n > budget and cur:
out.append("\n\n".join(cur))
cur, cur_len = [], 0
cur.append(p)
cur_len += n
if cur:
out.append("\n\n".join(cur))
return out
def summarize_long(text):
parts = chunk(text)
partials = []
for i, part in enumerate(parts):
r = client.chat.completions.create(
model=MODEL,
messages=[{"role": "user",
"content": f"Summarize section {i + 1}/{len(parts)}: \n\n{part}"}],
)
partials.append(r.choices[0].message.content)
return client.chat.completions.create(
model=MODEL,
messages=[{"role": "user",
"content": "Combine these section summaries into one: \n\n"
+ "\n\n".join(partials)},
],
).choices[0].message.contentThe principles behind it:
- Set a budget under the limit. Do not target 1M. Target 600K input so a long output cannot push the total over and truncate.
- Chunk on natural boundaries. Split on paragraphs, functions or records, never mid-identifier. A model that loses half a function cannot reason about it.
- Map then reduce. Summarize or process each chunk, then combine. One call per chunk beats one oversized call that gets truncated.
- Log token counts per call. Count input and output tokens and alert when any single call approaches your budget, so truncation surfaces in metrics instead of in a wrong answer.
The same pattern is the answer to the output ceiling. A 390K allowance is headroom, not a target: if your task can produce 400K tokens, no window helps you, and the reduce step above is where you cut the plan into pieces the model can finish.
Caching at 1M: the rate that changes the math
Implicit caching at $0.075 per million is 70% below the 3.8 generation’s $0.25, and at this window size it matters more than anywhere else. A coding agent that re-sends a 400K-token codebase context on every turn pays full freight without caching and a fifth of it with. The prompt caching guide explains the mechanic and the discounted models list tracks which routes carry cache breaks on our side; for Qwen4-Max the rate is Alibaba’s, and the discipline is yours: stable prefixes first, variable context last.
Also budget the thinking. Qwen4-Max is a reasoning model, which usually means a toggleable thinking mode, the pattern in our reasoning docs. Thinking tokens count against your window and your bill. For long-context work, decide deliberately whether you want the model reasoning over a big prompt or answering directly, and expect tool calling to be available since Alibaba markets the Token Plan at concurrent agents.

Our own banner from the free lane. The honest caption still holds: until Qwen4-Max lands on the gateway, the free lane runs the Qwen3.8 generation at $0 to start, and the 1M-window practice you build there transfers to the new id.
Should you use the whole window?
Usually no, even when you can. Relevant context beats large context. Stuffing a million tokens because the window allows it usually makes results worse and always makes them slower and more expensive. The better pattern is retrieval: pull the subset of your code or documents that is actually relevant to the task, and send that.
The exceptions are real, and they are the ones this window was built for: whole-contract review, full-repository refactors, months of logs in one shot, and long-horizon agent tasks of the kind Alibaba benchmarks with Agents’ Last Exam, where Qwen4-Max’s published 46.7 leads the launch table. Those workloads are why a 1M window exists. Everything else is a rankings question: measure your own task, your own recall, your own bill.
Test long context on a model you can meter
Qwen3.8 Max is live on One AI API Key with a 1M window at $0.577 / $1.73 per million tokens, and prompt caching cuts repeated context cost. Create a key and measure your real burn before Qwen4-Max lands.
A recall test you can run in an afternoon
The window is published; the recall curve is not. So measure yours. The pattern is needle-in-a-haystack at controlled depths, and it takes one script and one evening:
import os, random
from openai import OpenAI
client = OpenAI(
api_key=os.environ["QWEN_API_KEY"],
base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)
FILLER = "The quarterly report covers standard operating procedures. " * 400
NEEDLE = "The activation code for the archive vault is ARCHIVE-7741."
def probe(depth):
# depth 0.1 = needle near the start, 0.5 = middle, 0.9 = near the end.
blocks = [FILLER] * 90
blocks.insert(int(90 * depth), NEEDLE)
hay = "\n\n".join(blocks)
r = client.chat.completions.create(
model="qwen4-max",
messages=[{"role": "user",
"content": "What is the activation code in this document?\n\n" + hay}],
max_tokens=64,
)
hit = "ARCHIVE-7741" in r.choices[0].message.content
print(f"depth={depth:.1f} hit={hit} tokens_used={r.usage.total_tokens}")
return hit
for d in (0.1, 0.25, 0.5, 0.75, 0.9):
probe(d)Run it at five depths, three seeds each, and log the hits. A window that recalls at 0.1 and 0.9 but drops the middle at 0.5 is the known failure shape of long-context models, and no vendor table cures it. The output also prints total_tokens, which feeds the other discipline on this page: your real per-call cost. If the middle depth fails on your own corpus, the fix is architectural, not a bigger window: chunk, retrieve, and send the subset, which is the same conclusion as every serious long-context guide, including our own 1M context post from preview week.
Two more probes worth the evening. First, the cache-break probe: send the same long prefix with one character changed at position 400,000, and watch whether the cached-input rate still fires on the response. Implicit caching at $0.075 is the reason this window is affordable, and a cache break you did not notice is the reason a bill you did not expect exists. Second, the output-ceiling probe: ask for a long artifact and count where generation stops; 390,000 is the published ceiling, and anything that stops early is a truncation, not a style choice.
What the 3.8 generation taught us about windows
The 1M window is not new. Qwen3.8 Max shipped it, our board meters it at $0.577 / $1.73 per million, and the free 0902 lane runs it at $0. Three lessons carry over to Qwen4-Max verbatim:
- The headline number is capacity, not quality. The 3.8 family’s window is real and its recall curve is workload-dependent, which is why the chunker above exists.
- Stable prefixes are the bill. Agent loops that rebuild context per turn pay full freight; loops that pin the system prompt and repo snapshot pay the cached rate. The rate changed from $0.25 to $0.075; the discipline did not.
- Preview generations move. The 3.8 line shipped
qwen3.8-maxandqwen3.8-max-0902as different ids with different behavior. Expect the same from Qwen4-Max’s early life, and pin everything.
What is genuinely new is the output ceiling, roughly 390,000 against the 3.8 Max listing’s 128,192, and the price, 25% under the previous list on input and output with caching down 70%. A window you can also write back out of is a different product: one call can hold a codebase and return the refactor, which is the workflow the launch blog’s 3D modeling and game development demos are built on.
What the independent boards say about the window
As of 2026-11-16, Artificial Analysis and LMArena carry no Qwen4-Max row, so no third party has re-measured the 1M window or its recall curve; the window size is Alibaba’s own developer-docs figure. BenchLM documents the gap rather than filling it, and community threads that quote long-context quality are anecdotes about other models or the 3.8 generation. That is why the recall test above is the only honest measurement on offer: run your own depths, on your own prefix shapes, before you design a pipeline around the full million.
Mistakes to avoid
- Assuming the 1M window is usable end to end. The size is published; the quality across it is not. Test recall on your real long prompts before trusting the headline number.
- Forgetting the 390K output ceiling. Long-output tasks truncate silently. Budget for output the way you budget for input.
- Filling the window because it is there. Every token costs list rate or credits, and reasoning tokens count too. Send relevant context, not maximum context.
- Chunking mid-structure. Split on paragraphs, functions or records. A chunk that cuts a function in half cannot be reasoned about.
- Shipping without truncation alerts. A silently truncated answer looks like a complete one. Log input and output tokens per call and alert as you approach your budget.
- Confusing a client default with a vendor limit. apidog’s 983,616 context and 32,768 max_tokens are one walkthrough’s config, not Alibaba’s ceiling.
FAQ
What is Qwen4-Max’s context window?
Alibaba’s developer docs list 1,000,000 tokens, with room for about 390,000 tokens of output. That is the most specific official figure published. The model card and open weights are not published.
How much output can it produce in one call?
About 390,000 tokens, per the developer docs. That is a large allowance, enough for substantial code generation or long structured reports, and it is the number to watch for output-heavy agent workloads.
Is the 1M window bigger than the 3.8 generation’s?
No. Qwen3.8 Max also lists a 1M window, so the headline is continuity. What would be new is a measured improvement in how well the window is used, and that is not published.
What does a full-window call cost?
At list rates, about $2.67 for 610K input and 390K output, or about $2.24 with half the input at the $0.075 cached rate. On the Token Plan, the same call burns an unknown number of credits.
Is the whole window equally reliable?
Unknown. Alibaba published the window size, not the recall curve across it. Long-context models commonly degrade in the middle of very long prompts, so test the depths you actually use.
How do I stop long prompts from getting truncated?
Set an input budget under the published window, chunk on natural boundaries, and process chunks one at a time before combining, as in the pattern above. Log input and output tokens per call so a call approaching your budget surfaces in metrics rather than as a silently partial answer.
Is Qwen4-Max on One AI API Key yet?
No. It is queued. The metered 1M-window option today is Qwen3.8 Max at $0.577 / $1.73, with the free 0902 lane for qualifying traffic.
The bottom line
Qwen4-Max’s one solid published spec is a good one: a 1 million token context with about 390,000 tokens of output, confirmed in Alibaba’s developer docs. It puts the model in the same long-context tier as the other 1M flagships rather than above them, and the output ceiling is the underrated half for code-writing agents. The number is worth having; the discipline around it matters more. Budget under the window, chunk defensively, cache what repeats, and measure your credit burn before you fill a million tokens because the spec says you can. Meanwhile Qwen3.8 Max offers the same 1M window at a published, metered rate on One AI API Key.
Keep reading
-
Qwen4-Max benchmarks, explained — the scores behind the window claims
-
Qwen4-Max API pricing decoded — what filling that window costs
-
Qwen4-Max vs Qwen3.8-Max-0902 — the generational delta, row by row
-
Qwen4 Max Preview context window post — the preview-week original of this guide
-
Use Qwen4 Max Preview in Claude Code, Cursor, Codex and Cline — wiring long context into your tools
-
Prompt caching guide — the mechanic behind the $0.075 rate
More Qwen4-Max coverage
The Fable comparison, added 2026-11-16:
The rest of the cluster, and the pages every comparison links back to:
- Qwen4-Max API pricing: every rate, the $43 Token Plan Pro and what a call actually costs
- Qwen4-Max API quickstart: the id, the base URL, streaming, max_tokens and the $43 plan
- The cheapest way to run Qwen4-Max: free routes checked, and the $3 plan that beats them all
- Run Qwen4-Max in your coding agent: base URL, model id, concurrency tiers and budget guards
- Qwen4-Max prompt caching: the $0.075 implicit cache, break-even math and cache-break probes
- Qwen4-Max vision and video benchmarks: what native vision actually scores against GPT-6 Astra and Opus 5.5
- Qwen4-Max vs every flagship launched this quarter: the full scoreboard, price per million and who serves what
- Qwen4-Max vs Gemini 4 Argon: multimodal routes, 1M context and what each actually costs
- Qwen4-Max vs GPT-6.1 Sol and GPT-6 Astra: benchmarks, pricing and the split
- Qwen4-Max vs GPT-6 Astra: sixteen benchmarks, the price gap and where each model wins
- Qwen4-Max vs Grok 4.7: flat flagship prices against the 2x long-context surcharge
- Qwen4-Max vs Kimi K3: sixteen benchmarks, terminal coding and the price per million tokens
- Qwen4-Max vs Claude Opus 5.5: sixteen benchmarks, token prices and the honest split
- Qwen4-Max vs Qwen3.8-Max-0902: the 16-benchmark sweep, the price cut and a migration checklist
- The model catalogue
- The model comparison tool
- API pricing and plans
- The cost calculator
- Live rankings and throughput
- The changelog