Skip to content
One AI API Key
Blog

Qwen4-Max API quickstart: the id, the base URL, streaming, max_tokens and the $43 plan

Qwen4-Max API quickstart: the qwen4-max id, the Qwen Cloud base URL, curl, Python and Node, streaming, max_tokens, Token Plan tiers and the gateway swap.

One AI API Key TeamPublished 14 min read
On this page
One AI API Key poster captured by One AI API Key, showing the gateway signup and the free lane entry point
The gateway route is the one you will switch on last: Qwen4-Max is queued for the catalog, and when it lands, the code below works with the base URL swapped for ours.

Qwen4-Max went live on 2026-11-16, and the fastest way to trust a launch is to call the API yourself. This is the ten-minute version: the exact id to send, the base URL to hit, three working snippets, the two settings that bite beginners, and the Token Plan math including the $43 Pro tier. Every fact here is from Alibaba’s launch material, the Qwen Cloud model page, the Token Plan page or eesel.ai’s review, and anything we could not verify is labelled as unverified rather than guessed.

The id you send is qwen4-max

The GA model id is qwen4-max. The preview id qwen4-max-preview was a different model on a different window: eesel.ai’s review records the preview running 2026-11-11 to 2026-11-25 in the UTC+8 window, then retired, with backend use banned on that id. Two consequences. First, a 404 on the model almost always means the id, not the key. Second, pin your ids: the 3.8 generation taught the market that preview ids and GA ids behave differently, which is why our coding agents setup post leads with the id table and our API key per project guide keeps one key per project.

Thing Value
GA model id qwen4-max
Preview id qwen4-max-preview, retired
Base URL https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1
Auth header Authorization: Bearer $QWEN_API_KEY
Context window 1,000,000 tokens
Input modalities Text, image
List prices $1.50 input, $4.50 output, $0.075 implicit caching per million

Copy the base URL from your own Qwen Cloud console rather than trusting any blog’s host, including this one; regional hosts have varied before. The endpoint is OpenAI-compatible, and eesel.ai’s review also records an Anthropic-compatible format on the preview, so Claude-shaped clients may work, but the OpenAI shape above is the one Alibaba documents.

Qwen4-Max launch announcement · x.com/Alibaba_Qwen · One AI API Key capture 2026-11-16
Alibaba Qwen official X account announcement captured by One AI API Key, launching Qwen4-Max with native vision, a 1M-token context window and Token Plan pricing

First call, three ways

Bash, against Qwen Cloud directly:

call qwen4-max on Qwen Cloud
curl https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer $QWEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen4-max",
    "messages": [{"role": "user", "content": "Refactor this function for readability."}]
  }'

Python with the OpenAI SDK:

qwen4_max.py
import os
from openai import OpenAI

client = OpenAI(
    api_key=os.environ["QWEN_API_KEY"],
    base_url="https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
)
resp = client.chat.completions.create(
    model="qwen4-max",
    messages=[{"role": "user", "content": "Explain this stack trace."}],
)
print(resp.choices[0].message.content)

Node with the same SDK:

qwen4_max.mjs
import OpenAI from "openai";

const client = new OpenAI({
  apiKey: process.env.QWEN_API_KEY,
  baseURL: "https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1",
});

const resp = await client.chat.completions.create({
  model: "qwen4-max",
  messages: [{ role: "user", content: "Explain this stack trace." }],
  max_tokens: 4096,
});
console.log(resp.choices[0].message.content)

A 401 means the key or entitlement is wrong. A 404 on the model means the id, and qwen4-max is not qwen4-max-preview. A 429 means you hit a rate limit, and the errors guide explains what each status means before you retry.

The two settings that bite beginners

Streaming. Enable it. Long reasoning arrives token by token and your UI stops looking broken, which our streaming guide and the streaming versus non-streaming post both cover in detail.

max_tokens. Set it deliberately. A reasoning model can spend its output budget thinking before it answers, and the preview build shared one ceiling, 393,216 tokens, between thinking and answer per eesel.ai’s review, with thinking effort defaulting to xhigh. Our reasoning docs explain the effort knobs; the short version is that a small max_tokens on a high-effort model returns a truncated thought, not a shorter answer.

Image input rides the same chat endpoint:

send an image
curl https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1/chat/completions \
-H "Authorization: Bearer $QWEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
  "model": "qwen4-max",
  "messages": [{"role": "user", "content": [
    {"type": "text", "text": "What is wrong with this screenshot?"},
    {"type": "image_url", "image_url": {"url": "https://example.com/ui.png"}}
  ]}]
}'

Structured output and JSON mode are listed on the preview’s capability sheet per the same review, and our vision benchmarks post separates what native vision actually wins, because Chartography and Video-Index both went to GPT-6 Astra on Alibaba’s own table.

Qwen Cloud playground · qwencloud.com · One AI API Key capture 2026-11-16
Qwen Cloud playground captured by One AI API Key, with Qwen4-Max selected and a chat turn in progress

