TL;DR
Current as of September 1, 2026. Every rate below was read from Alibaba Cloud Model Studio's Singapore pricing page on that date. Alibaba reprices and renames models quarterly; check the console before committing volume.
“the OpenAI-compatible path on every Model Studio region. Set base_url to https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1, pass your key as a bearer token, and the OpenAI SDK runs unchanged.”
The Qwen API is Alibaba Cloud Model Studio, the platform formerly called DashScope. It has three surfaces: an OpenAI-compatible Chat Completions endpoint, an Anthropic-compatible Messages endpoint for Claude Code, and the DashScope native API. The flagship is qwen3.8-max at $2/$6 per million tokens with a 1M context. The price-performance tier is qwen3.7-plus at $0.40/$1.60. The cheap tier is qwen3.8-flash at $0.15/$0.47. Every proprietary model comes with 1M free tokens for 90 days.
Hosted: which model
qwen3.7-plus for agent loops, qwen3.8-max when the task needs the flagship, qwen3.8-flash for classification and cheap subagent turns. Avoid qwen3-coder-plus above 256K input: that tier is $6/$60.
Self-host: which checkpoint
Qwen3.8-27B (27B dense, Apache 2.0, 61.7 SWE-bench Pro) fits one 80 GB GPU at FP8. Qwen3.8-2.4T-A95B is open-weight but under the qwen3.8-max license, not Apache. Qwen3.6-27B is the Apache-licensed generation Morph runs as a dedicated endpoint.
Morph no longer serves Qwen on its public per-token API. The morph-qwen35-397b, morph-qwen36-27b, and morph-qwen38-27b names were retired on August 27, 2026 when that capacity consolidated onto GLM-5.3-Flash; existing traffic still resolves, but the models are off every public surface. Qwen 3.6 27B is still available as a dedicated single-tenant deployment, covered at the end of this page.
Where to Get a Qwen API Key
Sign in to the Alibaba Cloud Model Studio console, pick a region from the upper-right selector, open the API Key page, and click Create API Key. Keys are region-specific: a Singapore key does not work against the Beijing endpoint, and each region has its own console URL and model catalog. New keys start with sk-ws, and the plaintext is shown once. The SDKs read the key from DASHSCOPE_API_KEY.
| Region | OpenAI-compatible base URL | Notes |
|---|---|---|
| Singapore (international) | https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1 | Default for non-China customers; 1M free tokens per model |
| China (Beijing) | https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 | Higher rate limits; separate console and key |
| US (Virginia) | https://dashscope-us.aliyuncs.com/compatible-mode/v1 | Smaller catalog; check model availability |
| DashScope native | https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1 | Alibaba-specific features (multimodal, apps) |
Replace {WorkspaceId} with the workspace ID from the console. Older tutorials use dashscope-intl.aliyuncs.com/compatible-mode/v1; Alibaba now recommends the workspace-specific domains and describes the old hostnames as legacy. Source: Model Studio OpenAI-compatibility and first-call docs, September 2026.
Two subscription products sit beside pay-as-you-go. The Coding Plan Pro is $50 per month for up to 6,000 requests per 5 hours, 45,000 per week, and 90,000 per month, with its own endpoints at coding-intl.dashscope.aliyuncs.com and support for Claude Code, Cline, Qwen Code, Cursor, and others. The Lite tier closed to new subscriptions in March 2026. A Token Plan endpoint at token-plan.ap-southeast-1.maas.aliyuncs.com serves prepaid token bundles; the key type must match the endpoint or the API returns a mismatch error.
Qwen API Pricing and Model IDs
Model Studio bills per million tokens, in USD on the Singapore region, with separate input and output rates. Three families matter: Max (flagship), Plus (balanced), and Flash (cheap), plus the Coder line and the hosted open-weight 27B. Several models tier the rate by input length; the table shows the first tier and the ceiling.
| Model ID | Input | Output | Tiering | Free quota |
|---|---|---|---|---|
| qwen3.8-max | $2.00 | $6.00 | Flat to 1M | 1M tokens, 90 days |
| qwen3.7-max | $2.50 | $7.50 | Flat | 1M tokens, 90 days |
| qwen3.7-plus | $0.40 | $1.60 | $1.20 / $4.80 above 256K | 1M tokens, 90 days |
| qwen3.6-plus | $0.50 | $3.00 | $2.00 / $6.00 above 256K | 1M tokens, 90 days |
| qwen3.8-flash | $0.15 | $0.47 | Flat | 1M tokens, 90 days |
| qwen3.7-flash | $0.03 | $0.13 | $0.20 / $0.80 above 256K | 1M tokens |
| qwen3-coder-plus | $1.00 | $5.00 | $6.00 / $60.00 above 256K | 1M tokens, 90 days |
| qwen3-coder-flash | $0.30 | $1.50 | $1.60 / $9.60 above 256K | 1M tokens |
| qwen3.8-27b (open weights, hosted) | $0.50 | $3.00 | Flat | 1M tokens, 90 days |
Source: Alibaba Cloud Model Studio model pricing page, Singapore region, read September 1, 2026. qwen3.7-plus showed a limited-time 20% discount on top of the list rate at that time. Context caching discounts repeated input on the models that list it (qwen3.8-max, qwen3.7-plus, qwen3.8-flash, qwen3-coder-plus, qwen3.8-27b). Batch inference is 50% off on qwen-max, qwen3.7-flash, and qwen-flash. Legacy aliases qwen-max ($1.60/$6.40), qwen-plus, and qwen-flash still resolve; new code should target a versioned ID.
qwen3-coder-plus is the only model here whose top tier is $6/$60. A coding agent that lets context grow past 256K pays 6x the input rate and 12x the output rate of the first tier on that request. Either cap context below 256K with compaction, or use qwen3.7-plus, whose top tier is $1.20/$4.80 at the same 1M window. See Compact for shrinking agent context 50 to 70% before it hits a tier boundary.
Free Tier, Regions, and Rate Limits
The free tier is per model, not per account: each proprietary Qwen model carries 1M free tokens, valid 90 days from the later of Model Studio activation, model release, or application approval. A fresh Singapore account therefore starts with roughly 1M tokens on each of qwen3.8-max, qwen3.7-plus, qwen3.8-flash, the coder models, and the rest. The quota excludes the Batch API, context caching, and fine-tuning.
Rate limits are enforced at the Alibaba Cloud account level. Usage from every RAM user, workspace, and API key under the account is combined, so adding keys adds no headroom. Two limits apply at once, requests per minute and tokens per minute, and the service may also enforce per-second ceilings of RPM/60 and TPM/60. A burst that fits the minute budget can still 429 on the second budget.
| Model | Singapore RPM / TPM | Beijing RPM / TPM |
|---|---|---|
| qwen3.8-max | 15,000 / 2,000,000 | 30,000 / 5,000,000 |
| qwen3.7-plus | 15,000 / 5,000,000 | 30,000 / 5,000,000 |
| qwen3-coder-plus | 2,400 / 2,000,000 | 5,000 / 5,000,000 |
| qwen3.5-flash | 15,000 / 5,000,000 | 30,000 / 10,000,000 |
Source: Model Studio rate-limiting doc, September 2026. Dated snapshot versions carry much lower quotas (60 RPM, 100,000 TPM on some). A temporary TPM increase can be requested from the console's Increase Rate Limits page; it takes effect immediately and lasts 30 days.
Region choice is a data-residency decision as much as a latency one. Singapore is the international default and the region where the 1M free quota and the USD price list apply. Beijing has roughly double the RPM ceilings but serves from mainland China. The US (Virginia) endpoint exists for teams that need requests to stay in the United States; verify the model you want is in its catalog before building on it.
Call the Qwen API: Python and curl
Because Model Studio speaks the OpenAI wire format, the call is the OpenAI SDK with two fields changed. Streaming, tool calling, and JSON mode work as they do against OpenAI.
Qwen API with the OpenAI Python SDK (Model Studio Singapore)
import os
from openai import OpenAI
client = OpenAI(
api_key=os.environ["DASHSCOPE_API_KEY"],
base_url="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1",
)
resp = client.chat.completions.create(
model="qwen3.7-plus", # or qwen3.8-max, qwen3.8-flash, qwen3-coder-plus
messages=[
{"role": "system", "content": "You are a senior engineer."},
{"role": "user", "content": "Find the race condition in this handler and fix it."},
],
)
print(resp.choices[0].message.content)Qwen API with curl
curl "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1/chat/completions" \
-H "Authorization: Bearer $DASHSCOPE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "qwen3.8-max",
"messages": [{"role": "user", "content": "Explain MoE routing in two sentences."}]
}'The same client works against a self-hosted vLLM or SGLang server. Only the base URL and the model name change; the key can be any non-empty string unless you started the server with --api-key.
Same call against a self-hosted vLLM endpoint
from openai import OpenAI
client = OpenAI(api_key="local", base_url="http://localhost:8000/v1")
resp = client.chat.completions.create(
model="Qwen/Qwen3.8-27B",
messages=[{"role": "user", "content": "Write a retry decorator with exponential backoff."}],
)
print(resp.choices[0].message.content)Third-Party Hosts: OpenRouter, DeepInfra, Fireworks, Together
Alibaba is not the only way to call Qwen. The proprietary Max, Plus, and Flash models are resold through OpenRouter, and the open-weight checkpoints are served by the usual inference providers. Prices below are the provider's list rate on September 1, 2026; routed listings blend several upstreams and can move daily.
| Host | Model | Input | Output | Context |
|---|---|---|---|---|
| OpenRouter | qwen/qwen3.8-max | $2.00 | $6.00 | 1M |
| OpenRouter | qwen/qwen3.7-plus | $0.32 | $1.28 | 1M |
| OpenRouter | qwen/qwen3.8-flash | $0.15 | $0.47 | 1M |
| OpenRouter | qwen/qwen3.8-27b | $0.32 | $2.50 | 1M |
| OpenRouter | qwen/qwen3.6-27b | $0.30 | $2.00 | 262K |
| OpenRouter | qwen/qwen3.6-35b-a3b | $0.05 | $0.70 | 262K |
| DeepInfra | Qwen/Qwen3.8-27B | $0.40 | $3.00 | 262K |
| Fireworks | Qwen3.8 27B | Dedicated only | Dedicated only | 262K |
Sources: OpenRouter Qwen listings, DeepInfra Qwen3.8-27B model page, Fireworks Qwen3.8 27B model page (serverless marked not supported), September 1, 2026. Together AI lists Qwen models on its serverless catalog but no Qwen 3.8 rate could be verified on its pricing page at the time of writing, so no number is quoted.
OpenRouter's qwen3.7-plus at $0.32/$1.28 is exactly the Model Studio list rate with Alibaba's 20% promotion applied, which is a useful sanity check on whether a router is passing the upstream price through. For the open-weight 27B, hosted rates run $0.30 to $0.50 input and $2.00 to $3.00 output depending on host and quantization; a cheaper sticker often means FP8 activations rather than reference weights.
Self-Host: The Open-Weight Qwen Lineup
Alibaba publishes most Qwen generations as downloadable weights, which is the main reason Qwen shows up in every self-hosting comparison. The 2026 lineup has two generations that matter and one license change that matters more.
| Checkpoint | Params (total / active) | Context | License | Released |
|---|---|---|---|---|
| Qwen/Qwen3.8-27B | 27B dense | 262,144 native, 1M via YaRN | Apache 2.0 | Aug 14, 2026 |
| Qwen/Qwen3.8-2.4T-A95B | 2.4T / 95B (512 experts, 10 routed + 1 shared) | 262,144 native, 1.01M extended | qwen3.8-max license | Aug 12, 2026 |
| Qwen/Qwen3.8-Flash-Next | 125B / 6B (plus 51B n-gram embedding, 4B MTP) | 262,144 native, 1M extended | qwen-community-1.0 | Aug 2026 |
| Qwen/Qwen3.6-27B | 27B dense | 262,144 native, 1.01M extended | Apache 2.0 | Apr 22, 2026 |
| Qwen/Qwen3.6-35B-A3B | 35B / 3B | 262,144 native | Apache 2.0 | Apr 16, 2026 |
| Qwen/Qwen3.5-397B-A17B | 397B / 17B | 262,144 native | Apache 2.0 | Feb 2026 |
Sources: the Hugging Face model cards linked in Sources. Each checkpoint ships an official FP8 variant (for example Qwen/Qwen3.8-27B-FP8). The 27B models share a 64-layer hybrid layout: 16 blocks of three Gated DeltaNet sublayers followed by one gated-attention sublayer.
| Checkpoint | SWE-bench Pro | SWE-bench Verified | LiveCodeBench v6 |
|---|---|---|---|
| Qwen3.8-2.4T-A95B | 67.7 | n/a on card | n/a on card |
| Qwen3.8-Flash-Next | 62.5 | n/a on card | 91.9 |
| Qwen3.8-27B | 61.7 | n/a on card | 90.3 |
| Qwen3.6-27B | 53.5 | 77.2 | n/a on card |
Qwen3.6-27B, Qwen3.6-35B-A3B, and Qwen3.8-27B are Apache 2.0: commercial use with attribution and a patent grant, nothing else. Qwen3.8-2.4T-A95B is the first open-weight Max-class Qwen, and it ships under the qwen3.8-max license instead. That license allows commercial use but requires prominent model attribution in the UI once a product passes 100,000,000 monthly active users or US$20,000,000 monthly revenue, and requires a separate commercial license for model-as-a-service or AI work-assistant businesses above US$50,000,000 revenue over 12 consecutive months. Qwen3.8-Flash-Next uses qwen-community-1.0. If your legal review is scoped to Apache, the 27B dense models are the ones that pass without a second read.
For the architecture behind the 27B dense models and why they outscore the 397B MoE they replaced, see Qwen 3.6 27B and Qwen 3.5. For the broader open-weight landscape, see open source LLMs.
vLLM and SGLang Launch Commands
The commands below are the ones in the Qwen3.8 README and the vLLM recipe for Qwen3.8-27B. Both engines need the qwen3 reasoning parser to split thinking from the answer and the qwen3_coder tool-call parser for agent tool use; without them, tool calls arrive as plain text.
vLLM (0.17.0 or newer): Qwen3.8-27B at native 262K context
vllm serve Qwen/Qwen3.8-27B --port 8000 --tensor-parallel-size 4 \
--max-model-len 262144 --reasoning-parser qwen3 \
--enable-auto-tool-choice --tool-call-parser qwen3_codervLLM: FP8 weights and FP8 KV cache (largest KV budget)
vllm serve Qwen/Qwen3.8-27B-FP8 \
--tensor-parallel-size 4 \
--max-model-len 262144 \
--kv-cache-dtype fp8 \
--reasoning-parser qwen3SGLang: same model, same parsers
sglang serve --model-path Qwen/Qwen3.8-27B --port 8000 --tp-size 4 \
--context-length 262144 --reasoning-parser qwen3 \
--tool-call-parser qwen3_coderThe README's --tensor-parallel-size 4 is about KV-cache headroom at 262K context, not weight capacity. The weight arithmetic for a 27B dense model is 27 GB at FP8 (one byte per parameter) and 54 GB at BF16 (two bytes), so a single 80 GB H100 or 141 GB H200 holds the FP8 weights with tens of gigabytes left for KV cache; the vLLM recipe also documents an NVFP4 build at 24.6 GiB on one Blackwell GPU. Run TP=1 for a small team at 32K to 64K context, and go to TP=4 when you need the full 262K window with real concurrency. To push past native context, the recipe passes --max-model-len 1010000 with an --hf-overrides that raises max_position_embeddings, which is YaRN scaling.
Qwen3.8-2.4T-A95B is a different class of deployment: 2.4T parameters is 2.4 TB at FP8 before KV cache, which is a multi-node rack of B200 or B300 GPUs, not a single server. Its model card recommends SGLang, vLLM, or TokenSpeed and does not publish a GPU count. If that is the model you want, the hosted API or a dedicated cluster is the realistic path. For how the serving stack itself is tuned on Morph, see LLM inference and the dedicated inference benchmarks.
Claude Code, Cline, and Qwen Code Setup
Model Studio runs an Anthropic-compatible Messages endpoint under /apps/anthropic. It serves only /v1/messages; there is no model-list route, so the base URL must end at /apps/anthropic. Appending /v1 makes Claude Code request /v1/models at a doubled path and fail with a 404.
Claude Code on Qwen (Model Studio Coding Plan, international)
export ANTHROPIC_BASE_URL="https://coding-intl.dashscope.aliyuncs.com/apps/anthropic"
export ANTHROPIC_AUTH_TOKEN="YOUR_MODEL_STUDIO_KEY"
export ANTHROPIC_MODEL="qwen3.8-max"
export ANTHROPIC_DEFAULT_SONNET_MODEL="qwen3.8-max"
claude
# Token Plan users swap the base URL:
# https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropicPersist the same four values under an env object in ~/.claude/settings.json to avoid exporting them each session. The key type has to match the endpoint: a pay-as-you-go key against the Coding Plan URL returns an "API key type does not match" error. The legacy dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy URL still works but only serves qwen3-coder-plus. For the general pattern, see using a different LLM in Claude Code.
Qwen Code, Cline, and other OpenAI-SDK agents take the OpenAI-compatible URL instead. Qwen Code reads three environment variables, and the same three values go into ~/.qwen/settings.json under modelProviders if you prefer a file. The pattern is identical for a self-hosted vLLM server: swap the base URL for http://localhost:8000/v1.
Qwen Code (or any OpenAI-compatible CLI) on Model Studio
export OPENAI_BASE_URL="https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1"
export OPENAI_API_KEY="$DASHSCOPE_API_KEY"
export OPENAI_MODEL="qwen3.7-plus"
qwen
# inside the CLI, pick the OpenAI-compatible provider with /authCoding Plan subscribers point Qwen Code at https://coding-intl.dashscope.aliyuncs.com/v1 and the CLI stores the key as BAILIAN_CODING_PLAN_API_KEY. Install and provider details are on the Qwen CLI page.
Qwen API vs DeepSeek vs GLM-5.3 and Kimi K3
The comparison that matters for a coding agent is the monthly bill at agent token shapes, not the sticker. The table prices one profile: 10,000 requests a day at 3,000 input and 1,000 output tokens each, for 30 days, which is 900M input and 300M output tokens per month. No cache hits are assumed, so every row is the ceiling; caching lowers the Qwen, DeepSeek, and Morph rows by different amounts.
| Model (host) | Input / 1M | Output / 1M | Context | Monthly |
|---|---|---|---|---|
| qwen3.8-max (Model Studio) | $2.00 | $6.00 | 1M | $3,600 |
| qwen3.7-plus (Model Studio, list) | $0.40 | $1.60 | 1M | $840 |
| qwen3.8-flash (Model Studio) | $0.15 | $0.47 | 1M | $276 |
| qwen3.8-27b (Model Studio) | $0.50 | $3.00 | 1M | $1,350 |
| deepseek-v4-flash (DeepSeek, off-peak) | $0.22 | $0.66 | 1M | $396 |
| deepseek-v4-flash (DeepSeek, peak) | $0.44 | $1.32 | 1M | $792 |
| GLM-5.3-Flash (Morph, morph-glm53flash) | $0.13 | $0.45 | 1M | $252 |
| DeepSeek V4 Flash (Morph, morph-dsv4flash) | $0.09875 | $0.278 | 1M | $172 |
| GLM-5.3 744B (Morph, morph-glm53-744b) | $1.25 | $4.4 | 1M | $2,445 |
| Kimi K3 2.8T (Morph, morph-kimik3) | $2.8 | $14 | 1M | $6,720 |
Qwen rates from Model Studio Singapore; DeepSeek rates from its official pricing page as checked for our DeepSeek API page (peak hours 01:00 to 04:00 and 06:00 to 10:00 UTC); Morph rates from Morph pricing. Arithmetic: 900 times the input rate plus 300 times the output rate.
Three things fall out of the table. First, the Qwen Flash and Plus tiers sit in the same band as DeepSeek off-peak and Morph's GLM-5.3-Flash; within that band the deciding factors are rate limits, region, and how each model handles your tool-call format, not price. Second, the Max tier costs about 13x the Plus tier for the same tokens, so an agent that routes only hard turns to Max keeps most of Max's quality at a Plus-sized bill; see LLM routing. Third, the 27B open-weight model is more expensive hosted on Model Studio ($0.50/$3.00) than the proprietary Plus model, which is why teams that want the 27B usually self-host it or buy a dedicated endpoint rather than call it per token.
On quality, the model cards put Qwen3.8-27B at 61.7 SWE-bench Pro and Qwen3.8-2.4T-A95B at 67.7. For where GLM-5.3 and Kimi K3 land on the same benchmarks and how Morph serves them, see GLM-5.3, Kimi K3, and Morph's model lineup. For the broader provider table, see LLM API comparison and Kimi API.
Plan a Qwen 3.6 27B endpoint
Turn your team size and agent workload into a capacity estimate. Then validate the recommendation with your own traces.
An exact Morph capacity measurement is required before recommending a dedicated plan.
B200 is the compatible public platform. Dedicated capacity is invoiced monthly at the beginning of the month. Tokens are not billed separately.
Difference from serverless: $13,545 more per month.
A dedicated endpoint is the third way to run Qwen: not Alibaba's shared API, not your own vLLM box. Morph provisions Qwen 3.6 27B on single-tenant B200 GPUs behind the same OpenAI-compatible contract, billed per GPU-hour, so a team's agent traffic never queues behind another customer's and rate limits are whatever the hardware sustains. Use the planner above to turn a team size and agent workload into a GPU count, then open the full calculator or read the dedicated inference overview for pricing and lead time.
FAQ
What is the Qwen API base URL?
For the international (Singapore) region of Alibaba Cloud Model Studio, the OpenAI-compatible base URL is https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/compatible-mode/v1, where {WorkspaceId} is your Model Studio workspace ID. The China (Beijing) region uses https://{WorkspaceId}.cn-beijing.maas.aliyuncs.com/compatible-mode/v1 and the US (Virginia) region uses https://dashscope-us.aliyuncs.com/compatible-mode/v1. The DashScope native endpoint replaces /compatible-mode/v1 with /api/v1. Older docs reference dashscope-intl.aliyuncs.com; Alibaba now recommends the workspace-specific domains.
How much does the Qwen API cost?
On the Singapore region, per million tokens: qwen3.8-max is $2 input and $6 output, flat. qwen3.7-plus is $0.40/$1.60 up to 256K input tokens and $1.20/$4.80 from 256K to 1M, with a limited-time 20% discount applied at the time of writing. qwen3.8-flash is $0.15/$0.47 flat. qwen3-coder-plus is tiered by input length: $1/$5 up to 32K, $1.80/$9 to 128K, $3/$15 to 256K, and $6/$60 to 1M. The open-weight qwen3.8-27b is $0.50/$3 hosted. Batch inference is 50% off on the models that list it, and context caching discounts cached input.
Is the Qwen API free?
Partly. Every proprietary Qwen model on Model Studio ships with a 1M-token free quota valid for 90 days from the later of Model Studio activation or model release, so a new account gets roughly 1M free tokens per model across the catalog. After the quota is used or expires, billing is pay-as-you-go per token. The free quota does not apply to the Batch API, context caching, or fine-tuning. The open weights are free to download under Apache 2.0 (Qwen3.8-27B, Qwen3.6-27B, Qwen3.6-35B-A3B) if you self-host.
Which Qwen API model should I use for coding agents?
qwen3.7-plus ($0.40/$1.60, 1M context) is the price-performance default for agent loops; qwen3.8-max ($2/$6) when the task needs the flagship. qwen3-coder-plus is the dedicated coding line but its tiered pricing climbs to $6/$60 above 256K input, so keep its context short. qwen3.8-flash ($0.15/$0.47) covers classification and cheap subagent turns. For self-hosting, Qwen3.8-27B (Apache 2.0) scores 61.7 on SWE-bench Pro and fits one 80 GB GPU at FP8.
Is the Qwen API OpenAI-compatible?
Yes. Model Studio exposes an OpenAI-compatible Chat Completions endpoint under /compatible-mode/v1, so the OpenAI Python and Node SDKs work by changing base_url and api_key. It also exposes an Anthropic-compatible Messages endpoint under /apps/anthropic that serves only /v1/messages (no model list), which is what Claude Code uses. The DashScope native API under /api/v1 carries Alibaba-specific features.
How do I use Qwen with Claude Code?
Point Claude Code at the Anthropic-compatible endpoint for your plan. Set ANTHROPIC_BASE_URL to https://coding-intl.dashscope.aliyuncs.com/apps/anthropic (Coding Plan) or https://token-plan.ap-southeast-1.maas.aliyuncs.com/apps/anthropic (Token Plan), ANTHROPIC_AUTH_TOKEN to your Model Studio key, and ANTHROPIC_MODEL plus ANTHROPIC_DEFAULT_SONNET_MODEL to a model ID such as qwen3.8-max or qwen3.7-plus. The base URL must end at /apps/anthropic; adding /v1 makes Claude Code request /v1/models and 404. The legacy dashscope.aliyuncs.com/api/v2/apps/claude-code-proxy URL only serves qwen3-coder-plus.
What are the Qwen API rate limits?
Limits are per Alibaba Cloud account, combined across all RAM users, workspaces, and API keys. On Singapore: qwen3.8-max is 15,000 RPM and 2,000,000 TPM, qwen3.7-plus 15,000 RPM and 5,000,000 TPM, qwen3-coder-plus 2,400 RPM and 2,000,000 TPM. Beijing is higher: 30,000 RPM and 5,000,000 TPM for qwen3.8-max. The service also enforces per-second ceilings of RPM/60 and TPM/60, so bursts can 429 before the minute total does. You can raise TPM temporarily for 30 days from the console.
Can I self-host Qwen instead of using the API?
Yes. Qwen3.8-27B (27B dense, Apache 2.0, 262,144 native context) serves on vLLM 0.17.0+ or SGLang with the qwen3 reasoning parser and qwen3_coder tool-call parser; at FP8 the weights are about 27 GB, so one 80 GB H100 or H200 holds them with KV cache headroom. Qwen3.8-2.4T-A95B (2.4T total, 95B active) is open-weight under the qwen3.8-max license, which requires attribution above 100M monthly active users or $20M monthly revenue and a separate license for model-as-a-service businesses above $50M in 12 months. Morph runs Qwen as a dedicated single-tenant endpoint if you want it hosted without sharing capacity.
Does Morph still serve Qwen on its public API?
No. Morph's public Qwen aliases (morph-qwen35-397b, morph-qwen36-27b, morph-qwen38-27b) were retired on August 27, 2026 when that capacity consolidated onto GLM-5.3-Flash. The names still resolve for existing traffic but are off every public surface. Qwen 3.6 27B remains available as a dedicated single-tenant deployment on Morph's B200 pool, priced per GPU-hour rather than per token.
Want Qwen without the shared rate limit?
Morph runs Qwen 3.6 27B as a dedicated single-tenant endpoint on B200 GPUs: one OpenAI-compatible API, capacity you do not share, priced per GPU-hour. Size it with the calculator or talk to us about a custom checkpoint.
Sources
- Alibaba Cloud Model Studio: Model pricing (Singapore USD rates for qwen3.8-max, qwen3.7-plus, qwen3.8-flash, qwen3-coder-plus, qwen3.8-27b; tiering; 1M-token 90-day free quota; batch and caching discounts)
- Alibaba Cloud Model Studio: OpenAI compatibility (workspace-specific base URLs for Singapore, Beijing, and US Virginia; Python and curl examples; legacy dashscope-intl hostnames)
- Alibaba Cloud Model Studio: First API call to Qwen (/compatible-mode/v1 and /api/v1 endpoints, DASHSCOPE_API_KEY)
- Alibaba Cloud Model Studio: Get an API key (region-specific keys, sk-ws prefix, console flow)
- Alibaba Cloud Model Studio: Rate limiting (account-level limits, Singapore vs Beijing RPM/TPM, per-second enforcement, 30-day temporary increases)
- Alibaba Cloud Model Studio: Claude Code (ANTHROPIC_BASE_URL for Coding Plan and Token Plan, ANTHROPIC_AUTH_TOKEN, ANTHROPIC_MODEL, settings.json example, key-type mismatch error)
- Alibaba Cloud Model Studio: Anthropic-compatible Messages API (/apps/anthropic serves only /v1/messages; legacy claude-code-proxy limited to qwen3-coder-plus)
- Alibaba Cloud Model Studio: Coding Plan (Pro $50/month, 6,000 requests per 5 hours, 45,000 per week, 90,000 per month; coding-intl endpoints; supported tools; Lite closed March 2026)
- Qwen Code docs: Model providers (OPENAI_BASE_URL / OPENAI_API_KEY / OPENAI_MODEL, modelProviders in settings.json, BAILIAN_CODING_PLAN_API_KEY)
- OpenRouter: Qwen models (routed rates for qwen3.8-max, qwen3.7-plus, qwen3.8-flash, qwen3.8-27b, qwen3.6-27b, qwen3.6-35b-a3b)
- DeepInfra: Qwen/Qwen3.8-27B ($0.40 / $3.00 per 1M, 262,144 context)
- Fireworks AI: Qwen3.8 27B (serverless not supported, 262K context)
- GitHub: QwenLM/Qwen3.8 (release dates, vllm serve and sglang serve commands with reasoning and tool-call parsers)
- Hugging Face: Qwen/Qwen3.8-27B (27B dense, 64-layer hybrid layout, 262,144 native context, Apache 2.0, SWE-bench Pro 61.7, LiveCodeBench v6 90.3)
- Hugging Face: Qwen/Qwen3.8-2.4T-A95B (2.4T total / 95B active, 512 experts, SWE-bench Pro 67.7, Terminal Bench 2.1 86.6) and its qwen3.8-max LICENSE (100M MAU / US$20M revenue attribution clause, US$50M MaaS clause)
- Hugging Face: Qwen/Qwen3.8-Flash-Next (125B total / 6B active, qwen-community-1.0, SWE-bench Pro 62.5)
- Hugging Face: Qwen/Qwen3.6-27B (27B dense, Apache 2.0, SWE-bench Verified 77.2, SWE-bench Pro 53.5) and Qwen/Qwen3.6-35B-A3B
- vLLM recipes: Qwen/Qwen3.8-27B (vLLM 0.17.0 minimum, FP8 TP4 command, NVFP4 24.6 GiB single-GPU build, 1M context via hf-overrides)
- DeepSeek API docs: Models and pricing (deepseek-v4-flash $0.22 / $0.66 off-peak, $0.44 / $1.32 peak, as checked August 21, 2026)