> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Qwen4-Max Is Live at Provider Pricing

> Alibaba's Qwen4 flagship is live on APIYI with a 2.4T backbone, native vision and 1M context at $1.50 input and $4.50 output per 1M tokens. Three endpoints, four groups, near-1M testing and integration guidance included.

## Highlights

* **Production Qwen4 flagship**: Alibaba released `qwen4-max` on 16 November with a 2.4T backbone, 71B activated parameters per token, native vision and 1M context
* **Lower cost per task**: the official Work360 average cost fell from \$4.43 to **\$1.67**, a 62％ reduction
* **Provider pricing on APIYI**: \$1.50 input, \$4.50 output and \$0.075 cached input per 1M tokens, with eligible top-up bonuses
* **Three endpoints, four groups**: Chat Completions, Responses and Messages are open across Default, SVIP, CodexResponses and ClaudeCode
* **Measured, not repeated**: 325 pre-release calls plus 15 Default-group release checks; a 951,498-token request recalled markers from both the middle and end

> [!NOTE]
>
> Information verified on 2026-11-17 (UTC+8). Primary sources: Qwen's announcement at `qwen.ai/blog?id=qwen4-max` and the QwenCloud model page at `qwencloud.com/models/qwen4-max`. APIYI pricing comes from the public pricing API, with test evidence collected on the same day.

## Background

Qwen4-Max is the first flagship in the Qwen4 family. Its target is not just higher scores on isolated reasoning questions, but sustained professional work: reading large codebases, analyzing long documents, using tools, and iterating from execution feedback.

Two themes define this generation: **native multimodality** and **long-horizon execution**. Text, image and video input share a 1M context window. Alibaba also introduced Live Delivery, where a long-running agent provides a usable version early and then expands it through user feedback rather than returning only at the end.

APIYI listed `qwen4-max` on 17 November. Alongside provider-aligned pricing, we tested long context, tool calling, structured output, caching and all three endpoint formats.

## Deep dive

### Architecture: balancing capacity and inference cost

> [card] GDN + QSA
>
> Gated DeltaNet compresses history into fixed-size states, while Qwen Sparse Attention selects relevant context at micro-block granularity to reduce long-sequence attention and indexing costs.

> [card] Gated Residual
>
> Four parallel residual branches use dynamic read and write gates to improve information flow, model capacity and training stability.

> [card] N-gram Embedding
>
> Context-based lookups add local token-pattern representations. The extra 328B parameters increase capacity with little additional inference computation.

The backbone has 2.4T parameters with 71B activated per token. Alibaba reported no loss spikes during training. Across internal knowledge, code, QA and STEM evaluations, Qwen4-Max-Base reduced bits per byte by roughly 5％–13％ over Qwen3.8-Max-Base while activating about 25％ fewer parameters.

### Official efficiency results: savings beyond token rates

| Metric | Official Qwen4-Max result |
| - | - |
| Work360 score | **52.69**, versus 47.74 for Qwen3.8-Max |
| Work360 token usage | About **24％** lower at Xhigh and **35％** lower at High |
| Terminal-Bench 4.0 token usage | About **48％ / 49％** lower at Xhigh / High |
| Work360 average cost per task | \$4.43 → **\$1.67**, down **62％** |

The last two rows matter most: cost depends on both the price per million tokens and the number of tokens required to finish a task. Qwen4-Max reduces both, producing Alibaba's reported task-level savings.

### Official specifications

| Item | QwenCloud specification |
| - | - |
| Model ID | `qwen4-max` |
| Context | 1M tokens |
| Maximum input | 991K tokens; 983K in thinking mode |
| Maximum output | 131K tokens; 262K in thinking mode |
| Maximum reasoning budget | 262K tokens |
| Input / output | Text, image and video input; text output |
| Provider TPM | 5,000,000 tokens/min; not an APIYI rate-limit commitment |

### APIYI testing: near-1M context and three endpoints

We ran 325 pre-release calls covering capabilities, parameters and error boundaries, followed by 15 release checks with a Default-group token.

