Introduction
Qwen4-Max chat endpoint by Alibaba: 1,000,000-token input window, up to 384,000 output tokens, image_url vision input, four reasoning levels, tool calling, and structured JSON output.
| Field | Value |
|---|---|
| Input | Text |
| Output | Text |
| Input budget | 1,000,000 tokens |
| max_tokens ceiling | 384,000 |
| Inputs | text / images |
Key features & highlights
One million tokens of source material in a single turn
Qwen4-Max accepts up to 1,000,000 input tokens across 256 messages, keeping full repositories, specifications, and multi-document dossiers intact without lossy chunking.
Four reasoning levels from none to high
Switch reasoning_effort between none, low, medium, and high per request. Keep routine extraction fast at none or low, and raise depth for architecture reviews and complex debugging.
Images, function calls, and structured JSON together
Mix text and image_url parts in user messages while defining up to 128 tools or a response_format JSON schema for reliable downstream automation.
Request parameters
| Parameter | Required | Description |
|---|---|---|
messages | Yes | Ordered conversation history for Qwen4-Max (up to 256 messages) supporting text and |
max_tokens | No | Maximum combined thinking and visible reply tokens for Qwen4-Max (1 to 384,000, default 4,096). |
reasoning_effort | No | Reasoning depth for Qwen4-Max: none, low, medium, high (default medium), where higher effort uses more output tokens and latency. |
stop | No | One stop sequence or up to four strings (32 characters each) that halt Qwen4-Max output. at least 1 characters · at least 1 items · at most 4 items |
temperature | No | Sampling temperature for Qwen4-Max from 0 to 2, where lower values yield steadier wording. |
top_p | No | Nucleus sampling threshold for Qwen4-Max from 0.01 to 1, tuned independently from temperature. |
tools | No | Up to 128 OpenAI-format function definitions for Qwen4-Max, with argument checks and execution handled by your app. at most 128 items |
parallel_tool_calls | No | Allows Qwen4-Max to propose multiple independent tool calls in a single turn (on by default). Default: |
tool_choice | No | Controls whether Qwen4-Max picks a tool automatically (auto), skips tools (none), requires a call (required), or calls a named function. |
response_format | No | Request plain text or structured JSON output from Qwen4-Max, validating returned JSON in your application. |
Pricing
Input $1.275 / Output $3.825 per 1 million tokens
Use cases
Repository-scale engineering reviews
Pass key source modules, test logs, and design docs together and ask Qwen4-Max for file-referenced defects and an ordered refactor plan.
Visual inspection of diagrams and UI captures
Attach architecture diagrams, charts, or interface screenshots via image_url and request structured findings alongside code fixes.
Long-form technical synthesis
Generate detailed specifications, migration guides, or audit reports using up to 384,000 output tokens with streaming enabled.
Prompt guide & pro tips
Size the output limit for thinking plus answer
Reasoning tokens count inside
max_tokens(default 4,096, ceiling 384,000). Raise the cap whenever you use medium or high effort on long outputs.Keep stable prefixes for prompt caching
Place system instructions and large reference documents early in the message list so repeated queries can reuse cached input tokens.
Validate tool arguments in your code
Define strict JSON schemas for tools, inspect the returned tool calls in your application, and send results back with the matching
tool_call_id.
Overview
Qwen4-Max chat endpoint by Alibaba: 1,000,000-token input window, up to 384,000 output tokens, image_url vision input, four reasoning levels, tool calling, and structured JSON output.
Limits and billing
Qwen4-Max accepts up to 1,000,000 input tokens and 384,000 output tokens (default 4,096), billed per measured token at the live rates on this page.
qwen/4-max/chat
SpicyAPI adds no filter to Qwen4-Max; live testing passed romantic, sensual, artistic nudity (direct/system), graphic horror, and system-framed BDSM, while refusing 7 of 9 explicit erotica prompts and direct/fiction BDSM.
API quick start
curl --fail-with-body -sN https://api.spicyapi.ai/v1/chat/completions \
-H "Authorization: Bearer $SPICY_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"model": "alibaba/qwen-4-max/chat",
"messages": [
{
"role": "user",
"content": "Summarise the following release notes into three bullet points."
}
],
"stream": true
}' \
| jq --unbuffered -Rrj 'select(startswith("data: ")) | .[6:] | select(. != "[DONE]") | fromjson | if .error then "\n[error] \(.error.message)\n" else (.choices[0].delta.content? // empty) end'
See the API reference for authentication, the complete schema, polling, and error handling.

