Appearance
Qwen-Deep-Research
Reference, synced 2026-06-13.
flowchart TD n0["Models"] n1["Overview"] n2["Products"] n3["Solutions"] n4["Pricing"] n5["Resources"] n6["Partners"] n7["Support"] n8["Language"] n0 --> n1 n1 --> n2 n2 --> n3 n3 --> n4 n4 --> n5 n5 --> n6 n6 --> n7 n7 --> n8
Free access Accelerate Delivery with Fixed-Cost Agentic CodingWatch how it works
Models
Empowering AI innovation for both enterprises and developers with Alibaba Cloud’s best-in-class Qwen models, AI-native apps, and AI solutions.
Alibaba Cloud Model Studio \ Enterprise-grade large model service and application development platform.
Try Visual Model \ Supports image understanding, image generation, and video generation.
Models
HappyHorse-1.0-T2V \ Cinematic creative generation, ultimate dynamic details Qwen3-VL-Plus \ Native VL, spatial reasoning, 1M-context video analysis Wan2.7-VideoEdit \ Supports both localized and global editing with prompt
Qwen3.6-Plus \ Native multimodal, 1M context, agentic coding Wan2.7-Image-Pro \ Interactive editing, long-text rendering, precise prompt following Qwen-Plus \ Balanced intelligence, efficient inference, production-ready performance
Qwen-Image-2.0 \ Professional infographics, exquisite photorealism Z-Image-Turbo \ Ultra-fast image generation, high throughput, cost-optimized inference Qwen3-Coder-Next \ Multi-turn tool interactions, future-ready development support
Wan2.7-T2V \ High-fidelity T2V, 15s duration, advanced camera control Wan2.7-I2V \ Cinematic I2V with emotional depth and visceral impact Wan2.7-R2V \ Up to 5 mixed image/video inputs and audio timbre cloning
GenAI Application
Qoder \ Intelligent coding assistant, available for enterprise-dedicated deployment. Qoder CN \ AI-powered coding assistant that boosts developer productivity with intelligent code completion, AI chat, multi-file editing, and task automation.
AI Service
Model Experience \ Experience full-scale, multimodal model capabilities online. Platform for AI \ An AI-native algorithm engineering platform for end-to-end modeling, training, and inference service deployment. Fine-tune Video Generation Model \ Customize Wan’s text-to-video capabilities through model fine-tuning to meet your unique requirements.
AI Use Case
AI Savings Plan Hot \ Save up to 47% on AI costs. Limited-time offer tailored to your usage. AI Video Creation \ Elevate your professional video production with Wan 2.6.
AI Token Plan \ One plan. Multiple models. Big Savings with a Fixed Subscription. AI Image Creation \ All-in-one creative suite for copywriting, image generation, and poster design.
Overview
As a global full-stack AI leader, Alibaba Cloud aims to make computing accessible to everyone and help worldwide customers accelerate innovation.
Why Alibaba Cloud
About Alibaba Cloud \ AI Powered Cloud Technology Our Global Network \ Explore our global presence and deployment regions around the world Our Global Offices \ With offices in 4 continents, we're always close to where it matters.
Asia Accelerator \ Accelerate Success in Asia with Alibaba Cloud Go Global \ Benefits of our Global Alliance Trust Center \ Empowering enterprises with a secure, compliant, and globally trusted cloud infrastructure
Customers and Insights
Olympic Games \ Alibaba Cloud Powers Olympic Games with AI-powered cloud technology Case Studies \ Learn how customers are scaling their businesses on Alibaba Cloud Analyst Reports \ Learn what the top industry analyst firms are saying about Alibaba Cloud
What's New
Events and Webinars \ Quick access to upcoming and on-demand events Product Updates \ Stay informed of the latest innovations Press Room \ Latest news and media releases
Products
Featured ProductsAI & Machine Learning Computing Container Storage Networking & CDN Security Middleware Database Analytics ComputingMedia ServicesEnterprise Services & Cloud CommunicationDomain Names and WebsitesEnd User ComputingServerlessDeveloper ToolsMigration & O&M ManagementApsara Stack
Featured Products
Alibaba Cloud Model Studio \ Supercharge your AI journey effortlessly with industry-leading GenAI models ApsaraDB RDS \ Store and manage your business data, with automated monitoring and backups Certificate Management Service (Original SSL Certificate) \ Create a safe and secure connection between your website and users
Elastic Compute Service (ECS) \ Host websites anywhere and scale enterprise workloads Container Service for Kubernetes (ACK) \ Run and scale containerized applications on managed Kubernetes infrastructure Object Storage Service (OSS) \ Store large amounts of data in the cloud and access it anywhere, anytime
Simple Application Server (SAS) \ All-in-one services for fast deployment Elastic IP Address (EIP) \ Manage your public IPs independently to improve internet network quality Domain Names and Website \ Get the perfect domain name to suit your every need
Related Programs
Solutions
Solutions by Industry Technical Solutions AI WebsitesNetworking Security and ComplianceData and AnalyticsEnterprise Service and ApplicationCloud MigrationCloud NativeHybrid CloudSMB solutions
Financial Services \ Innovate faster with Alibaba Cloud Games \ Grow your game rapidly with high global availability
New Retail \ Alibaba Cloud enables digital retail transformation to fuel growth and realize an omnichannel customer experience throughout the consumer journey. Media and Entertainment \ Ready your content for today's media market with a digitalized media journey
Supply Chain \ Power your supply chain with intelligent, efficient, and reliable solutions Sports \ Digitizing the sports industry with intelligent tech
Sustainability \ Achieve a sustainable future with low-carbon and energy-efficient technologies
Pricing
Flexible options like pay-as-you-go and clear billing rules to meet diverse business needs.
Overview & Tools
Pricing Calculator \ Get an instant pricing estimate based on your usage and needs Free Trial \ Try our 80+ cloud products for free.
Pricing Options \ Get the most out of Alibaba Cloud with flexible pricing
Optimize your cost
Migrate & Save \ Superior Performance At Lower Pricing. Save up to 50%. Promotion Center \ Unlock the latest Alibaba Cloud offers & promos
Resources
Official documentation, extensive tools, training resources, and a community to grow and innovate in the cloud.
Technical Resources
Documentation \ Product guides and FAQs Architecture Center \ Design reliable, secure, and efficient cloud architecture. Intelligent Solution Explorer \ Find the right solution for you, powered by AI
Blog \ Latest cloud insights and developer trends Whitepapers \ Research that explores the how and why behind our technology
Training&Certification
Alibaba Cloud Academy \ Build cloud skills and earn certifications with expert-led training.
Developer Hub
Alibaba Cloud Project Hub \ Explore real-world projects built by developers using our platform. Our Developer MVPs \ Celebrating the developers who lead, build, and inspire our community
Partners
Partner-first strategy offering collaborative product, sales, and service models, plus high-quality partner solutions that complement Alibaba Cloud’s capabilities.
Marketplace
AI Alliance for ISVs \ Partner with us to build and grow AI solutions together ISV Benefits \ Unlock resources, market access, and go-to-market support as an ISV partner
Alibaba Cloud Marketplace \ Explore ready-to-deploy solutions from our partners and ISVs
Find a Partner
Partner Hub \ Find your ideal partner in no time
Become a Partner
Partner Network \ A partner portal for Alibaba Cloud Channel, Technology, MSP partner and other partner programs
Support
Full-lifecycle support and expert services, from cloud advisory and migration to operations.
Support & Professional Services
Professional Services \ Expert-led services to design, migrate, and optimize your cloud journey Support Plans \ Flexible support for every stage — from startup to enterprise
Partner Support Program \ Priority technical support for partners, with dedicated managers and faster issue resolution
Contact us
Connect With Us \
Talk to a sales expert and get a custom quote for your business
Language
- English
- 简体中文
- 繁體中文
- 日本語
- Bahasa Indonesia
Locale
Visit aliyun.com
Documentation
Alibaba Cloud Model Studio
User Guide (Models) User Guide (Application) API Reference (Models) API Reference (Application)
Search for Help Content
Getting Started
The Beginner's Guide
Well-Architected Framework
AI & Machine Learning
Platform For AI
Alibaba Cloud Model Studio
DashVector
Artificial Intelligence Recommendation
OpenSearch
Image Search
Machine Translation
Intelligent Speech Interaction
Optimization Solver
Intelligent Computing LINGJUN
Computing
Elastic Compute Service
Elastic GPU Service
Elastic Container Instance
Dedicated Host
Compute Nest
Simple Application Server
Cloud Box
Auto Scaling
Elastic High Performance Computing
Batch Compute (Deprecated)
Function Compute
Serverless App Engine
ENS
Elastic Desktop Service
App Streaming
WUYING Terminal
Cloud Phone
Edge Network Acceleration
Alibaba Cloud Linux
AgentBay
Container
Container Service for Kubernetes
Container Compute Service
Container Registry
Storage
Object Storage Service
Cloud Parallel File Storage
File Storage NAS
Tablestore
Storage Capacity Unit
Simple Log Service
Cloud Backup
Intelligent Media Management
Drive and Photo Service
Data Transport
Cloud Storage Gateway
Data Online Migration
Hybrid Cloud Storage Array
Storage Services Overview
Backup and Disaster Recovery Center
Networking and CDN
Server Load Balancer
Elastic IP Address
Internet Shared Bandwidth
Data Transfer Plan
Virtual Private Cloud
NAT Gateway
PrivateLink
Alibaba Cloud DNS PrivateZone
Network Intelligence Service
Cloud Data Transfer
IPv6 Gateway
Anycast Elastic IP Address
Cloud Enterprise Network
Global Accelerator
VPN Gateway
Smart Access Gateway
Express Connect
CDN
Edge Security Acceleration
Cloud Network Well-architected Design Guidelines
Security
Anti-DDoS
Web Application Firewall
Cloud Firewall
Security Center
Bastionhost
Secure Access Service Edge
Certificate Management Service
Key Management Service
Data Security Center
Identity as a Service
Fraud Detection
AI Guardrails
Captcha
Blockchain as a Service
ID Verification
Managed Security Service
Middleware
Enterprise Distributed Application Service
Microservices Engine
Alibaba Cloud Service Mesh
SchedulerX
ApsaraMQ for RocketMQ
ApsaraMQ for Kafka
ApsaraMQ for RabbitMQ
ApsaraMQ for MQTT
Simple Message Queue (formerly MNS)
CloudFlow
EventBridge
Application Real-Time Monitoring Service
Managed Service for Prometheus
Managed Service for Grafana
Managed Service for OpenTelemetry
Performance Testing
STAROps
Databases
ApsaraDB Console
PolarDB
ApsaraDB RDS
ApsaraDB for OceanBase (Deprecated)
Tair (Redis® OSS-Compatible)
Lindorm
Time Series Database
ApsaraDB for MongoDB
ApsaraDB for HBase
ApsaraDB for Memcache
ApsaraDB for MyBase
AnalyticDB
ApsaraDB for ClickHouse
ApsaraDB for SelectDB
Data Transmission Service
Database Autonomy Service
Data Management
Database Gateway - Deprecated
ApsaraDB for Cassandra - Deprecated
Analytics Computing
MaxCompute
Hologres
Realtime Compute for Apache Flink
Elasticsearch
Vector Retrieval Service for Milvus
E-MapReduce
Data Lake Formation
DataV
Quick BI
Quick Audience
Quick Tracking
DataWorks
DataHub
Dataphin
Media Services
ApsaraVideo VOD
ApsaraVideo Live
Intelligent Media Services
ApsaraVideo Media Processing
Apsara Video SDK
Enterprise Services & Cloud Communication
Energy Expert
CloudQuotation
Salesforce on Alibaba Cloud
GoChina ICP Filing Assistant
Marketplace
Alibaba Mail
Direct Mail
Short Message Service
Voice Service
Phone Number Verification Service
Cell Phone Number Service
Chat App Message Service
Financial Intelligence Engine
Domain Names and Websites
Domain Names
ICP Filing
Alibaba Cloud DNS
End User Computing
Elastic Desktop Service
App Streaming
WUYING Terminal
Cloud Phone
AgentBay
Internet of Things
IoT Platform
Serverless
Serverless App Engine
CloudFlow
EventBridge
Simple Message Queue (formerly MNS)
Function Compute
Developer Tools
OpenAPI Explorer
Alibaba Cloud SDK
Cloud Shell
Resource Orchestration Service
Alibaba Cloud CLI
BSS OpenAPI
Terraform
Pulumi
Ticket System API
Mobile Platform as a Service
Alibaba Cloud DevOps
API Gateway
Cloud Control API
AI Coding Assistant Lingma
Cloud Skills Portal
Migration & O&M Management
CloudOps Orchestration Service
Cloud Monitor
Intelligent Advisor
Cloud Governance Center
ActionTrail
Cloud Config
Resource Access Management
Resource Management
Cloud Architect Design Tools
Migration Hub
Server Migration Center
Service Catalog
Logic Composer
Quota Center
CloudSSO
HTTPDNS
Solutions
SAP
SuperApp
OpenLake
Membership Service
Expenses and Costs
Account Center
More
Support
Legal
Tech Share Terms and Conditions
After Sales Support
China Gateway Program
Service Level Objectives
Management Console
Security Control
Automates complex research through planning, multiple rounds of web searches, and structured report generation. Gathers and synthesizes information without manual effort.
Note
This document applies only to the Chinese mainland (Beijing) region. To use the model, use an API key from the Chinese mainland (Beijing) region.
Getting started
Create an API key and export the API key as an environment variable. If you use an SDK to make calls, install the DashScope SDK.
The model uses a two-step workflow: a follow-up question step (the model clarifies your research scope) and a deep research step (the model searches, analyzes, and generates a report). The follow-up question lets the model understand exactly what to investigate before starting a lengthy research run.
Currently, the model does not support DashScope SDK for Java or OpenAI-compatible API calls.
Python
curl
Python
python
import os
import dashscope
# Configure the API key
# If not set, replace the following line with your Model Studio API key (format: sk-xxx)
API_KEY = os.getenv('DASHSCOPE_API_KEY')
def call_deep_research_model(messages, step_name):
print(f"\n=== {step_name} ===")
try:
responses = dashscope.Generation.call(
api_key=API_KEY,
model="qwen-deep-research",
messages=messages,
# The qwen-deep-research model currently only supports streaming output
stream=True
# incremental_output=True Add this parameter for incremental output
)
return process_responses(responses, step_name)
except Exception as e:
print(f"An error occurred when calling the API: {e}")
return ""
# Display phase content
def display_phase_content(phase, content, status):
if content:
print(f"\n[{phase}] {status}: {content}")
else:
print(f"\n[{phase}] {status}")
# Process the response
def process_responses(responses, step_name):
current_phase = None
phase_content = ""
research_goal = ""
web_sites = []
references = []
keepalive_shown = False # Flag to check if the KeepAlive prompt has been shown
for response in responses:
# Check the response status code
if hasattr(response, 'status_code') and response.status_code != 200:
print(f"HTTP return code: {response.status_code}")
if hasattr(response, 'code'):
print(f"Error code: {response.code}")
if hasattr(response, 'message'):
print(f"Error message: {response.message}")
print("For more information, see: https://www.alibabacloud.com/help/en/model-studio/error-code")
continue
if hasattr(response, 'output') and response.output:
message = response.output.get('message', {})
phase = message.get('phase')
content = message.get('content', '')
status = message.get('status')
extra = message.get('extra', {})
# Phase change detection
if phase != current_phase:
if current_phase and phase_content:
# Display different completion descriptions based on phase and step names
if step_name == "Step 1: Model query confirmation" and current_phase == "answer":
print(f"\n Query confirmation phase completed")
else:
print(f"\n {current_phase} phase completed")
current_phase = phase
phase_content = ""
keepalive_shown = False # Reset KeepAlive prompt flag
# Display different descriptions based on phase and step names
if step_name == "Step 1: Model query confirmation" and phase == "answer":
print(f"\n Entering query confirmation phase")
else:
print(f"\n Entering {phase} phase")
# Process reference information in the Answer phase
if phase == "answer":
if extra.get('deep_research', {}).get('references'):
new_references = extra['deep_research']['references']
if new_references and new_references != references: # Avoid duplicate display
references = new_references
print(f"\n References ({len(references)}):")
for i, ref in enumerate(references, 1):
print(f" {i}. {ref.get('title', 'No title')}")
if ref.get('url'):
print(f" URL: {ref['url']}")
if ref.get('description'):
print(f" Description: {ref['description'][:100]}...")
print()
# Process special information in the WebResearch phase
# Note: The qwen-deep-research-2025-12-15 model uses the streamingThinking status
# instead of streamingQueries and streamingWebResult
if phase == "WebResearch":
if extra.get('deep_research', {}).get('research'):
research_info = extra['deep_research']['research']
# Process streamingThinking (snapshot model) or streamingQueries (mainline model) status
if status in ("streamingThinking", "streamingQueries"):
if 'researchGoal' in research_info:
goal = research_info['researchGoal']
if goal:
research_goal += goal
print(f"\n Research goal: {goal}", end='', flush=True)
# Process streamingWebResult status (mainline model)
# The snapshot model merges this status using streamingThinking
elif status == "streamingWebResult":
if 'webSites' in research_info:
sites = research_info['webSites']
if sites and sites != web_sites: # Avoid duplicate display
web_sites = sites
print(f"\n Found {len(sites)} relevant websites:")
for i, site in enumerate(sites, 1):
print(f" {i}. {site.get('title', 'No title')}")
print(f" Description: {site.get('description', 'No description')[:100]}...")
print(f" URL: {site.get('url', 'No link')}")
if site.get('favicon'):
print(f" Icon: {site['favicon']}")
print()
# Process WebResultFinished status
elif status == "WebResultFinished":
print(f"\n Web search completed. Found {len(web_sites)} reference sources.")
if research_goal:
print(f" Research goal: {research_goal}")
# Accumulate and display content
if content:
phase_content += content
# Display content in real-time
print(content, end='', flush=True)
# Display phase status changes
if status and status != "typing":
print(f"\n Status: {status}")
# Display status description
if status == "streamingThinking":
print(" → Decomposing research tasks and summarizing web content (WebResearch phase)")
elif status == "streamingQueries":
print(" → Generating research goals and search queries (WebResearch phase)")
elif status == "streamingWebResult":
print(" → Performing searches, web page reading, and code execution (WebResearch phase)")
elif status == "WebResultFinished":
print(" → Web search phase completed (WebResearch phase)")
# When status is finished, display token consumption
if status == "finished":
if hasattr(response, 'usage') and response.usage:
usage = response.usage
print(f"\n Token consumption statistics:")
print(f" Input tokens: {usage.get('input_tokens', 0)}")
print(f" Output tokens: {usage.get('output_tokens', 0)}")
print(f" Request ID: {response.get('request_id', 'Unknown')}")
if phase == "KeepAlive":
# Only display the prompt the first time entering the KeepAlive phase
if not keepalive_shown:
print("Current step completed. Preparing for the next step.")
keepalive_shown = True
continue
if current_phase and phase_content:
if step_name == "Step 1: Model query confirmation" and current_phase == "answer":
print(f"\n Query confirmation phase completed")
else:
print(f"\n {current_phase} phase completed")
return phase_content
def main():
# Check API key
if not API_KEY:
print("Error: DASHSCOPE_API_KEY environment variable not set")
print("Set the environment variable or modify the API_KEY variable directly in the code")
return
print("User initiates conversation: Research the application of artificial intelligence in education")
# Step 1: Model query confirmation
# The model analyzes the user's question and asks clarifying questions to define the research direction
messages = [{'role': 'user', 'content': 'Research the application of artificial intelligence in education'}]
step1_content = call_deep_research_model(messages, "Step 1: Model query confirmation")
# Step 2: Deep research
# Based on the query confirmation from Step 1, the model performs the full research process
messages = [\
{'role': 'user', 'content': 'Research the application of artificial intelligence in education'},\
{'role': 'assistant', 'content': step1_content}, # Includes the model's query confirmation content\
{'role': 'user', 'content': 'I mainly focus on personalized learning and intelligent assessment'}\
]
call_deep_research_model(messages, "Step 2: Deep research")
print("\n Research completed!")
if __name__ == "__main__":
main()curl
curl
echo "Step 1: Model query confirmation"
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation' \
--header 'X-DashScope-SSE: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"messages": [\
{\
"content": "Research the application of artificial intelligence in education",\
"role": "user"\
}\
]
},
"model": "qwen-deep-research"
}'
echo -e "\n\n"
echo "Step 2: Deep research"
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation' \
--header 'X-DashScope-SSE: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"messages": [\
{\
"content": "Research the application of artificial intelligence in education",\
"role": "user"\
},\
{\
"content": "Tell me which specific application scenarios of artificial intelligence in education you want to focus on?",\
"role": "assistant"\
},\
{\
"content": "I mainly focus on personalized learning",\
"role": "user"\
}\
]
},
"model": "qwen-deep-research"
}'Specifications
| Model | Context window (tokens) | Max input (tokens) | Max output (tokens) |
|---|
| Model | Context window (tokens) | Max input (tokens) | Max output (tokens) |
| qwen-deep-research | 1,000,000 | 997,952 | 32,768 |
| qwen-deep-research-2025-12-15 |
Note
qwen-deep-research: mainline model, continuously updated. qwen-deep-research-2025-12-15: snapshot version with improved depth, quality, and MCP tool calling. Both support image input and are billed separately.
Core capabilities
Track progress via phase (current task) and status (task progress).
Follow-up question and report generation (phase: "answer")
Analyzes your query, asks clarifying questions to define the scope, and generates the final research report.
Status values:
typing: Generating text contentfinished: Text content generation completed
Research planning (phase: "ResearchPlanning")
Creates a research outline from your query.
Status values:
typing: Generating the research planfinished: Research plan completed
Web search (phase: "WebResearch")
Performs multiple rounds of web searches and content analysis. WebResultFinished signals the end of each round. finished signals the end of the phase.
Status values:
streamingThinking: Decomposing research tasks and summarizing web content (specific toqwen-deep-research-2025-12-15, replacesstreamingQueriesandstreamingWebResult)streamingQueries: Generating search queries (forqwen-deep-researchonly)streamingWebResult: Performing web searches and analyzing web content (forqwen-deep-researchonly)WebResultFinished: Search round completedfinished: Web search phase completed
Connection keepalive (phase: "KeepAlive")
Maintains the connection between long-running tasks. Ignore this phase and continue processing.
Image input
Both models support image input. The model analyzes the image and incorporates that content into its research. Use array format for the content field, passing image and text objects together.
Supported formats: JPEG, PNG, BMP, WEBP. Maximum 10 MB per image.
Up to 5 images per request. Supports public URLs and Base64 encoding.
The response format is identical to text-only requests. The model generates a report based on the image content.
Request example
Python
curl
Python
python
import os
import dashscope
API_KEY = os.getenv('DASHSCOPE_API_KEY')
messages = [\
{\
"role": "user",\
"content": [\
{"image": "https://example.aliyuncs.com/example.png"},\
{"text": "Analyze the data trends in this chart and conduct in-depth research on key findings"}\
]\
}\
]
responses = dashscope.Generation.call(
api_key=API_KEY,
model="qwen-deep-research",
messages=messages,
stream=True
)
for response in responses:
if hasattr(response, 'output') and response.output:
message = response.output.get('message', {})
content = message.get('content', '')
if content:
print(content, end='', flush=True)curl
curl
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation' \
--header 'X-DashScope-SSE: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"messages": [\
{\
"content": [\
{"image": "https://example.aliyuncs.com/example.png"},\
{"text": "Analyze the data trends in this chart and conduct in-depth research on key findings"}\
],\
"role": "user"\
}\
]
},
"model": "qwen-deep-research"
}'MCP tool calling
Note
MCP tool calling is only supported by qwen-deep-research-2025-12-15. qwen-deep-research does not support this feature.
Model Context Protocol (MCP) tool calling lets qwen-deep-research-2025-12-15 pull from private or domain-specific data sources during the WebResearch phase—such as a knowledge base, internal documents, or a proprietary database—alongside standard web searches. Pass MCP server configuration through the research_tools parameter. The response format is identical to standard calls.
For details about
research_toolsand MCP tool specifications, see Qwen-Deep-Research .
Request example
Python
curl
Python
python
import os
import dashscope
API_KEY = os.getenv('DASHSCOPE_API_KEY')
messages = [\
{\
"role": "user",\
"content": "Use the knowledge base to search for recently published product update announcements and compile them into a research report"\
}\
]
responses = dashscope.Generation.call(
api_key=API_KEY,
model="qwen-deep-research-2025-12-15",
messages=messages,
stream=True,
research_tools=[{\
"type": "mcp",\
"server_label": "my-server",\
"server_url": "https://your-mcp-server.example.com/sse",\
"allowed_tools": ["search", "fetch"],\
"authentication": {\
"bearer": "your_jwt_token_here"\
}\
}]
)
for response in responses:
if hasattr(response, 'output') and response.output:
message = response.output.get('message', {})
content = message.get('content', '')
if content:
print(content, end='', flush=True)curl
curl
curl --location 'https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation' \
--header 'X-DashScope-SSE: enable' \
--header "Authorization: Bearer $DASHSCOPE_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"input": {
"messages": [\
{\
"content": "Use the knowledge base to search for recently published product update announcements and compile them into a research report",\
"role": "user"\
}\
]
},
"model": "qwen-deep-research-2025-12-15",
"parameters": {
"research_tools": [{\
"type": "mcp",\
"server_label": "my-server",\
"server_url": "https://your-mcp-server.example.com/sse",\
"allowed_tools": ["search", "fetch"],\
"authentication": {\
"bearer": "your_jwt_token_here"\
}\
}]
}
}'Billing
| Model | Input cost (per 1K tokens) | Output cost (per 1K tokens) | Free quota |
|---|
| Model | Input cost (per 1K tokens) | Output cost (per 1K tokens) | Free quota |
| qwen-deep-research | $0.007742 | $0.023367 | No free quota |
| qwen-deep-research-2025-12-15 | To be determined | To be determined | No free quota |
Billing is based on input tokens (user messages and system prompts) and output tokens (follow-up questions, research plans, goals, search queries, and the final report). The two models are billed separately.
Going live
Use streaming output
The model only supports streaming output (stream=True). A single research task can run for several minutes across dozens of iterative search-and-read cycles, which exceeds the timeout of a synchronous request. Use streaming to keep the connection open and track progress via phase and status fields.
Handle errors
Check the response status code on each chunk. For non-200 status codes, read the code and message fields and handle them appropriately.
Monitor token usage
When status is finished, retrieve token usage from response.usage (input tokens, output tokens, and request ID).
Handle connection keepalive
The KeepAlive phase maintains the connection between long-running tasks. Ignore this phase and continue processing the stream.
FAQ
- Why is the output field empty for some response chunks?
Early chunks carry metadata only. Content arrives in subsequent chunks as the model generates it.
- How do I determine if a phase is complete?
A phase completes when status changes to finished.
- Does the model support OpenAI-compatible API calls?
No. OpenAI-compatible API calls are not supported.
- How are input and output tokens calculated?
Input tokens: user messages and system prompts. Output tokens: follow-up questions, research plans, goals, search queries, and the final report.
- What is the difference between qwen-deep-research and qwen-deep-research-2025-12-15?
qwen-deep-research: mainline model, continuously updated. qwen-deep-research-2025-12-15: snapshot version with improved depth, quality, and MCP support. Both support image input and are billed separately.
- How do I pass images for research?
Use array format for content: pass {"image": "URL"} and {"text": "description"} as objects in the array. Both models support image input.
- How do I skip the follow-up question and go straight to research?
API reference
For input and output parameters, see Qwen-Deep-Research.
Error codes
If the model call fails and returns an error message, see Error messages for resolution.
Rate limiting
See Rate limiting.
Previous: Data mining (Qwen-Doc)Next: Mathematical capabilities (Qwen-Math)
Is this page helpful?
Getting started
Specifications
Core capabilities
Image input
MCP tool calling
Request example
Billing
Going live
FAQ
API reference
Error codes
Rate limiting
Contact Us
Sales Support
Live-chat with our sales team or get in touch with a business development professional in your region.
Contact Sales
Technical Support
Open a ticket and get quick help from our technical team.
Open a Ticket >
Connect & Report Abuse
We look forward to your suggestion.
Post a Suggestion > Report Abuse >
\ \ Hi, I'm Alibaba Cloud AI Assistant!\ \ I can help with questions and solutions.
Why Alibaba Cloud
About Alibaba Cloud
Asia Accelerator
Our Global Network
Global Offices
Trust Center
Case Studies
Analyst Reports
Products & Pricings
Pricing Calculator
ECS
SAS
Model Studio
Database
Security
SMS
Solutions
Financial Services
Retail Services
Media Services
Gaming Services
ISV Solutions
Engage
Developer Community
Partner Network
Startups
Marketplace
Join Alibaba Cloud
Resources & Support
Developer Learning Hub
Documentation Center
Training & Certification
Service Notices
Submit a Ticket
Security Report
Qwen Cloud
Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links
© 2009-2026 Copyright by Alibaba Cloud All rights reserved
- YouTube
- TikTok
- contact.us@alibabacloud.com
- Call Us Now
- Discord
© 2009-2026 Copyright by Alibaba Cloud All rights reserved
Careers About Us Privacy Policy Legal Integrity Compliance Reporting Channel Service Notices Links