Qwen 2.5 api
★★★★★ 4.5 CE

Qwen 2.5 API: Access, Rate Limits & SDKs 2026

Qwen runs on Alibaba Cloud Model Studio, reachable through OpenAI, Anthropic and native DashScope interfaces. Base URLs are region-specific.

Qwen 2.5 API verdict

Verified today·4 sources checked

Qwen runs on Alibaba Cloud Model Studio, authenticated with a single bearer DASHSCOPE_API_KEY and a region-specific base URL.

Regions span Singapore, Beijing, Tokyo, Frankfurt and Hong Kong, and several require a workspace ID in the URL. Its differentiator is breadth of compatibility.

How to build on it

Qwen's API is the most compatibility-flexible of the leading models. Whatever your existing code looks like, whether OpenAI, Anthropic, or a native SDK, you can keep it and point at Model Studio by swapping the base URL and key. Build on the OpenAI-compatible Chat Completion for the simplest migration, or the OpenAI-compatible Responses surface when you want built-in web search, a code interpreter and server-managed history without wiring them yourself. Plan around the operational edges: choose the correct regional base URL, include the workspace ID where required, and grant model authorization for any sub-workspace keys. Budget on tiered pricing, with qwen3.7-max at the top and qwen-plus and qwen-flash cheaper, plus a 90% cache-hit discount. Remember the model is text-only and weak at autonomous tool use.

Honest limits
  • The base URL is region-specific, across Beijing, Singapore, Tokyo, Frankfurt and Hong Kong, so pick the right region or calls fail.
  • Several regions require a workspace ID embedded in the base URL, found on the Workspace Management page.
  • Sub-workspace API keys cannot access default-workspace models and return Model.AccessDenied until the root admin grants model authorization.
  • It is a paid API on Alibaba Cloud, so store the key in DASHSCOPE_API_KEY rather than hardcoding it.
Auth
Bearer DASHSCOPE_API_KEY
Surfaces
OpenAI + Anthropic + DashScope
Responses tools
Web search + code interpreter
Regions
5 (workspace ID some)
Tiers
max / plus / flash
View sources

Build with the Qwen 2.5 API

Your first Qwen 2.5 API request

POST /compatible-mode/v1/chat/completionsbash
curl https://dashscope-intl.aliyuncs.com/compatible-mode/v1/chat/completions \
  -H "Authorization: Bearer ${DASHSCOPE_API_KEY}" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "qwen3.7-max",
    "messages": [{"role": "user", "content": "Who are you?"}]
  }'

How to authenticate with the Qwen 2.5 API

AspectDetailNotes
AuthBearer DASHSCOPE_API_KEYCreate a key on the Model Studio API Key page
Base URLRegion-specific .../compatible-mode/v1Singapore, Beijing, Tokyo, Frankfurt, Hong Kong; some regions need WorkspaceId in the URL
Drop-inOpenAI Python / JS SDK or DashScope SDKOpenAI-compatible chat completions
Modelsqwen3.7-max (flagship), qwen-plus, qwen-flashSee the Model list for all Qwen models
ActivationActivate Model Studio + accept TermsPer Alibaba Cloud account
Workspace scopeSub-workspace keys need model authorizationModel.AccessDenied otherwise
Four interfacesOpenAI Chat, OpenAI Responses, Anthropic Messages, DashScopePick the surface that matches your existing code

Core interfaces and features

CapabilityHowPurpose
OpenAI Chat CompletionPOST /compatible-mode/v1/chat/completionsDrop-in OpenAI chat; lowest-friction migration
OpenAI ResponsesResponses interfaceBuilt-in web search, code interpreter, web extractor; auto history
Anthropic MessagesAnthropic-compatible MessagesThinking and tool calling for Anthropic-shaped code
DashScope nativeDashScope SDKMost complete set of features and parameters
Streamingstream=TrueStream tokens as generated
Structured outputJSON schema response formatSchema-conforming JSON responses
Function callingtools[] definitionsCall developer-defined tools during generation
Thinking / reasoningReasoning mode (Anthropic Messages: thinking)Extended chain-of-thought before the answer

