Alibaba opened Qwen4-Max-Preview, the next-generation flagship of its Qwen family, on November 11, 2026. Alibaba itself offers it only through a Token Plan subscription for coding tools; there is no pay-as-you-go option. The preview ends at 24:00 on November 25 (UTC+8), and Alibaba retires the model after that.
AIHubMix is the first platform to offer it as a per-token API. It has served the model since launch day as coding-qwen4-max-preview on the OpenAI-compatible endpoint, at $0.353 per million input tokens and $1.059 per million output tokens. Before you point an agent at it, know the one change that can break existing code. On this model, max_tokens covers the thinking and the answer together. On AIHubMix, a 300-token limit returned an empty reply.
The short version
- What it is: Alibaba's next-generation flagship multimodal model, and, as of November 11, the only Qwen4 model in Alibaba's model list. It's aimed at coding, frontend design, office work, and agentic tasks. Text, image, and video in; 1M-token context; up to 393,216 output tokens.
- Where to call it: Alibaba offers it only inside Token Plan subscriptions. On AIHubMix it's a per-token API with the model ID
coding-qwen4-max-preview. - How long: Alibaba's preview runs until 24:00 on November 25, 2026 (UTC+8), which is 16:00 UTC that day.
- What breaks:
max_tokensnow limits thinking plus answer. A limit sized for the answer alone can returnfinish_reason: "length"and an emptycontent. - What it costs: Alibaba publishes no per-token price. On AIHubMix it's $0.353 per million input tokens and $1.059 per million output tokens.
Two ways in, and the deadline
Alibaba's model page states the terms directly: Qwen4-Max-Preview "is available through Token Plan only. Pay-as-you-go access is not supported." Token Plan is Alibaba Cloud's subscription for AI coding and agent tools such as Claude Code, Qwen Code, and Qoder. It is billed in Credits with no published per-token rate, and personal plans start at $6 a month. During the preview, Alibaba charges Qwen4-Max-Preview at as little as 20% of its standard Credit rate, and 8% between 22:00 and 08:00 (UTC+8).
AIHubMix's channel is the other way in. You call it like any other model on the OpenAI-compatible endpoint, pay per token, and need no subscription. AIHubMix describes it as lower-cost access to Qwen4-Max-Preview through the official Token Plan, and labels it a preview service that "may be unstable and is recommended for testing and evaluation."
The preview dates are fixed. It runs from 10:00 on November 11 to 24:00 on November 25, 2026 (UTC+8), 350 hours in all. Alibaba says "no changes will be made during this period, and the model will be retired after the preview ends." Treat it as an evaluation model, not one to build a product on.
What changed from Qwen3.8-Max
Qwen3.8-Max is the current Qwen flagship, with no announced retirement date. Here is how the two compare on Alibaba's published specs:
| Qwen3.8-Max | Qwen4-Max-Preview | |
|---|---|---|
| Context window | 1M | 1M |
| Maximum output | 131,072 | 393,216 |
| What max_tokens limits | Answer only | Thinking + answer |
| Thinking default | On, xhigh | On, xhigh |
| Effort levels | low, medium, xhigh | low, medium, xhigh |
| Input | Text, image, video | Text, image, video |
| Official access | Pay-as-you-go, Token Plan | Token Plan only |
| Status | Available | Retires after Nov 25 |
Specs from Alibaba Cloud's model pages and API reference. Qwen4-Max-Preview's output limit is shared by thinking and the final answer.
Context and inputs stay the same. Two things change: the output ceiling triples, and max_tokens now covers thinking as well as the answer. Thinking controls keep the same names and levels, so code that already sets reasoning_effort for Qwen3.8 carries over.
There are no benchmarks yet. Alibaba's launch page lists no scores, and we found no independent benchmark of this preview as of November 11. Launch coverage such as TechNode's report repeats the spec sheet, not test results. Until scores appear, judge it on your own tasks.
Price and real cost
Alibaba publishes no per-token price for Qwen4-Max-Preview: its only official route is Token Plan, billed in Credits. On AIHubMix the channel bills per token: $0.353 per million input tokens, $1.059 per million output tokens, and $0.0441 per million cached input tokens.
To make that concrete, take one coding-agent session. These are assumptions, not measurements: 40 turns, each sending 60,000 input tokens, of which 50,000 are a cached repository prefix, and each writing 3,000 output tokens, thinking included.
| One session on AIHubMix | Tokens | Price per 1M | Cost |
|---|---|---|---|
| Uncached input | 400,000 | $0.353 | $0.141 |
| Cached input | 2,000,000 | $0.0441 | $0.088 |
| Output, thinking included | 120,000 | $1.059 | $0.127 |
| Total | 2,520,000 | $0.356 |
Estimated at AIHubMix's listed prices for this channel. Cache hits aren't guaranteed, and AIHubMix hasn't measured them on this channel. With no cache hits, the same session costs about $0.974.
Two details move this number in practice. First, thinking counts as output: in AIHubMix's usage data, reasoning tokens are part of completion_tokens, and thinking runs at xhigh by default. Much of those 3,000 output tokens per turn may be reasoning. Second, Alibaba turns on preserve_thinking by default for this model. Earlier turns' thinking that your client sends back in reasoning_content is read by the model, and Alibaba's docs say it "is included in the input token count and is billed." Long agent sessions therefore grow their input faster than the visible conversation suggests.
The max_tokens change: what you'll see and how to fix it
This is the change most likely to break a working integration. Alibaba's API compatibility notice, dated November 2, announced it, and the model page repeats it:
Starting with qwen4-max-preview, max_tokens is equivalent to max_completion_tokens. Both limit the combined tokens for thinking and the final answer. Thinking consumes part of the same budget, so a limit previously sized for the answer alone may truncate output.
On Qwen3.8-Max, max_tokens limits the answer only; thinking sits outside it. Code that sets max_tokens: 300 for a short answer worked there. On Qwen4-Max-Preview the same 300 tokens have to cover the reasoning too.
AIHubMix ran this request on November 11, 2026:
curl -s https://aihubmix.com/v1/chat/completions \
-H "Authorization: Bearer $AIHUBMIX_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "coding-qwen4-max-preview",
"max_tokens": 300,
"messages": [{"role": "user", "content": "How many pairs of positive integers (x, y) with x > y satisfy x^2 - y^2 = 2024? List them."}]
}'
It came back HTTP 200 with nothing to show:
{
"finish_reason": "length",
"content": "",
"usage": {
"prompt_tokens": 56,
"completion_tokens": 300,
"completion_tokens_details": {"reasoning_tokens": 300}
}
}
(Trimmed to the relevant fields.)
All 300 tokens went to reasoning, and the answer never started. Nothing errors, so a client that only reads content sees an empty string and may treat it as a valid reply. With max_tokens: 16384, the same prompt finished normally: 1,206 completion tokens, 608 of them reasoning, and the correct answer (four pairs).
How to fix it:
- Size limits for thinking plus answer. Remove old answer-only caps, or raise them well above what the answer needs. Alibaba marks
max_tokensas "to be deprecated" and recommendsmax_completion_tokensfor new integrations. On this model the two mean the same thing, so renaming alone fixes nothing:max_completion_tokens: 300returned the same empty reply on AIHubMix. - Cap thinking directly when you need a short reply. Set
reasoning_efforttolow, or tononeto turn thinking off. In AIHubMix's test,noneanswered a short coding prompt in 43 completion tokens with no reasoning. - Check
finish_reasonon every call. Treat"length"with an emptycontentas a failure to retry with a larger budget, not as an answer.
Thinking controls worth knowing
Thinking is on by default. Alibaba's Chat Completions reference documents the details:
- Levels:
low,medium, andxhigh(the default). OpenAI-style values are mapped:maxandhighbecomexhigh,minimalbecomeslow, andnoneturns thinking off. Any other value returns an error. - Budgets: if you don't set
thinking_budget, the levels map to thinking budgets of 4,096 (low), 16,384 (medium), and 262,144 (xhigh) tokens. If you set neither, the same page says the default isxhighwith a 131,072-token budget. By that mapping, sendingxhighexplicitly allows up to twice the default thinking budget. This is how the docs describe it; AIHubMix hasn't measured it. - Don't combine: Alibaba documents setting
reasoning_effortandthinking_budgettogether as an error. One AIHubMix test that sent both returned normally, so the channel may not reject the pair, but nothing documents which setting takes effect. Send only one. - Multi-turn: return earlier thinking in each assistant message's
reasoning_contentfield, never insidecontent. Leaving it out doesn't cause an error, but sending it back is billed as input.
Through AIHubMix, low and none were accepted, and the thinking arrived in reasoning_content.
Coding tools
The model is built for coding agents. Here is how it fits the common tools through AIHubMix:
- Claude Code uses the Anthropic Messages API. The AIHubMix model page lists only
/v1/chat/completions, but one test request to AIHubMix's/v1/messageswith this model ID returned a normal response with separate thinking and text blocks. That was a single request without tools, not a Claude Code session. For running Claude Code on non-Claude models, AIHubMix documents a separate setup, Claude Code with any LLM: install its@aihubmix/claude-codepackage, setdefault,think, andlongContextunderRouterin~/.aihubmix-claude-code/config.jsontocoding-qwen4-max-preview, then runacc startandacc code. We haven't run that setup with this model, so try the smoke test below first. Anthropic's documentation doesn't support routing non-Claude models to Claude Code through a gateway, so this setup is unsupported on Anthropic's side. - Qwen Code connects through the OpenAI-compatible endpoint:
OPENAI_BASE_URL=https://aihubmix.com/v1andOPENAI_MODEL=coding-qwen4-max-preview. One catch is visible in Qwen Code's source. Its context-size table gives IDs that start withqwen4a 1M window. Our ID starts withcoding-, matches no row, and falls back to the 200,000-token default. That is a reading of the code, not a measured run. Expect Qwen Code to compact the conversation long before 1M. If you need the full length, setmodel.generationConfig.contextWindowSizeto 1000000 in~/.qwen/settings.json. - OpenCode, Cline, Cursor and other OpenAI-compatible tools: add a custom model with the same base URL and ID. Check two settings in each tool: the context window, which tools often don't know for new IDs, and any default
max_tokensthe tool sends. A small default will now cut into thinking.
A 15-minute smoke test before you trust it with a repository:
- Send one Chat Completions request and confirm
reasoning_contentand a non-emptycontentcome back. - Give the agent a small task in a scratch repository: fix one failing unit test across two files. Success means the tests pass and the diff touches only what it should.
- Watch for
finish_reason: "length"in your tool's logs or its usage view. If it shows up, raise the output limit or lowerreasoning_effort. - Repeat the task at
reasoning_effort: "low"and compare time and output tokens. This tells you which level to run day to day.
Alibaba documents tool calling and structured outputs for this model. AIHubMix hasn't published capability flags for this channel yet, and its model guide says their absence means "unverified, not unsupported." Step 2 is your tool-calling check.
Should you switch?
Test it now if you run coding agents and want to see the next Qwen generation on your own code, or you're deciding whether to plan around Qwen4. At AIHubMix's channel price, a session like the one above costs under a dollar, and Alibaba's preview ends on November 25.
Wait if you need stable behaviour, published benchmarks, or long-term availability. The preview is labelled unstable, and Alibaba retires it when the preview ends. Alibaba hasn't said what comes after the preview, what it will cost, or whether it will behave the same.
Stay on Qwen3.8-Max for production. It has the same 1M context, an official pay-as-you-go price, and no announced retirement date. Your max_tokens settings keep their old meaning there.
If you test both, the side-by-side comparison on AIHubMix lists their specs and prices. You can call either model with the same AIHubMix key; only the model ID changes.
FAQ
Is Qwen4-Max-Preview available through a pay-as-you-go API?
Not from Alibaba, which offers it only through Token Plan subscriptions. AIHubMix was the first platform to offer it per token, under the ID coding-qwen4-max-preview, at $0.353 per million input tokens and $1.059 per million output tokens.
When does Alibaba retire Qwen4-Max-Preview?
Alibaba's preview ends at 24:00 on November 25, 2026 (UTC+8), which is 16:00 UTC. Alibaba says the model will be retired after the preview ends.
Why does my request return an empty response?
Most likely max_tokens is too small. On this model it limits thinking and the answer together, so the reasoning can use up the whole budget. Check for finish_reason "length", then raise the limit or lower reasoning_effort.
What is the context window and maximum output?
Alibaba lists a 1M-token context and up to 393,216 output tokens, with thinking and the final answer sharing the output limit.
How do I turn thinking off or reduce it?
Set reasoning_effort to low or medium to shorten it, or to none to turn it off. Send only one of reasoning_effort and thinking_budget: Alibaba documents combining them as an error, and nothing documents which one takes effect on the AIHubMix channel.
Is Qwen4-Max-Preview better than Qwen3.8-Max?
There's no published benchmark to answer that yet. Alibaba's launch page lists capabilities and limits but no scores, and we found no independent benchmark as of November 11, 2026, so compare the two on your own tasks.
Does it work with Claude Code?
AIHubMix documents a setup for running Claude Code on non-Claude models, which Anthropic doesn't support. With this model we have tested only one request to AIHubMix's Anthropic-compatible Messages endpoint, which returned thinking and text blocks. Run a short smoke test with tools before relying on it for long sessions.
Sources
- Alibaba Cloud Model Studio: Qwen4-Max-Preview (accessed November 11, 2026)
- Alibaba Cloud Model Studio: Chat Completions API reference
- Alibaba Cloud Model Studio: Token Plan (Personal Edition) (accessed November 11, 2026)
- Alibaba Cloud Model Studio: Qwen3.8-Max (accessed November 11, 2026)
- AIHubMix: Coding Qwen4 Max Preview (prices checked November 11, 2026; live tests run 10:22–10:48 UTC)



