
Every flagship launch now comes down to one number before anything else: how many tokens fit. Qwen4 Max Preview went live on November 11, 2026 with a figure that, unlike its benchmark scores, Alibaba has actually published. The developer docs list a context of one million tokens, with room for about 390,000 tokens of output.
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 covers what the 1M window and 390K output actually mean, how they compare to the flagships launched this month, what they let you do that smaller windows do not, and the chunking and truncation patterns that stop a big window from quietly eating your tokens or dropping your content.
What Alibaba has published about the window
The official launch banner on the Qwen Cloud Model Marketplace reads “Qwen4-Max-Preview Launches on Token Plan” and lists qwen4-max-preview with text, reasoning and visual understanding. The Token Plan’s pricing page is where the model id lives. But the most specific official number comes from Alibaba’s own developer docs: a context of a million tokens, with about 390,000 of that available as output.
| Spec | Published value |
|---|---|
| Context window | 1,000,000 tokens |
| Max output | ~390,000 tokens |
| Model id | qwen4-max-preview |
| Input modalities | Text, image |
| Open weights | No |
| Per-token price | None; Token Plan credits only |
Read the two 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, that 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 actually write it back out.
One caveat carried over from the rest of this preview. Alibaba has published the window but not a model card, not open weights and not a per-token price. The context figure is real and quotable; the model around it is still a moving target.
How 1M compares to the other new flagships
The window lands Qwen4 in the pack, not above it. Nearly every flagship launched in the last eight weeks sits at roughly a million tokens.
| Model | Context window |
|---|---|
| Qwen4 Max Preview | 1,000,000 |
| Gemini 4 Carbon | 1,048,576 |
| Gemini 4 Argon | 1,000,000 |
| Claude Fable 5.1 | 1,000,000 |
| GPT-6.1 Sol | 1,050,000 |
| Claude Opus 5.5 | 1,000,000 |
| Grok 4.7 | 500,000 |
| Qwen3.8 Max | 1,000,000 |
Two honest notes on that table. First, the Qwen3.8 generation already shipped a 1M window, so the preview matching it is continuity, not a jump. The thing that would be new is a measured improvement in how well it uses those tokens, and that is not published. Second, Grok 4.7’s 500K is not flat-rate: it bills every token at 2x once the prompt passes 200K, so its effective window is cheaper to reach but costs more per token when you get there.
What a million tokens actually holds
Numbers this large stop meaning anything, so here are rough real-world magnitudes. A million tokens is on the order of 750,000 words, or a stack of novels. For code, it is a large repository or a few hundred files, depending on language and density. For documents, it is a contract set, a discovery file, or months of logs.
| 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 390K 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.
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. On the Token Plan that means credits, and a $3 Lite plan caps you at 20,000 credits a month. A few careless 500K-token prompts can drain a launch tier in a day. Measure your burn before you assume the window is yours to fill.
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. If you send more than the window, or your output hits the 390K ceiling mid-answer, most clients just stop. You get a confident partial result, not an error. Defensive chunking is how you avoid shipping a truncated answer as if it were complete.
Defensive chunking patterns
A big window is an excuse to be lazy about context. Resist it. The pattern below 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-preview"
# 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.
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.
Qwen4 Max Preview is a reasoning model, which usually means a toggleable thinking mode, and thinking tokens count against your budget too. For long-context work, decide deliberately whether you want the model to reason over a big prompt or answer directly. Our reasoning docs cover the toggle, and prompt caching drops the cost of repeated long context to a fraction, which matters a lot at this window size.
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.
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 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 token counts per call and alert as you approach your budget.
FAQ
What is Qwen4 Max Preview’s context window?
Alibaba’s developer docs list a context of 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 1M tokens bigger than Claude or Gemini?
Not meaningfully. Gemini 4 Carbon is 1,048,576, GPT-6.1 Sol is 1,050,000, and Claude Fable 5.1, Claude Opus 5.5, Gemini 4 Argon and Qwen3.8 Max are all at 1,000,000. Qwen4 Max Preview matches the pack. Only Grok 4.7 is smaller at 500,000, and it bills at 2x past 200K tokens.
Does the big window cost more?
There is no per-token price yet. You reach Qwen4 Max Preview through the Token Plan, from $3 a month for 20,000 credits on Lite. Credits are not tokens and Alibaba does not publish how many credits a large call burns, so measure your own workload before assuming a million-token prompt is affordable.
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.
The bottom line
Qwen4 Max Preview’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 Claude, Gemini and GPT-6.1 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.