Regions, workspaces and errors

LimitDetailNotes
RegionsBeijing, Singapore, Tokyo, Frankfurt, Hong KongBase URL varies by region
Workspace IDRequired in the Base URL for several regionsFind it on Workspace Management
Sub-workspace authModel.AccessDenied without model authorizationRoot admin grants per sub-workspace
Error referencePer-code error reference pageMaps codes to causes and fixes
Key handlingStore key in DASHSCOPE_API_KEY env varAvoid hardcoding credentials
Model selectionqwen3.7-max / qwen-plus / qwen-flash tiersPick tier by cost and capability
Interfaces share modelsSame models across the four interfacesChoose by existing code shape

SDKs, surfaces and developer fit

AspectDetailNotes
SDKsOpenAI SDK, Anthropic SDK, DashScope SDKDrop-in via base URL + key
Built-in toolsWeb search, code interpreter, web extractorOn the OpenAI-compatible Responses surface
Auto historyConversation history managed server-sideOn the Responses interface
Thinking + toolsAnthropic-compatible Messages supports bothFor Anthropic-shaped agents
Advanced featuresStreaming, structured output, function callingSee the text-generation overview
PlaygroundBrowser dialog box like Qwen ChatTest before coding
API pricing (qwen3.7-max)$2.50/1M in, $7.50/1M out, cache hit $0.25/1MIndependent cross-reference

Qwen 2.5 API FAQ

How do I authenticate with the Qwen API?

Activate Alibaba Cloud Model Studio, create an API key on the API Key page, and store it in the DASHSCOPE_API_KEY environment variable. Send it as a bearer token and point your client at the region-specific base URL ending in /compatible-mode/v1, such as the Singapore endpoint. Several regions also require your workspace ID embedded in the base URL.

Can I use the OpenAI or Anthropic SDK with Qwen?

Yes, and that is Qwen's main API advantage. The same models are exposed through four interfaces. There is an OpenAI-compatible Chat Completion, a drop-in for the OpenAI SDK, and an OpenAI-compatible Responses surface with built-in web search, a code interpreter and a web extractor. There is an Anthropic-compatible Messages API with thinking and tool calling, plus the native DashScope SDK. Swap the base URL and key and keep your existing client.

What can the Qwen API do beyond basic chat?

It supports streaming output, structured, schema-conforming output and function calling across the interfaces. The OpenAI-compatible Responses surface adds built-in agentic tools, a web search, a code interpreter and a web extractor, and manages conversation history automatically. The Anthropic-compatible Messages API exposes thinking and tool calling for Anthropic-shaped agents.

What are the operational limits of the Qwen API?

The constraints are region and workspace rather than a single endpoint. The base URL is region-specific, across Beijing, Singapore, Tokyo, Frankfurt and Hong Kong, and several regions require a workspace ID in the URL. Sub-workspace API keys cannot reach default-workspace models, returning Model.AccessDenied until the root administrator grants model authorization. Errors map to a published error-code reference.

Which Qwen model should I call and how is it priced?

qwen3.7-max is the flagship, at $2.50 per 1M input and $7.50 per 1M output tokens, with cache hits 90% cheaper at $0.25 per 1M. For lower cost, Model Studio also offers cheaper tiers such as qwen-plus and qwen-flash; see the Model list. Pick the tier by the cost-versus-capability trade-off your workload needs.

Sources & verification

Verified by ComparEdgeMethod: Vendor docs, official pages, and selected independent sources
SourceWhat was checkedLast checked
GitHub OfficialOfficial product pageJuly 10, 2026
Alibabacloud Model Studio First Api Call To QwenModel Studio First API Call To QwenJuly 10, 2026
Alibabacloud Model Studio Qwen Api ReferenceModel Studio Qwen API ReferenceJuly 10, 2026
Artificial AnalysisIndependent referenceJuly 10, 2026

Every fact on this Qwen 2.5 page is tied to a named source and a verification date. Freshness-sensitive figures trace to the sources above; verify against the vendor before relying on them.