Qwen4 Max overview
Qwen4 Max by Alibaba Cloud
Alibaba Cloud built Qwen4 Max as the flagship of its Qwen4 series. It combines text generation, image understanding, video understanding and deep reasoning.
Qwen4 Max specs
- Model ID
alibaba/qwen4-max- Developer
- Alibaba Cloud
- Context window
- 1,000,000 tokens
- Max output
- 262,144 tokens
- Input
- Image, Text, Video
- Output
- Text
- API
- OpenAI-compatible, base URL
https://api.aimlapi.com/v1
Built for coding and agent work
Alibaba Cloud recommends the model for coding, office productivity, frontend design and complex agentic tasks. On this endpoint it supports tools, parallel tool calls, structured output and streaming.
The 1M-token context window lets one request carry a large codebase or a long document. A single response can run up to 262,144 tokens. Test with a long input from your own data before you rely on the full window.
Set reasoning effort first
Reasoning is on by default. The reasoning effort option accepts none, low, high or xhigh. Lowering it gives faster responses and fewer tokens spent on reasoning.
Start with low for chat and extraction, then raise it to high for coding and multi-step agent tasks. Use none when you want no reasoning. Compare the same prompt at two settings and check whether the answer improves enough to justify the wait.
Plan around the preview period
Alibaba Cloud lists the model as a preview. It is scheduled for retirement after the preview period ends on November 25, 2026. Keep a set of test prompts so you can rerun them on another model before that date.
Use cases
Review a large codebase in one request and propose a refactor.
Describe what happens in a video clip and answer questions about it.
Run an agent that calls several tools in parallel and returns structured output.
Draft frontend layouts and office documents from a text brief and screenshots.
Capabilities
- Reasoning
- Streaming
- Structured outputs
- Function calling
- Vision
Qwen4 Max API pricing
| Usage | Price | Unit |
|---|---|---|
| Input | $1.5 | 1M tokens |
| Output | $4.5 | 1M tokens |
| Cached input | $0.075 | 1M tokens |
Prices from the AI/ML API price list, checked on Nov 16, 2026.
Qwen4 Max vs other models: token prices
AI/ML API input and output rates for 5 models, per million tokens.
| Model | Input | Output |
|---|---|---|
| $1.5 | $4.5 | |
| $0.15 | $0.47 | |
| $0.16 | $0.47 | |
| $0.4761 | $3.39 | |
| $4.23 | $12.7 |
How to use the Qwen4 Max API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/chat/completions' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "alibaba/qwen4-max",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "alibaba/qwen4-max",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}
response = requests.post("https://api.aimlapi.com/v1/chat/completions", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/chat/completions", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "alibaba/qwen4-max",
"messages": [
{
"role": "user",
"content": "Write a haiku about the ocean."
}
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Qwen4 Max FAQ
How much does Qwen4 Max cost?
Qwen4 Max costs $1.5 / 1M tokens for input and $4.5 / 1M tokens for output on AI/ML API. Cached input is billed at $0.075 / 1M tokens.
Which input types does Qwen4 Max accept?
It accepts text, image and video inputs. The output is always text.
How do I turn reasoning off?
Reasoning is enabled by default. Set the reasoning effort option to none to turn it off.
How long can a single response be?
The maximum output is 262,144 tokens per response. Streaming is supported if you want to read the text as it is generated.
Is Qwen4 Max a permanent model?
Alibaba Cloud lists it as a preview that is scheduled for retirement after the preview period ends on November 25, 2026.
What is the Qwen4 Max model ID?
Use alibaba/qwen4-max as the model parameter. Requests go to the OpenAI-compatible endpoint with your AI/ML API key.
What is the context window of Qwen4 Max?
Qwen4 Max accepts up to 1,000,000 tokens of context and returns up to 262,144 output tokens.