All postsSHORT2 min read
Qwen4-Max in Claude Code: Cheaper Tokens, Bigger Bill?
Qwen4-Max's Claude Code setup, token prices, and the Artificial Analysis benchmark where Opus 5.5 cost less per task.
Qwen4-Max has cheaper tokens than Claude Opus. But in one independent benchmark, Opus did the work for less. Alibaba's new flagship runs inside Claude Code. Before switching for savings, compare the bill for your own finished tasks.
What it is
Qwen4-Max is Alibaba's proprietary flagship Qwen model, launched Nov 16, 2026. It's built for coding and agent tasks, with text, image and video input and text output. Alibaba lists a 1M-token context window.
It supports Anthropic's Messages API. Alibaba also publishes a Claude Code setup guide, so the swap comes down to a few environment variables in the editor workflow you already use.
How to put it in Claude Code
Follow Alibaba's Claude Code guide for authentication and the endpoint for your setup. The guide lists ANTHROPIC_AUTH_TOKEN, ANTHROPIC_BASE_URL, ANTHROPIC_MODEL and the default model variables.
For the guide's Token Plan endpoint, these are the endpoint and Qwen4-Max Opus-slot settings:
export ANTHROPIC_BASE_URL="https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic"
export ANTHROPIC_DEFAULT_OPUS_MODEL="qwen4-max"
export CLAUDE_CODE_MAX_CONTEXT_TOKENS=983616
These settings accompany the guide's authentication setup. Supply your own Model Studio credential through ANTHROPIC_AUTH_TOKEN as directed there. The guide's Token Plan example maps the Opus slot to qwen4-max-preview, but its Qwen4-Max note says to use qwen4-max and keep the context setting at 983616.
For pay-as-you-go in Singapore, the guide gives a workspace-specific endpoint instead:
https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/apps/anthropic
Use the endpoint for your setup. The token prices below are the published API rates. Verify the configuration with the guide's command:
claude -p "Hello"
Token prices
Alibaba's pricing page lists these International rates for Qwen4-Max in thinking and non-thinking modes. The Opus rates come from Anthropic's API pricing.
| Model | Input per 1M tokens | Output per 1M tokens |
|---|---|---|
| Qwen4-Max | $1.50 | $4.50 |
| Claude Opus 5.5 | $4 | $20 |
Those rates price tokens. To choose a model for your work, also measure cost per finished task and check what passed.
The benchmark catch
On the independent Artificial Analysis Intelligence Index, the comparison looks like this:
| Model | Tested effort | Index score | Cost per task |
|---|---|---|---|
| Qwen4-Max | xhigh | 43 | $3.27 |
| Claude Opus 5.5 | medium | 48 | $2.45 |
Artificial Analysis called Qwen4-Max very verbose: it generated 127M tokens during the evaluation, against a 78.6M median. In this comparison, Opus at medium scored higher and cost less per task.
Qwen was tested only at xhigh, its highest effort setting. Alibaba's API defaults to high, so this run used a setting above the default. The models weren't tested at matching effort settings in this comparison.
It's one benchmark, using Artificial Analysis's tasks. It doesn't tell you which model will cost less on your workload. Run your own tasks before choosing a route.
The builder angle (my opinion, no income guaranteed)
I'd sell a model cost audit for a dev team. Run their real tasks through Claude Code on Qwen4-Max and Opus. Report cost per finished task alongside a pass/fail check, then set up routing based on those results.
My recommendation: agree on what counts as a pass before running the audit. Give the team the results and the routing setup as the deliverable. That's a proposed service, with no income guaranteed.
Daily email
Get each breakdown in your inbox.
One email each evening, right after the Short goes live: the AI tool it covers, the full write-up with sources, and how to get paid for it. Free, and you can unsubscribe anytime.