Text Generation Models
Qwen language models for chat, reasoning, and code — from ultra-fast to flagship.
Text Generation Models
QwenAPI offers the full Qwen model family for text generation, ranging from ultra-low-latency models to flagship reasoning models with extended context windows.
Model Overview
Open Source Models
Self-hosted or API access for open-weight models:
qwen3.5-397b-a17b— 397B MoE, top open-source performanceqwen3-235b-a22b— 235B MoE flagship open modelqwen3-32b— Dense 32B, strong reasoning
Quickstart
``python
from openai import OpenAI
client = OpenAI(
api_key="YOUR_QWENAPI_KEY",
base_url="https://dashscope-intl.aliyuncs.com/compatible-mode/v1",
)
response = client.chat.completions.create(
model="qwen3-max",
messages=[{"role": "user", "content": "Explain transformer attention in one paragraph."}],
)
print(response.choices[0].message.content)
`
Thinking Mode
qwen3-max supports extended chain-of-thought reasoning. Enable it with the enable_thinking extra parameter. The model returns a block before its final answer.
`python
response = client.chat.completions.create(
model="qwen3-max",
messages=[{"role": "user", "content": "What is 17 * 83?"}],
extra_body={"enable_thinking": True},
)
Thinking content is in the first choice's message
print(response.choices[0].message.content)
`
Thinking mode increases latency and token usage. Use it for math, logic, and multi-step reasoning tasks where accuracy matters more than speed.
Web Search
Any model supports grounded responses via live web search:
`python
response = client.chat.completions.create(
model="qwen3.5-plus",
messages=[{"role": "user", "content": "What happened in AI news this week?"}],
extra_body={"enable_search": True},
)
`
Choosing a Model
Use qwen-turbo for high-volume, latency-sensitive tasks: classification, extraction, simple Q&A.
Use qwen3.5-flash when you need a step up in quality without a big cost increase.
Use qwen3.5-plus for general-purpose assistants, RAG pipelines, and multimodal inputs.
Use qwen3-max for complex reasoning, agentic workflows, and tasks where output quality is critical.
Use qwen3-coder-plus/flash for code generation, review, and debugging.
Model Versioning
Model names without a date suffix (e.g., qwen3-max) always point to the latest stable version. To pin a specific version, append the release date:
`
qwen3-max-2025-09-19
`
Pinned versions are supported for at least 6 months after a new stable release.
Batch and Caching
qwen3-max` supports both the Batch API (50% off) and prompt caching. Cached tokens are billed at 10% of the standard input rate.
See Batch API for async bulk processing.