Qwen4 Max API

Send text, images and video to a flagship reasoning model and get text back with a 1M-token context window

Modalities
Image, Text, VideoText
In / Out price
$1.5/$4.5per 1M
Context window
1M tokens
Released
Nov 15, 2026

Qwen4 Max overview

The pelican test: one prompt, every text model, unedited SVG output from Nov 16, 2026.

SVG of a pelican riding a bicycle, written by Qwen4 Max through AI/ML API

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

Qwen4 Max pricing in US dollars
UsagePriceUnit
Input$1.51M tokens
Output$4.51M tokens
Cached input$0.0751M 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.

AI/ML API model prices in USD per million tokens
ModelInputOutput
Qwen4 Max$1.5$4.5
Qwen3.8 Omni Flash$0.15$0.47
Qwen3.8-Flash$0.16$0.47
Qwen 3.8 27B$0.4761$3.39
Qwen3.8 Max Prime$4.23$12.7

How to use the Qwen4 Max API

View docs

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'

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.

Start building with Qwen4 Max

Qwen4 Max API

alibaba/qwen4-max

Build with your agent

Give your agent the model details, code and documentation.

1Get your API key

Create API key
export 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."
    }
  ]
}'