Qwen (Alibaba) API: endpoints, authentication, models and limits
Connection details
| Base URL | https://dashscope-intl.aliyuncs.com/compatible-mode/v1 |
| Auth | Bearer token via DASHSCOPE_API_KEY |
| OpenAI SDK compatible | Yes |
| SDKs | OpenAI SDK (compatible mode), DashScope SDK |
Models and token pricing
| Model | Model ID | Context | In / 1M | Out / 1M |
|---|---|---|---|---|
| Qwen 3.7 Max | qwen-3.7-max | 1000K | $2.50 | $7.50 |
| Qwen3.8 Max Preview | qwen3.8-max-preview | 1000K | $2.50 | $7.50 |
| Qwen 3.6 Plus | qwen-3.6-plus | 256K | $1.40 | $5.60 |
| Qwen 2.5 72B | qwen-2.5-72b-instruct | 131K | $0.300 | $0.900 |
| Qwen 2.5 Coder 32B | qwen-2.5-coder-32b-instruct | 131K | $0.150 | $0.450 |
What is distinctive about this API
- Served through DashScope, which exposes an OpenAI-compatible mode alongside its native API; the compatible endpoint is the pragmatic default.
- The family spans dense and mixture-of-experts models plus dedicated coder and vision variants, so one provider covers several workload shapes.
- Most Qwen weights are openly licensed, making the hosted API and self-hosting genuinely interchangeable.
Constraints worth knowing first
- International and mainland endpoints are separate, with different hosts and keys.
- Native DashScope request/response shapes differ from the compatible mode; mixing documentation between the two is a common source of confusion.
Frequently asked
- What is the Qwen (Alibaba) API base URL?
- https://dashscope-intl.aliyuncs.com/compatible-mode/v1. Authenticate with a bearer token, conventionally read from the DASHSCOPE_API_KEY environment variable.
- Is the Qwen (Alibaba) API compatible with the OpenAI SDK?
- Yes. The chat completions surface is wire-compatible, so the official OpenAI client libraries work by pointing base_url at https://dashscope-intl.aliyuncs.com/compatible-mode/v1 and supplying a DASHSCOPE_API_KEY. No client library change is needed.
- How do I get a Qwen (Alibaba) API key?
- Create an account with the provider and generate a key from the developer console, then expose it to your application as DASHSCOPE_API_KEY. Keys are secrets: keep them server-side, never in client bundles or committed config.
- Which models does the Qwen (Alibaba) API expose?
- Qwen 3.7 Max, Qwen3.8 Max Preview, Qwen 3.6 Plus, Qwen 2.5 72B, Qwen 2.5 Coder 32B. Context windows run to 1000K tokens.
Other provider APIs
Alibaba Cloud publishes official documentation at https://www.alibabacloud.com/help/en/model-studio. Pricing and limits change; verify against the provider before committing to a budget.