Qwen4-Max API: pricing, thinking settings, and caching
Qwen4-Max is available through a standard token-priced API. The practical starting point is a 1M-token context, text, image, and video input, and an output budget that includes reasoning as well as the final answer. Before choosing an output cap, decide how much room the model needs to think.
Alibaba's Qwen4-Max model page lists the model as its latest multimodal flagship. On AIHubMix, use qwen4-max with Chat Completions at https://aihubmix.com/v1. The gateway guide lists that endpoint; its detailed capability flags are still unverified. The vendor's broader protocol and feature support does not establish that every option works through this gateway.
The limits to put in your configuration
| Setting | Qwen4-Max |
|---|---|
| Context window | 1,000,000 tokens |
| Maximum input, thinking | 983,616 tokens |
| Maximum input, non-thinking | 991,808 tokens |
| Maximum thinking + answer | 262,144 tokens |
| Maximum non-thinking output | 131,072 tokens |
| Default effort | high |
| Default thinking budget | 131,072 tokens |
The default effort and thinking budget apply when both settings are omitted. The context window is a total capacity constraint, not permission to send a million input tokens and then generate the maximum output on top of them. Use the separate input and output limits when sizing requests.
For Chat Completions, max_tokens and max_completion_tokens mean the same thing on this model: thinking plus answer. Alibaba recommends max_completion_tokens for new integrations. A small answer-only cap can leave no room for the answer once reasoning consumes it. Check finish_reason for length; do not interpret a truncated or empty response as a completed task. This follows the documented contract, not a new measurement of gateway behavior.
Price and a bill you can reproduce
The official Singapore list price is $1.50 per million input tokens and $4.50 per million output tokens, including thinking. Both thinking and non-thinking modes use these ordinary token rates across the listed input range up to 1M. Other deployment regions have different prices.
AIHubMix's model guide lists $1.471 input, $4.412 output, and $0.0735 cached input per million tokens. These are a November 17, 2026, 02:33 UTC snapshot. The following example uses the official Singapore prices so its assumptions are explicit.
Suppose a document task consumes 100,000 uncached input tokens and 10,000 output tokens, including reasoning:
| Item | Tokens | Cost |
|---|---|---|
| Input | 100,000 | $0.150 |
| Thinking + answer | 10,000 | $0.045 |
| Total | 110,000 | $0.195 |
This is a calculated example, not a measured task. It excludes cache writes, tools, retries, and taxes. A short visible answer can still have substantial output usage because reasoning is billed as output. Historical reasoning that the client sends again also increases input usage.
Choose effort or a budget
The Chat Completions reference gives three native effort levels: low, high, and xhigh, with high the default. Compatibility values map as follows: minimal to low, medium to high, and max to xhigh. none disables thinking.
Do not send reasoning_effort and thinking_budget together. An explicit thinking budget must be a positive integer; 0 is invalid. To disable thinking, use the documented thinking control rather than a zero budget.
If only thinking_budget is supplied, 1–4,096 selects low effort, 4,097–131,072 selects high, and 131,073–262,144 selects xhigh, retaining the supplied budget. The output cap still limits the combined reasoning and answer. Effort names are not a substitute for choosing that cap.
For a first integration, keep the default effort and inspect the result. Evaluate a lower effort setting on short tasks and a higher one on difficult tasks; do not assume either improves cost or quality until your own accepted results support it. Parameter passthrough through AIHubMix has not been measured for this article.
Keep the right history
Qwen4-Max enables preserve_thinking by default at Alibaba. In ordinary mode, return historical assistant reasoning in reasoning_content, preserving its association with the answer and tool calls. Do not paste it into content. Returned history counts as input and is billed.
Alibaba also offers thinking summaries and encrypted history. Full reasoning remains the default. With Chat Completions thinking_display="summarized" enabled on every request, reasoning_content becomes a display summary and encrypted_content carries the reasoning history for later turns. Replay ciphertext unchanged; a summary cannot replace it. A streamed ciphertext frame can have no visible text, so a parser must not discard it for that reason.
That is the vendor interface. This article has not verified these summary controls through AIHubMix. Keep your existing raw-history path until your chosen endpoint and client preserve the required fields correctly.
Cache repeated input deliberately
Qwen4 explicit caching can reuse a shared prefix containing system instructions, tool definitions, or reference material. The vendor supports manual breakpoints and automatic breakpoints, with a 5-minute or 1-hour TTL. The minimum prefix is 1,024 tokens, and a request retains at most four valid breakpoints.
Writes are not free: a 5-minute write costs approximately 125% of ordinary input, and a 1-hour write about 200%. Reuse must repay that premium. With no cache parameters, ordinary implicit caching may identify repeated prefixes, but hits are not guaranteed. In the explicit-cache interface, prompt_cache_options.mode="implicit" enables an automatic breakpoint; despite the name, it follows the explicit-cache TTL and billing rules.
Before budgeting around it through AIHubMix, verify parameter forwarding, write/read usage fields, and the applicable gateway rates. A catalog cache-read price alone does not prove a particular cache-control workflow works.
Start with the endpoint you can verify
Send a small Chat Completions request using the documented ID, then check the answer, finish reason, and usage. For an agent, follow that with a task in a disposable repository and verify the tests and diff. Treat vendor support for Responses or Anthropic Messages separately from the gateway path you actually use.
Review the output budget, history handling, and coding-tool settings together before moving an existing agent. A working request is the first checkpoint; an accepted task is the one that matters.
FAQ
What model ID should I use?
Use qwen4-max. AIHubMix documents Chat Completions with that ID.
How much does Qwen4-Max cost?
Official Singapore ordinary input/output prices are $1.50/$4.50 per million tokens. AIHubMix's checked guide lists $1.471/$4.412; cache and tool charges need separate accounting.
Does max_completion_tokens include thinking?
Yes. On this model both max_tokens and max_completion_tokens include thinking and the answer. The thinking-mode combined maximum is 262,144 tokens.
Can I send effort and a thinking budget together?
No. Choose one. A supplied thinking budget must be positive; 0 is invalid. Omitting both defaults to high effort and a 131,072-token thinking budget.
Are summaries returned by default?
No. Full reasoning is the vendor default. Summaries and encrypted history are opt-in and require the enabling parameter on every request and unchanged ciphertext replay.
Can I assume explicit caching works through AIHubMix?
No gateway test is reported here. Verify the controls and billing on the chosen endpoint before relying on repeated cache hits in a cost estimate.
Sources
- Alibaba Cloud: Qwen4-Max.
- Official pricing, Singapore USD list.
- Chat Completions reference.
- Thinking summary and encryption and Qwen4 explicit cache.
- AIHubMix model guide. Sources and prices checked November 17, 2026, 02:33 UTC. No live inference test was run for this article.