The Token Plan, including the $43 tier

Qwen Cloud’s Token Plan sells subscriptions on top of pay-as-you-go:

Tier Monthly $ Yearly $/mo Credits Agents
Lite $3 $8 20,000 1-2
Essential $5 $16 45,000 2-3
Standard $18 $25 80,000 3-4
Pro $43 $51 200,000 6-8

The Pro tier is the $43 plan every launch-day thread mentions. Whether it is the best deal for you depends on the credit burn rate, and Alibaba has not published that rate for the GA id, so any monthly-cost claim built on credits is an estimate, including ours. What is published is the per-token table, and the honest budget is built from it: at list, 12.4M input and 3.1M output tokens a month is $32.55 pay-as-you-go, which is the workload our pricing post prices four ways. The launch page also advertises 78% more credits and an 80% Off tag on the yearly columns, and eesel.ai records preview credit burn at 20% of the standard rate, 8% off-peak in Beijing hours, both preview-era and both subject to change. Our own unlimited plan at $$25 a month covers every listed model at no per-token cost, which is the one budget where caching and credits stop mattering.

The gateway swap, when it lands

Qwen4-Max is queued for our model catalog, queued the way every Alibaba flagship is queued: a published rate below list, per-key limits and per-request metering. The day it lands, the same code works with two edits:

base_url="https://api.oneaiapikey.com/v1"
model="qwen4-max"   # same id, our endpoint, your existing key

Until then the honest routes are Qwen3.8 Max at $0.577 / $1.73, the cheapest 1M-context flagship we sell, the abliterated qwen3.8-max-0902-uncensored:free on the free lane, and the Groq 27B lane at 1,000 requests a day. When you switch, read the Anthropic-format guide if your client speaks Claude, and the glossary if the token rows on your first bill look unfamiliar.

One AI API Key banner captured by One AI API Key, showing the gateway value proposition beside the Qwen4-Max queue note
What the swap buys you: a published rate, per-key limits, per-request metering and a usage log that shows exactly what you burned, which is how you catch a launch-day price surprise before the bill does.
Qwen Cloud model marketplace · qwencloud.com · One AI API Key capture 2026-11-16
Qwen Cloud model marketplace captured by One AI API Key, showing Qwen4-Max among the models reachable from the studio

Log four fields on every request

Model id, input tokens, cached tokens, cost. Those four catch the three ways a launch goes wrong: cached reads stuck at zero, a model row that bills cached tokens at full input price, and a cheaper route that quietly downgrades quality. The usage log shows all four per request, the cache page shows the split, and our Qwen4-Max caching guide is the ten-minute version of why the cache row decides your bill. The cost calculator turns your own token counts into dollars before you commit, and the new-customer console guide walks the keys and billing screens.

Want this metered on your key instead of Qwen Cloud’s? Qwen4-Max is queued for the catalog at a published rate below list; every model here gets per-key limits and per-request metering on day one.

What Artificial Analysis, LMArena and the community are saying

As of 2026-11-16, neither Artificial Analysis nor LMArena publishes a Qwen4-Max row, and BenchLM documents the evidence gap explicitly: specifications, pricing, context, no source-displayable benchmark rows beyond Alibaba’s own table. MindStudio’s hands-on piece is qualitative: animation generation, 82-language naming, satellite image reasoning and visual safety judgment. The Pandaily X thread leads with the Agents’ Last Exam score of 46.7 and the caching price cut. kingy.ai’s Sol head-to-head is the only independent measurement we have seen, and it is one synthetic repetition with unblinded AI grading. What is worth watching, not quoting: the speed column, because a model that is cheaper and three times slower is not automatically the better deal for an agent under latency budget. Our rankings track real gateway throughput for every model we serve.

Mistakes to avoid

  • Sending the preview id. qwen4-max-preview was retired with the preview window. A 404 on the model is almost always this.
  • Trusting a blog’s base URL. Yours may differ by region. Copy it from your own console.
  • Leaving max_tokens small on xhigh effort. You get a truncated thought, not a shorter answer.
  • Budgeting on credits without a burn rate. Alibaba has not published one for the GA id. Budget on the per-token table.
  • Skipping streaming on long reasoning. The UI looks dead for a minute otherwise.
  • Comparing list price to gateway price. The cheapest published rate is not the rate you pay; it is the rate your gateway charges, as our Sol post shows at $0.70 / $3.50.

FAQ

What is the model id?

qwen4-max on Qwen Cloud’s OpenAI-compatible endpoint. qwen4-max-preview is the retired preview id, a different model.

What does it cost?

List: $1.50 per million input, $4.50 per million output, $0.075 per million implicit cache reads. Our gateway rate is pending; Qwen3.8 Max runs $0.577 / $1.73 today.

Does it stream?

Yes, enable streaming on the chat completions call; our streaming docs cover the wire format and the SSE post covers pushing it to a browser.

What is the $43 plan?

