Tongyi Qianwen (Qwen) Model Overview
Tongyi Qianwen is a large language model series developed by Alibaba Cloud, excelling particularly in Chinese language understanding and generation. The Qwen series spans from lightweight to ultra-large-scale models, suitable for scenarios ranging from everyday conversations to complex reasoning. For applications targeting Chinese-speaking users, Qwen is a highly competitive choice.
OpenClaw includes Qwen as a natively supported provider, and you can call any Qwen model variant directly using the unified format qwen/model-name.
Obtaining an API Key
To use Tongyi Qianwen's API service, you need to complete the following steps on the Alibaba Cloud platform:
- Register and log in to your Alibaba Cloud account.
- In the Alibaba Cloud console, search for and activate "Model Service Lingji (DashScope)."
- Create a new API key on the DashScope console's API Key management page.
- Record your API key, as you'll need it for configuration.
Alibaba Cloud typically provides a certain amount of free API calls for new users, allowing you to test before committing to production use.
Quick Configuration
Use OpenClaw's interactive onboarding tool for quick setup:
openclaw onboard
During the onboarding flow, select Qwen as the provider, enter your DashScope API key, and choose a default model.
Manual Configuration File Editing
Manually configure the Qwen model in openclaw.json:
{
"agents": {
"defaults": {
"model": {
"primary": "qwen/qwen-max"
}
}
}
}
Authentication Configuration
{
"providers": {
"qwen": {
"auth": [
{
"key": "your-dashscope-api-key"
}
]
}
}
}
Like all OpenClaw providers, you can configure multiple API keys for account rotation and failover:
{
"providers": {
"qwen": {
"auth": [
{ "key": "key-A", "profile": "primary" },
{ "key": "key-B", "profile": "backup" }
]
}
}
}
When the primary key hits a rate limit, OpenClaw automatically switches to the backup key while applying cooldown tracking on the primary key, re-adding it to the rotation pool once the cooldown period expires.
Qwen Model Recommendations
Tongyi Qianwen offers several model variants at different tiers:
- qwen/qwen-max: The flagship model with the strongest overall capabilities, suitable for complex reasoning, content creation, and professional Q&A.
- qwen/qwen-plus: A balanced variant that strikes a good tradeoff between performance and cost, suitable for most everyday scenarios.
- qwen/qwen-turbo: The fast-response variant with the lowest latency and best cost efficiency, suitable for simple conversations and high-concurrency scenarios.
- qwen/qwen-long: The long-context variant supporting ultra-long text input, suitable for document analysis and long-text summarization.
When choosing a model, weigh capability, speed, and cost based on your actual needs. For most scenarios, qwen-plus is a solid starting point.
Advantages for Chinese Language Scenarios
Qwen performs particularly well in the following Chinese language scenarios:
- Chinese creative writing: Poetry, essays, fiction, and other literary creation.
- Chinese knowledge Q&A: Professional questions about Chinese history, culture, law, and more.
- Chinese-English translation: High-quality bidirectional Chinese-English translation.
- Code generation: Code generation with Chinese comments and documentation.
Configuring a Failover Chain
To ensure high availability, it's recommended to configure failover for Qwen:
{
"agents": {
"defaults": {
"model": {
"primary": "qwen/qwen-max",
"fallback": "openrouter/qwen/qwen-2.5-72b-instruct"
}
}
}
}
When the direct Alibaba Cloud API encounters issues, you can access Qwen models through OpenRouter as a backup channel.
Important Notes
A few things to keep in mind when using Qwen models:
- Regional restrictions: DashScope API servers are deployed in mainland China, so accessing from overseas may result in higher latency.
- Content compliance: Qwen models follow mainland China's content review standards, and responses to certain sensitive topics may be restricted.
- Billing: DashScope charges by token count, with different unit prices for different models. It's advisable to monitor usage in the console.
Verification and Testing
After completing the configuration, send a Chinese test message to verify that Qwen responds correctly. Try some Chinese-specific tasks to experience Qwen's Chinese language capabilities, such as classical Chinese translation or idiom explanations. Check the OpenClaw logs to confirm that requests are being correctly routed to the Qwen provider.