Installation
The DashScope client is included in the core Koog library. No additional dependencies required.Quick Start
Authentication
API Key Setup
Get your API key from Alibaba Cloud DashScope.Programmatic Configuration
Available Models
General Chat Models
High-performance models for general tasks.- 1,000,000 token context
- 32,768 max output tokens
- Optimized for speed
- Tools and temperature control
- 1,000,000 token context
- 32,768 max output tokens
- Balanced performance and capabilities
- Tools, speculation, structured JSON
- Multiple choice generation
- Always points to newest Qwen Plus
- Same capabilities as Qwen Plus
- Automatic updates to latest version
- 262,144 token context
- 65,536 max output tokens
- Advanced reasoning
- Tools, speculation, structured JSON
Multimodal Models
Models with vision, audio, and video support.- 65,536 token context
- 16,384 max output tokens
- Text, image, video, and audio I/O
- Audio/video chat
- Visual recognition
- Multilingual speech interactions
Coding Models
Specialized models for code generation and software engineering.- 1,000,000 token context
- 65,536 max output tokens
- Coding agent capabilities
- Tool use and environment interaction
- Retains general abilities
- Structured JSON outputs
- 1,000,000 token context
- 32,768 max output tokens
- High-speed code generation
- Low-latency responses
- Tool calling
Code Examples
Basic Chat Completion
Long Context Processing
Leverage the 1M token context for processing large documents:Function Calling
Code Generation
Structured Output
Vision - Image Analysis
Video Processing
Streaming Responses
Advanced Configuration
Custom Parameters
Web Search Integration
Enable real-time web search for up-to-date information:Reasoning Display
Show the model’s thinking process:Tool Choice Control
Model Capabilities
| Model | Context | Output | Vision | Audio/Video | Tools | Structured JSON |
|---|---|---|---|---|---|---|
| Qwen Flash | 1M | 32K | ❌ | ❌ | ✅ | ❌ |
| Qwen Plus | 1M | 32K | ❌ | ❌ | ✅ | ✅ |
| Qwen Plus Latest | 1M | 32K | ❌ | ❌ | ✅ | ✅ |
| Qwen3 Max | 262K | 65K | ❌ | ❌ | ✅ | ✅ |
| Qwen3 Omni Flash | 65K | 16K | ✅ | ✅ | ✅ | ❌ |
| Qwen3 Coder Plus | 1M | 65K | ❌ | ❌ | ✅ | ✅ |
| Qwen3 Coder Flash | 1M | 32K | ❌ | ❌ | ✅ | ❌ |
Pricing
Pricing varies by model and region. See Alibaba Cloud Pricing for current rates.Best Practices
- Use Qwen Plus for most tasks - excellent balance of capability and performance
- Use Qwen Flash for high-throughput, latency-sensitive applications
- Use Qwen3 Max for complex reasoning requiring advanced capabilities
- Use Qwen3 Coder Plus for software engineering and coding agents
- Leverage 1M context for processing entire codebases or large documents
- Use Qwen3 Omni Flash for multimodal applications with audio/video
- Enable search for real-time information retrieval
- Use Qwen Plus Latest to automatically benefit from model improvements
Use Cases
Large Document Analysis
Large Document Analysis
Use Qwen Plus or Qwen3 Coder Plus with 1M token context to process entire books, codebases, or datasets in a single request.
Software Engineering
Software Engineering
Use Qwen3 Coder Plus for coding agents that can see and understand entire projects, perform multi-file edits, and assist with complex refactoring.
Multimodal Applications
Multimodal Applications
Use Qwen3 Omni Flash for applications requiring text, image, video, and audio understanding - perfect for content analysis and interactive chat.
Real-time Information
Real-time Information
Use Qwen Plus with
enableSearch = true for applications requiring up-to-date information from the web.High-Throughput Systems
High-Throughput Systems
Use Qwen Flash or Qwen3 Coder Flash for applications requiring fast responses with minimal latency.
Complex Reasoning
Complex Reasoning
Use Qwen3 Max with
enableThinking = true for problems requiring advanced reasoning and step-by-step analysis.Limitations
- No embeddings API: Use OpenAI or other providers for embeddings
- No moderation API: Implement custom content filtering
- Regional availability: Some features may vary between international and China endpoints
- Model availability: Some models may require specific API access levels