Call Qwen4-Max and other Qwen models from your own apps through QwenCloud, Alibaba's model platform. If you've used the OpenAI SDK, you already know how: change the base URL, the key and the model name.
Sign in at qwencloud.com with GitHub or an email code. New accounts get about 1M free tokens per model for 90 days (Singapore region).
Open API Keys in the console and select Create API key. Keys only work in the region where you created them.
Put it in an environment variable: export DASHSCOPE_API_KEY="sk-ā¦". Never commit it or ship it in front-end code.
Install the OpenAI SDK (pip install openai or npm i openai) and run the example below.
Pick your language and options to get working code.
Uses the Singapore endpoint. For other regions, swap in that region's base URL and key.
| What | Value | Notes |
|---|---|---|
| OpenAI-compatible base URL (Singapore) | https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1 | Use with any OpenAI SDK. Don't add /chat/completions to the base URL. |
| Other regions | Replace ap-southeast-1 | Each region needs a key created in that region. |
| China (Beijing) keys | https://dashscope.aliyuncs.com/compatible-mode/v1 | China and international keys only work on their own endpoints. |
| API formats | Chat Completions Ā· Responses Ā· Anthropic Messages | Use OpenAI or Anthropic client libraries, or Alibaba's DashScope SDK. |
| Auth header | Authorization: Bearer $DASHSCOPE_API_KEY | Same as OpenAI. |
Turn on step-by-step reasoning for hard problems with enable_thinking. Thinking tokens bill as output.
Let the model call your tools and APIs, using the standard OpenAI tools format.
Get JSON that matches your schema, ready to parse.
Let supported models search the web for current information.
Repeated input is billed cheaply. Qwen4-Max cache hits cost $0.075 per 1M tokens.
Send images and video to vision models such as Qwen4-Max and Qwen3.7-Plus.
| Model ID | Best for | Context | Input / 1M | Output / 1M |
|---|---|---|---|---|
qwen4-max | Best quality, agents, coding | 1M | $1.50 | $4.50 |
qwen3.8-max | Previous flagship | 1M | $2.00 | $6.00 |
qwen3.7-plus | Balanced multimodal | 1M | $0.40* | $1.60* |
qwen3.8-flash | Fast, flat price | 1M | $0.15 | $0.47 |
qwen3.7-flash | Cheapest, high volume | 1M | $0.03* | $0.13* |
qwen-image-3.0-pro | Image generation | ā | From ~$0.03 per image | |
wan3.0-video | Video with sound | ā | $0.20 per second (1080p) | |
International (Singapore) list prices, 3 Dec 2026. *Lowest tier; longer inputs cost more. Estimate your bill with the cost calculator, or see all models.
https://ap-southeast-1.maas.qwencloudapi.com/compatible-mode/v1qwen4-max/auth and choose QwenCloud.| Error | Likely cause | Fix |
|---|---|---|
401 InvalidApiKey | Key is wrong, revoked, or has a stray space or newline | Copy the key again carefully, or create a new one. |
| 401 with a correct key | Key created in a different region | Use the base URL for the region where the key was made. |
404 on every request | Base URL includes /chat/completions | The SDK adds that path; use the base URL only. |
| Model not found | Typo in the model ID, or model not in your region | Check the model list for your region. |
429 Too many requests | Rate limit reached | Retry with backoff, or request higher limits. |
| Unexpected charges | Free quota used up or expired | Free tokens last 90 days; check usage in the console. |
New QwenCloud accounts get about 1M free tokens per model for 90 days in the Singapore region. After that you pay per token, from $0.03 per 1M input tokens.
Yes. QwenCloud supports OpenAI Chat Completions and Responses, plus Anthropic Messages. Point your existing SDK at the QwenCloud base URL and change the model name.
In the QwenCloud console under API Keys. See our login guide if you need help signing in.
Both are Alibaba Cloud's ways to use Qwen models through an API. QwenCloud is the newer, Qwen-focused platform; Model Studio is part of the wider Alibaba Cloud console. Accounts and keys are region-specific on both.
No. It ended on 15 April 2026. Use an API key or a Token Plan instead.