Get started

Four ways to use Qwen

From clicking a link in a browser to running a trillion-parameter model on your own hardware. Pick the row that matches how much control you need.

💬

Chat in a browser

The fastest route. No account setup beyond signing in, no code.

chat.qwen.ai →

📱

The Qwen App

The agentic consumer assistant, wired into Taobao, Alipay, Fliggy and Amap. Currently China-focused.

iOS & Android

🔌

Hosted API

Alibaba Cloud Model Studio / Qwen Cloud, with OpenAI- and Anthropic-compatible endpoints and 1M free trial tokens.

Jump to code →

🖥️

Self-host

Download the weights from Hugging Face or ModelScope and serve them with vLLM, SGLang, llama.cpp or Ollama.

Jump to setup →

Pricing

What the hosted models cost

Per million tokens, Alibaba Cloud Model Studio international deployment, as of mid-August 2026. Regional pricing and promotional tiers differ — confirm before you budget.

ModelInputOutputContextBest for
Qwen3.8-Max$2.00$6.001M Long-horizon agents, autonomous coding, research work
Qwen3.7-Max$2.50$7.501M Previous flagship; office automation and tool use
Qwen3.5-397B$0.60$3.60128K Strong general reasoning at mid cost
Qwen3.5-Plus$0.40$2.401M Balanced default; rises to $0.50 / $3.00 above 256K input
Qwen3.5-Flash$0.10$0.401M High volume with a real context budget
Qwen3.7-Flash$0.03$0.131M Cheapest tier: classification, extraction, routing
Qwen3.8-Max bills implicit cache hits at $0.25 per million tokens. If you send a large stable system prompt or document on every call, caching is usually the single biggest lever on your bill — often larger than switching model tiers. And since most Qwen models are open weight, self-hosting is always the zero-per-token alternative if you have the GPUs.
API

Calling the hosted models

Qwen Cloud exposes OpenAI-compatible and Anthropic-compatible interfaces, so most existing client code works after changing the base URL and model name.

Python, OpenAI-compatible client

from openai import OpenAI

client = OpenAI(
    api_key=os.environ["DASHSCOPE_API_KEY"],
    base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)

resp = client.chat.completions.create(
    model="qwen3.8-max",
    messages=[
        {"role": "system", "content": "You are a precise research assistant."},
        {"role": "user", "content": "Summarise this quarter's filing in five bullets."},
    ],
    # low | medium | xhigh - trades latency and cost against depth
    extra_body={"reasoning_effort": "medium"},
)
print(resp.choices[0].message.content)

curl

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.5-flash",
    "messages": [{"role": "user", "content": "Explain MoE routing in two sentences."}],
    "stream": true
  }'

Free tier

Alibaba Cloud advertises 1 million free tokens for new Model Studio users, which is enough to evaluate several models against a real workload before committing.

Also available via

Qwen models are resold through OpenRouter and most aggregator platforms, and deployable with a few clicks in Alibaba's PAI-EAS if you want a managed endpoint with fine-tuning attached.

Self-hosting

Running the open weights

Every open Qwen lands on Hugging Face and ModelScope on release day, and the major inference stacks now ship day-zero support.

Serve with vLLM

# A single 27B dense model - the practical default for one GPU box
vllm serve Qwen/Qwen3.8-27B \
  --max-model-len 262144 \
  --served-model-name qwen3.8-27b

Load with Transformers

from transformers import AutoModelForCausalLM, AutoTokenizer

name = "Qwen/Qwen3.8-27B"
tok = AutoTokenizer.from_pretrained(name)
model = AutoModelForCausalLM.from_pretrained(name, dtype="auto", device_map="auto")

msgs = [{"role": "user", "content": "Write a regex for ISO-8601 durations."}]
text = tok.apply_chat_template(msgs, tokenize=False, add_generation_prompt=True)
ids = tok([text], return_tensors="pt").to(model.device)

out = model.generate(**ids, max_new_tokens=2048, temperature=1.0,
                    top_p=0.95, top_k=20)
print(tok.decode(out[0][len(ids.input_ids[0]):], skip_special_tokens=True))

Recommended sampling

Qwen publishes these defaults for the 3.8 line, and drifting from them is a common cause of disappointing local results:

temperature
1.0
top_p
0.95
top_k
20
min_p
0.0
presence_penalty
0.0
repetition_penalty
1.0

Sizing guide

  • Laptop / edge: Qwen3.5-0.8B, 2B or 4B
  • One consumer GPU: Qwen3.5-9B, or Qwen3.8-27B quantised
  • One server GPU: Qwen3.8-27B at full precision
  • 2 × H100: Qwen3.5-122B-A10B
  • Multi-node cluster: Qwen3.5-397B-A17B or Qwen3.8-2.4T-A95B
  • Apple Silicon: Qwen3-Coder-30B-A3B via MLX remains the popular local coding pick
Two gotchas on Qwen3.8-2.4T-A95B. It is text-only - unlike the hosted Qwen3.8-Max it accepts no images or video - and thinking mode cannot be switched off, so every response contains internal reasoning tokens before the answer. Budget for that in both latency and token cost, and strip reasoning tags before showing output to users.
Practical notes

Things worth knowing before you commit

Context is not free

A one-million-token window is a capability, not an instruction. Retrieval into a 32K prompt is usually faster, cheaper and more accurate than dumping a corpus into a 1M window.

Regions and data residency

Model Studio has separate international and mainland-China deployments with different endpoints, model availability and terms. Pick deliberately if you have data-residency obligations.

Check the licence per model

Apache 2.0 is common but not universal. The Max-class open release carries its own bespoke licence, and some checkpoints are research-only.

Version pinning

With four generations shipped in six months, pin the exact model ID in production and re-evaluate deliberately rather than tracking a moving alias.

Thinking tokens are billed

Reasoning output counts as output tokens. On models with a reasoning_effort dial, tuning it down is often the cheapest real saving.

Evaluate on your own data

The gaps between frontier models on public benchmarks are now smaller than the gap between good and bad prompting on your specific task.