· 6 min read
Qwen4-Max API: pricing, thinking controls and migration
Qwen4-Max is Alibaba's new 1M-context flagship. How its API, thinking controls, flat pricing and caching work, and what changes from the preview.

Qwen4-Max is Alibaba's new flagship model in Model Studio, released on 16 November 2026 under the API ID qwen4-max. It takes text, images and video as input, returns text, and has a 1,000,000-token context window with thinking turned on by default. In the international (Singapore) region it costs $1.50 per million input tokens and $4.50 per million output tokens, and that one rate covers the full context window.
This post covers what the model is, how its thinking controls work, what a request actually costs, and what to check if you were calling the preview.
What is Qwen4-Max?
Qwen4-Max is a closed-weight multimodal model served through Alibaba Cloud Model Studio, Alibaba's hosted platform for its Qwen models. It replaces qwen4-max-preview, which was listed a few days earlier and retired on 25 November 2026. Requests that still name the preview are routed to qwen4-max automatically and billed at the standard rate, so the preview's limited-time discount is gone.
The main specs from the model's documentation page:
- Context window: 1,000,000 tokens.
- Maximum input: 991,808 tokens, or 983,616 with thinking on.
- Maximum output: 131,072 tokens, or 262,144 with thinking on.
- Inputs: text, image and video. Output is text. Audio is not listed.
- Features: streaming, function calling, parallel tool calls, JSON Object and JSON Schema structured output, prefix completion and built-in web search.
- Not supported: fine-tuning and custom deployment.
There is no dated snapshot ID on the page, only qwen4-max. If you need a model that never changes underneath you, keep an eye on the release notes, because the alias is the only handle you get.
How do you call Qwen4-Max?
The model speaks four protocols: OpenAI Chat Completions, OpenAI Responses, Anthropic Messages and Alibaba's own DashScope API. For most code, that means you change a base URL and a model name and keep your existing SDK.
The Singapore endpoint uses a workspace-specific host. A workspace is the Model Studio project your API key belongs to, and its ID goes into the domain:
from openai import OpenAI
client = OpenAI(
api_key="YOUR_MODEL_STUDIO_KEY",
base_url="https://YOUR_WORKSPACE_ID.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
)
resp = client.chat.completions.create(
model="qwen4-max",
messages=[{"role": "user", "content": "Summarize this changelog in three bullets."}],
extra_body={"enable_thinking": False},
)
print(resp.choices[0].message.content)
enable_thinking is not a standard OpenAI parameter, so the Python SDK needs it inside extra_body. The older dashscope-intl.aliyuncs.com domain still works for Singapore, but the docs recommend moving to the workspace domain. Other regions follow the same pattern with their own region code, such as us-east-1 for Virginia and eu-central-1 for Frankfurt.
How does thinking work on Qwen4-Max?
Thinking, meaning the model writes out a reasoning trace before its final answer, is on by default. The defaults are enable_thinking: true, reasoning_effort: high and a thinking budget of 131,072 tokens. Reasoning tokens are billed as output, so a short answer can still produce a long bill.
You have two levers:
- Turn it off. Send
enable_thinking: falsefor classification, extraction, routing and other calls where a trace adds cost and latency but no accuracy. - Set the effort. With Chat Completions,
reasoning_effortacceptslow,highandxhigh. The Responses API usesreasoning.effort, and the Anthropic-style endpoint usesoutput_config.effort. Values from other vendors are mapped:minimalbecomeslow,mediumbecomeshigh, andmaxbecomesxhigh.
That mapping is worth remembering if you share one client across providers. Code that sends medium will not fail, but it will run at high, which is the more expensive setting.
The sampling defaults also change with the mode. Thinking uses a temperature of 1.0 and top_p of 0.95; non-thinking uses 0.7 and 0.8. If you hard-code a temperature tuned for another model, you are overriding values Alibaba picked for each mode.
Qwen4-Max can also return a summarized trace with an encrypted copy of the full reasoning. In multi-turn conversations you pass the encrypted part back unchanged, the same way you pass back tool call IDs.
How much does Qwen4-Max cost?
Prices are per million tokens and depend on the region:
| Region | Input | Output |
|---|---|---|
| Singapore (international) | $1.50 | $4.50 |
| Virginia (US) | $1.50 | $4.50 |
| Beijing, Hong Kong, Frankfurt, Tokyo | $1.413 | $4.24 |
Every row has a single tier from 0 to 1M input tokens. There is no long-context surcharge, so a request does not suddenly get more expensive when your agent's history crosses a threshold. That is different from models that double the rate past a cutoff, as covered in the post on GPT-6.2 Astra and Sol pricing. The Singapore region also lists a free quota of 1 million tokens, valid for 90 days.
With flat pricing, cost scales linearly with input:
def qwen4_max_cost(input_tokens, output_tokens, inp=1.50, out=4.50):
return (input_tokens * inp + output_tokens * out) / 1e6
print(qwen4_max_cost(200_000, 4_000)) # 0.318
print(qwen4_max_cost(300_000, 4_000)) # 0.468
print(qwen4_max_cost(800_000, 4_000)) # 1.218
Remember that output_tokens includes thinking. A 4,000-token answer with a 20,000-token trace is billed as 24,000 output tokens.
Caching. Both implicit and explicit prompt caching are supported. Explicit caching lets you mark the stable prefix of a prompt, such as a system prompt and tool definitions, so later requests reuse it. The prefix must be at least 1,024 tokens. There are two time-to-live options: 5 minutes (the default) and 1 hour. Writing to the 5-minute cache costs about 125% of the input price, and the 1-hour cache costs about 200%. At Singapore rates that is roughly $1.88 and $3.00 per million tokens written. The 1-hour option pays off only when the same prefix is read many times within that hour. The same breakpoint logic applies here as in GPT-6 prompt caching: put the stable content first and the changing content last.
Batch inference is listed for the Beijing region only, at about half the standard rate.
What should you check before switching?
- Preview users: nothing breaks, but your bill goes up once the discount ends. Update the model ID to
qwen4-maxso your logs match what you are billed for. - Thinking defaults: if you migrated from a model with thinking off by default, set
enable_thinkingexplicitly. Otherwise every request pays for a trace. - Effort values: check which effort strings your shared client sends, because unknown names are mapped rather than rejected.
- Region: pick the region before you write any config. The host, the price and the rate limits all depend on it.
- Rate limits: Singapore starts at 5,000,000 tokens per minute at the first spend level. Virginia's dedicated endpoint is lower, at 15,000 requests and 3,000,000 tokens per minute.
Key takeaways
- Qwen4-Max (
qwen4-max) is Alibaba's closed flagship: 1M context, text, image and video input, thinking on by default. - It works with OpenAI Chat Completions, OpenAI Responses and Anthropic Messages, so switching is mostly a base URL change.
- Pricing is flat across the full context: $1.50 in and $4.50 out in Singapore, slightly lower in Beijing and several other regions.
- Turn thinking off with
enable_thinking: falsefor simple calls, and note thatmediumeffort maps tohigh. - The preview is retired and routes to the standard model at the standard price.
FAQ
Is Qwen4-Max open source?
No. Qwen4-Max is available only through Alibaba Cloud Model Studio, and its weights are not published.
Can I use the OpenAI SDK with Qwen4-Max?
Yes. Point the SDK at your region's compatible-mode/v1 base URL and use qwen4-max as the model name. Qwen-specific options like enable_thinking go in extra_body in Python.
Does Qwen4-Max charge more for long prompts?
No. Each region has one price for the full range up to 1M input tokens, so cost grows in a straight line with prompt size.