* **Near-1M recall**: **951,498 input tokens** returned in 92.3 seconds, with both mid-document and tail markers recalled correctly
* **Long-context coverage**: 8K, 32K and 128K recall passed on all three endpoints; a 32K release check also passed
* **Tool calling**: single, parallel, named and streaming calls worked with full tool-result replay; Responses has a `tool_choice="required"` exception noted below
* **Multimodality**: image OCR, two-image color and shape recognition, and video descriptions were correct
* **Structured output**: strict JSON Schema passed on Chat and Responses, including parseable streamed JSON
* **Stability**: 12/12 Chat requests succeeded at 12-way concurrency, and long streams ended cleanly on all three endpoints

### Choosing an endpoint and group

| Usage | Endpoint | Recommended group |
| - | - | - |
| General OpenAI-compatible calls | `/v1/chat/completions` | Default, SVIP |
| Codex / Responses clients | `/v1/responses` | CodexResponses |
| Claude Code / Anthropic-compatible clients | `/v1/messages` | ClaudeCode |

These are client-specific recommendations, not restrictions on other groups. Minimal requests on all three endpoints also passed with a Default-group token. Each token's available groups are governed by its console configuration.

## Getting started

### Recommended scenarios

* **Codebase analysis and coding agents**: read project context at scale, then return tool results for further execution
* **Legal, financial and medical document analysis**: combine long documents and images while retaining evidence locations
* **Structured extraction**: constrain fields with JSON Schema rather than parsing free-form text
* **Long-horizon research and content production**: deliver a usable draft, then revise through iterative feedback

### Quick start

```python theme={null}
from openai import OpenAI

client = OpenAI(
    api_key="sk-your-api-key",
    base_url="https://api.apiyi.com/v1",
)

resp = client.chat.completions.create(
    model="qwen4-max",
    messages=[{
        "role": "user",
        "content": "Analyze this codebase's structure and recommend changes.",
    }],
    reasoning_effort="xhigh",
    max_tokens=4000,
)

print(resp.choices[0].message.content)
```

Use `reasoning_effort="none"` for everyday chat or structured extraction to reduce reasoning tokens; select a higher tier for complex reasoning.

### Four integration notes

> [!WARNING]
>
> **`max_tokens` includes reasoning and visible output.** A small budget can be consumed entirely by reasoning, producing HTTP 200 with empty content. Increase the budget for complete answers, and use `reasoning_effort` to control cost.

1. **Forced tools on Responses**: provider testing ignored `tool_choice="required"`; use a named tool or Chat Completions instead.
2. **Structured output on Messages**: OpenAI-style `response_format` has no effect and `max_tokens` is required. Use tool calling for strict structures.
3. **Basic JSON mode**: `json_object` guarantees parseable JSON, not a top-level object or a field structure. Use `json_schema` for strict requirements.
4. **Cache accounting**: API usage is not a billing statement. Verify hits and discounts in the individual console log's billing detail.

## Pricing and availability

### Pricing

Per 1M tokens before top-up bonuses:

| Item | APIYI | QwenCloud International |
| - | -: | -: |
| Input | **\$1.50** | \$1.50 |
| Output, including reasoning | **\$4.50** | \$4.50 |
| Cached input | **\$0.075** | \$0.075 |

Prices match the international Qwen4-Max provider site and may change. Check [Model pricing](https://docs.apiyi.com/en/models/index.md) for current rates.

### Top-up promotions

[Top-up bonuses](https://docs.apiyi.com/en/faq/recharge-promotions.md) of 10％–20％ provide an effective rate of roughly 83–91％ of list price. The bonus tier depends on a single top-up amount and does not change the model's listed unit price.

## Summary and recommendation

Qwen4-Max is a strong candidate for long-document, multimodal and tool-driven agent workloads. Its main advances are architectural efficiency, long-horizon execution and professional deliverables rather than a single leaderboard result. Alibaba's reported 62％ lower average task cost is a reminder to evaluate both token rates and task token consumption.

Use Chat Completions for general integrations, CodexResponses for Codex, and ClaudeCode for Claude Code. Disable thinking for routine calls, raise it for complex reasoning, and use JSON Schema for strict structures. See the [Qwen4-Max Overview](https://docs.apiyi.com/en/api-capabilities/qwen-4/overview.md) for full parameters and test notes.

> [!NOTE]
>
> Sources: Qwen's official announcement at `qwen.ai/blog?id=qwen4-max` and the QwenCloud model page at `qwencloud.com/models/qwen4-max`, retrieved 2026-11-17 (UTC+8). APIYI findings cover 325 pre-release calls and 15 Default-group release checks. Official benchmark figures are provider-published and were not independently rerun.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.