The Token Plan Pro tier: $43 monthly or $51 yearly-billed monthly, 200,000 credits, 6-8 agents. Credit burn per token is unpublished, so the per-token table is the verifiable budget.

Is it on One AI API Key yet?

Queued. The same code will work with the base URL swapped for ours and the key you already have, with per-key limits and metering from day one.

What runs today that is close?

Qwen3.8 Max at 1M context, the free uncensored lane, the Groq 27B lane and, for multimodal input including audio and video, Gemini 4 Argon.

The bottom line

Call it with qwen4-max on the Qwen Cloud compatible endpoint, stream it, set max_tokens on purpose, budget on the per-token table and not on credits, and log four fields per request. The launch claims, including ~50% fewer tokens and over 60% lower cost per task, are Alibaba’s internal evaluation with an unpublished workload: direction, not a bill. When the model lands on our gateway your code changes by one line, and until then Qwen3.8 Max and the free lanes hold the route. The benchmark explainer tells you what it scores; this post is how you run it.

Keep reading: the sixteen-benchmark explainer, Qwen4-Max vs GPT-6 Astra, Qwen4-Max vs GPT-6.1 Sol, Qwen4-Max vs Claude Opus 5.5, Qwen4-Max vs Qwen3.8-Max-0902, Qwen4-Max vs Kimi K3, the prompt caching guide, the $43 Token Plan analysis, the coding agents setup, and the cheapest way to run it.

Troubleshooting: the four failures you will actually hit

The launch-week support threads repeat the same four problems, and each one has a boring fix.

A 401 means the key or the entitlement is wrong, not that the model is missing. Qwen4-Max ships under the Token Plan, so a pay-as-you-go key from another product will not unlock it. Send it as Authorization: Bearer <key> on every request, and copy the base URL from your own console rather than from any blog, including this one.

A 404 on the model is almost always id drift. qwen4-max is the GA id; qwen4-max-preview is retired, and the preview-era aliases behave differently now. A 404 that names the endpoint instead of the model is a base URL problem, usually the regional host: Alibaba’s regions have served different hosts before, so verify yours in the console before you paste it into an env file.

A 429 is the concurrency tier, not a ban. Token Plan tiers carry per-key rate limits, and our gateway adds its own per-key limits on top; the two multiply. Read the shape of the error in our rate limits docs and the key’s ceilings in the console before you retry, because a blind retry loop turns one 429 into a thousand.

A silent or starving stream is the reasoning budget. The default thinking level is xhigh, and a reasoning model can spend its output budget thinking before it answers, so the first token arrives late even though the connection is fine. Set max_tokens deliberately, keep streaming on so partial reasoning arrives token by token, and read the reasoning-token split in the reasoning docs. The ceiling is 393,216 tokens shared between thinking and answer, so a huge max_tokens does not buy more room than that.

The last failure is the bill, not the API. Cache reads cost $0.075 per million, cached input is billed separately from ordinary input, and the Token Plan credit burn rate is still unpublished, so convert credits to dollars from your own usage log, never from the plan page. When you move to the gateway, the swap is two lines: our base URL and the same model id, after which every model in the catalogue gets a published rate, per-key limits and per-request metering. Run the cost calculator on your real prompt sizes before you commit a workload to any of this.

One more habit from launch week: pin the id. The 3.8 generation proved that preview ids and GA ids behave differently, and Qwen4-Max is no exception. qwen4-max-preview may still answer on some hosts, but it bills under preview rules, while qwen4-max is the GA row our cluster links to. Log the id with every request, re-run your eval when the catalogue row goes live, and treat any price that moved without an announcement as a reason to re-run the numbers, not to grumble.

If the bill matters, wire the alarms before the workload. Low-balance alerts and signed webhooks email you before a runaway loop empties the account, and a spend limit per project turns a billing accident into a clean 402. Both live in the console today, both take ten minutes, and both are cheaper than the first surprise invoice.

One more thing while qwen4-max is upstream-only: rehearse the harness on the free lanes first. The Qwen3.8 27B lane answers today at $0, and a harness that runs there migrates to qwen4-max with the model field changed. Keep the prompt template, the few-shot prefix and the temperature identical across that move, because a clean before-and-after is the only eval you will trust when the metered row goes live. Log the same four fields on both runs and the comparison writes itself. Pin the id twice as well, once in the env file and once in the eval notes, because preview-era drift is exactly what breaks a before-and-after. Re-run the whole eval the week the gateway row lands, since list prices move, and so does the ranking. Meter it, then decide.

More Qwen4-Max coverage

The Fable comparison, added 2026-11-16:

More in Blog

Try it

One API key for Claude, GPT, Grok, DeepSeek, Kimi, Qwen, GLM, MiniMax, Step, Crow, Dots, Beam, Nemotron, Jailbreak, MiMo, Gemini, Muse and Mistral.

One AI API Key speaks the OpenAI and Anthropic formats, so you change the base URL and the key, not your code. Credit packs start at $10, and every model has a published per-token rate.