
Qwen4-Max — Alibaba’s New Flagship: 2.4 Trillion Parameters, 1M-Token Context, 25% Cheaper with 62% Lower Cost per Task
Last weekend, a colleague sent me an API bill and asked: why did one afternoon of agent refactoring cost almost as much as hiring a junior developer for a day? The logs showed the agent calling a flagship model for trivial work like renaming variables, while the context kept swelling because the whole repo and every failed attempt were stuffed into the same session.
Qwen4-Max is Alibaba’s answer to exactly that problem: 1-million-token context, list prices 25% lower than Qwen3.8-Max, and, according to Qwen, a 62% lower average cost per task.
What Is Qwen4-Max?
Qwen4-Max has the model ID qwen4-max and launched officially on 16/11/2026. Before that, from 11/11, it was available as a preview for Token Plan users under the name qwen4-max-preview; that preview expires on 25/11/2026.
It is a Mixture-of-Experts (MoE) model with a 2.4-trillion-parameter backbone, of which only 71 billion parameters are activated per token, plus 328 billion N-gram Embedding parameters. Note: the figure of 710 billion activated parameters per token circulating on social media is wrong according to Qwen’s official blog.
Qwen4-Max’s context is 1 million tokens, handling text, image, and video input directly. It is available on QwenCloud (Token Plan or pay-as-you-go API), QwenWork, Qoder, and QwenStudio. If you use the Qwen Code CLI, also read Qwen Code — multi-model agent running locally on this blog.
Use it if you call LLM APIs or use a coding agent every day, are a DevOps/SRE integrating a model into a system, or an IT manager who needs to cut AI costs. It is not a fit if you need self-hosting, open weights, fine-tuning, or large batch workloads.
How Qwen4-Max Architecture Works
Three new architecture components are GDN, Qwen Sparse Attention (QSA), and Gated Residual. QSA matters most: instead of computing attention over the entire context like traditional dense attention, sparse attention focuses only on the relevant parts of the context, so processing cost does not explode when context stretches to 1 million tokens.
A request flows through these steps: text, image, or video input is processed through QSA and GDN; the MoE router selects the relevant experts and activates 71 billion parameters for that token; the model reasons with thinking on by default, then calls tools when needed and returns structured output. Instead of waiting for the agent to finish everything, Qwen4-Max uses Live Delivery: it ships a usable version early and improves it gradually based on feedback.
flowchart TD
A["Client / Coding agent<br/>Qoder, Qwen Code, LiteLLM gateway"] --> B["QwenCloud API<br/>OpenAI-compatible endpoint<br/>model=qwen4-max, DASHSCOPE_API_KEY"]
B --> C["Qwen Sparse Attention + GDN<br/>Handles context up to 1M tokens"]
C --> D["MoE Router<br/>Activates 71B / 2.4T parameters<br/>+ 328B N-gram Embedding"]
D --> E["Thinking<br/>On by default, budget 131,072 tokens<br/>low / high / xhigh"]
E --> F["Tool Calls<br/>MCP, web search, code interpreter<br/>PDF, web scraping"]
F --> G["Structured Output"]
G --> H["Live Delivery<br/>Ships a usable version early<br/>Improves gradually from feedback"]
H --> I["Final Answer"]
H -.->|"Feedback, change requests"| E
C -.->|"Explicit Cache<br/>Cache read $0.075 / 1M tokens"| C
E -.->|"Thinking tokens billed at output price $4.50 / 1M"| J["Invoice<br/>Input $1.50 + Output $4.50"]
B -.->|"Failed call: no charge"| B
The diagram has three paths: data flows from the client through QSA/GDN, the MoE router, thinking, and tool calls to Live Delivery before the final answer; cost branches off at thinking, because thinking tokens are billed at the output price of $4.50 per million tokens, three times the input price; the loop sits at Live Delivery, where feedback returns to thinking.
QwenCloud lists capabilities including thinking, function calling, structured output, image and video understanding, explicit cache, web search, PDF reading, code interpreter, web scraping, and MCP. The API is compatible with OpenAI Chat Completions, OpenAI Responses, Anthropic Messages, and DashScope. Read the context limits carefully: maximum input is 991,808 tokens without thinking and 983,616 with thinking; total thinking plus final answer is at most 262,144 tokens, with a default thinking budget of 131,072. Thinking is on by default at reasoning_effort=high; turn it off with enable_thinking=false. QwenCloud states clearly that it does not support batch inference, fine-tuning, or model deployment.
How to Use Qwen4-Max via the API
You need a QwenCloud account and an API key, stored in the DASHSCOPE_API_KEY environment variable — never hardcode it into source code. The Singapore region for the pay-as-you-go plan includes 1 million free tokens. For the environment, you only need Python and the OpenAI SDK.
The steps below follow the quick-start in the official documentation exactly. I have not run this myself because I have no API key; I only cross-checked it against the docs.
export DASHSCOPE_API_KEY="sk-..."
pip install -U openai
For the international region (Singapore), the base URL is https://dashscope-intl.aliyuncs.com/compatible-mode/v1:
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
response = client.chat.completions.create(
model="qwen4-max",
messages=[{"role": "user", "content": "Review đoạn code sau và chỉ ra 3 lỗi nghiêm trọng nhất, kèm cách sửa."}],
extra_body={"enable_thinking": True, "reasoning_effort": "low"},
)
print(response.choices[0].message.content)
print(response.usage)
Tune reasoning_effort to the difficulty of the task: for simple tasks use low or turn thinking off entirely with enable_thinking=false; leave the default high for ordinary tasks; use xhigh only for hard tasks. This is the most important cost-control lever in Qwen4-Max.
After the first call, print response.usage and read three numbers: prompt tokens, completion tokens, and thinking tokens. If thinking is on, thinking tokens will make up most of the completion tokens, and all of them are billed at the output price of $4.50 per million tokens. The maximum to remember: if one call uses the full thinking budget of 131,072 tokens, the thinking alone costs at most ~$0.59 (131,072/1M × $4.50) — a short test call usually uses far less, but the high default budget means a long task can hit this ceiling before producing a single answer token.
Common errors: 401 — check DASHSCOPE_API_KEY, the region, and the account’s permissions. Calling qwen4-max-preview after 25/11/2026: the preview has expired, switch to qwen4-max. Exceeding max input — split the document or use explicit cache. Surprisingly high bill: almost always because thinking defaults to high — lower reasoning_effort or turn thinking off for simple tasks.
Because the API is OpenAI-compatible, you can put Qwen4-Max behind LiteLLM or new-api without rewriting the client — see LiteLLM — multi-model gateway with OpenAI-standard API and self-host new-api as an AI gateway on this blog. In my view, this is the right way to deploy it: put Qwen4-Max behind a gateway, route by task difficulty, and keep the ability to roll back with a single line of config.
How Much Does Qwen4-Max Cost?
| Item | Singapore (International) | Beijing / Global |
|---|---|---|
| Input | $1.50 | $1.413 |
| Output (thinking + answer) | $4.50 | $4.24 |
| Cache read | $0.075 | $0.071 |
| Cache write 5 min / 1 hour | $1.875 / $3.00 | $1.767 / $2.827 |
Failed calls are not charged. Web Search costs $10 per 1,000 calls in Singapore; Code Interpreter and Web Extractor are free for a limited time. Recheck the pricing page before putting these numbers into a budget.
The 62% lower cost per task comes from Work360, a benchmark built by Qwen itself. On this benchmark, Qwen4-Max scores 52.69 versus 47.74 for Qwen3.8-Max, while average cost per task falls from $4.43 to $1.67. The 62% drop comes mainly not from unit prices being 25% lower but from token efficiency — the model uses fewer tokens to complete the same task. Every benchmark in this article is as published by Qwen, with no independent measurement.
Pros, Cons, Security, and Operations
The clearest advantage is 1-million-token context plus native vision for multi-step agents, long documents, and large repos. Input and output prices are 25% lower than the previous generation, and cache read at $0.075 per million tokens is very cheap for workloads repeating the same long context. OpenAI- and Anthropic-compatible APIs make switching models almost just a matter of changing the model ID and endpoint.
The biggest drawback is tight lock-in to QwenCloud: no open weights, no self-hosting, no fine-tuning, no batch inference. The second drawback is thinking defaulting to high with a 131,072-token budget — this default can get expensive if a team leaves it unchanged for every task. The third drawback is in the benchmarks: according to Qwen’s published chart, Qwen4-Max’s Terminal-Bench 4.0 score is 48.5 — below Claude Opus 5.5 at 59.6 and Kimi K3.1 at 67.2.
On security, Last Secure Code Bench as published by Qwen shows the function-level pass rate — requiring both correct functionality and safety — rising from 22.0% to 31.8% versus Qwen3.8-Max. The absolute value is still low: you still need to review model-generated code, run tests, scan for secrets, and never merge blindly. Data sent to the QwenCloud API follows the region you select — consider data residency and secrets in prompts. Keep the API key in an environment variable, never hardcoded, and set a quota and cost alerts from day one.
For operations, track usage separately for thinking, output, and cache, set cost alerts, and log the model ID and reasoning_effort for every call so you can trace a bill when something looks off.
Comparison with Qwen3.8-Max, Claude Opus 5.5, and Kimi K3.1
| Criterion | Qwen4-Max | Qwen3.8-Max | Claude Opus 5.5 | Kimi K3.1 |
|---|---|---|---|---|
| Input / output price (1M tokens) | $1.50 / $4.50 | $2.00 / $6.00 | not verified in this article | not verified in this article |
| Context | 1M tokens | not verified in this article | not verified in this article | not verified in this article |
| Terminal-Bench 4.0 | 48.5 | not verified in this article | 59.6 | 67.2 |
| Cost / task (Work360) | $1.67 | $4.43 | not verified in this article | not verified in this article |
The Terminal-Bench numbers in the table come from Qwen’s published chart; see secondary coverage in References. The open-weight / batch / fine-tuning rows are left out because this article only verified them for Qwen4-Max (it supports none of the three) — see the Architecture section.
Qwen4-Max wins on price, context, and cost per task on Qwen’s own benchmark, but trails Opus 5.5 and Kimi K3.1 on absolute Terminal-Bench score. For long-running, price-sensitive agents on an OpenAI-compatible stack, it is a reasonable choice; for hard coding tasks needing the highest accuracy, consider Opus 5.5 or Kimi K3.1 and measure on your own workload first.
Real Use Cases
The clearest use case is a coding agent doing long tasks: building a game in Unreal or Unity, creating 3D scenes in Blender, refactoring a large repo. With Live Delivery, the agent ships a usable version early and improves it gradually, instead of running for tens of hours before you discover the result went wrong at some step. The demos in Qwen’s launch post are vendor demos, with no independent verification — but they show exactly the kind of workload this model targets: in manufacturing, Qwen cites programming effort for one part dropping from about 475 minutes to 24 minutes; in scientific research, an agent running 48 hours to design a cooling molecule, and a drug-discovery workflow making 454 tool calls to propose 24 candidate molecules; in finance, an agent using up to 90 MCP tools to produce traceable Excel and PowerPoint reports; in legal work, a pre-IPO due diligence run processing 198 documents into an 86-page report. Do not take these numbers as performance guarantees — take them as a list of workloads to measure yourself: whichever of your tasks resembles these examples is worth a trial run with Qwen4-Max.
For DevOps and IT admins, the most practical deployment is to put Qwen4-Max behind a gateway such as LiteLLM or new-api, then route by difficulty instead of using one configuration for every task. Example illustrative LiteLLM configuration — simple tasks go through an alias with thinking off, hard tasks through an xhigh alias:
model_list:
- model_name: qwen4-max-cheap
litellm_params:
model: openai/qwen4-max
api_base: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
api_key: os.environ/DASHSCOPE_API_KEY
extra_body:
enable_thinking: false
- model_name: qwen4-max-deep
litellm_params:
model: openai/qwen4-max
api_base: https://dashscope-intl.aliyuncs.com/compatible-mode/v1
api_key: os.environ/DASHSCOPE_API_KEY
extra_body:
reasoning_effort: xhigh
The configuration above is an illustrative example in LiteLLM’s model_list format, not tested — check it against the LiteLLM docs for the version you use before applying it to production. A note for homelabs: Qwen4-Max cannot be self-hosted, so the homelab here is a gateway plus an API key, not a locally running model; if you need a model that runs locally, wait for the smaller Qwen4 models to be open-sourced later.
Conclusion: Should You Switch to Qwen4-Max?
Switch if your team is paying flagship prices for an agent running long tasks, needs 1-million-token context, already uses an OpenAI-compatible stack, wants to cut cost per task, and accepts API-level vendor lock-in — provided you tier reasoning_effort by task difficulty from the start. Do not switch if you need self-hosting, open weights, fine-tuning, or batch inference, or if your data is not allowed to leave internal infrastructure.
Next step: use the 1 million free tokens in Singapore for the pay-as-you-go plan, run your real workload with the three reasoning_effort levels low, high, and xhigh, measure both cost per task and output quality, and only then decide whether to change the default.
Lessons Learned
- Unit prices 25% lower is not the same as cost per task 62% lower — most of it comes from token efficiency.
- Thinking defaulting to high is the biggest cost lever: tune
reasoning_effortto task difficulty, and turn thinking off for simple tasks. - A 1-million-token context only pays off when real input stays within the 991,808 / 983,616-token limits, and when you have a caching strategy for the repeated context.
- OpenAI-compatible APIs make switching models very cheap — but they do not remove vendor lock-in on data and pricing.
- A vendor’s benchmark is not independent evidence: measure on your real workload before changing the default.
- Security of generated code has improved but the absolute value is still low — review and testing remain mandatory, never merge blindly.
Verification Scope
Checked on: 16/11/2026. Verified against official documentation: Qwen’s launch blog, QwenCloud’s model page, and QwenCloud’s pricing page — launch date, architecture, 1-million-token context, model ID qwen4-max, capabilities, input and thinking limits, regional pricing, the 1-million-token free quota, and the lack of support for fine-tuning, deployment, or batch inference, as well as Qwen4-Max not being open-weight. Benchmark numbers, demos, and the cost-reduction figure are as published by Qwen, with no independent measurement; the Terminal-Bench 4.0 score of 48.5 comes from Qwen’s published chart via secondary coverage (The Model Atlas citing Artificial Analysis, see References). Thinking is on by default at high with a 131,072-token budget; turning thinking off and the low and xhigh levels are opt-in via parameters; explicit cache is opt-in. No real API call was made — there was no API key — no benchmark was run, nothing was installed: the API guide here follows the official documentation and has not been run in practice.
References
- Qwen Team — Qwen4-Max: Your New Teammate Has Arrived: https://qwen.ai/blog?id=qwen4-max
- QwenCloud — Latest model (Qwen4-Max): https://docs.qwencloud.com/developer-guides/getting-started/latest-model
- QwenCloud — Pricing (Qwen4-Max): https://docs.qwencloud.com/developer-guides/getting-started/pricing#qwen4-max-pricing
- The Model Atlas — Qwen4-Max is out: price, benchmarks and how to try it (secondary coverage for the Terminal-Bench 4.0 number: Artificial Analysis records Qwen4-Max at 48% versus Kimi K3.1 Pro at 67%): https://themodelatlas.com/blog/qwen4-max-preview-explained/
Bình luận
Bình luận được duyệt trước khi hiển thị.Đang tải bình luận…
Để lại bình luận