Appearance
Wan 2.7 - image-to-video API
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
The Wan 2.7 image-to-video model supports multimodal input (text, images, audio, and video) and performs three tasks: first-frame-to-video, first-and-last-frame-to-video, and video continuation.
References: User guide
Note
The new image-to-video API (wan2.7 model) supports all three tasks. The earlier image-to-video from first frame API (wan2.6 and earlier) supports only first-frame-to-video.
Availability
The model, endpoint URL, and API key must belong to the same region. Cross-region calls fail.
Select a model: Verify that the model is available in your target region.
Select a URL: Choose the endpoint URL that matches your model's region. Both HTTP and DashScope SDK URLs are supported.
Configure an API key: Get an API key for the region, and then configure the API key as an environment variable.
Install the SDK: To make API calls with the SDK, install the DashScope SDK.
Note
The sample code in this topic applies to the Singapore region.
Important
The legacy domain https://dashscope-intl.aliyuncs.com for the Singapore region will be deprecated soon. Please migrate to the new domain https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com as soon as possible.
HTTP
Important
This API uses the new image-to-video protocol and supports only the wan2.7 model.
Image-to-video tasks typically take 1 to 5 minutes, so the API uses asynchronous invocation. The workflow has two steps: create a task, then poll for the result.
Step 1: Create a task and get the task ID
Singapore
Beijing
POST https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Replace WorkspaceId with your actual Workspace ID.
POST https://dashscope.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis
Note
After the task is created, use the returned
task_idto query the result. Thetask_idis valid for 24 hours. Do not create duplicate tasks. Instead, use polling to retrieve the result.For guidance for beginners, see Call APIs with Postman or cURL.
| #### Request parameters | Video generation from the first frame Video generation from the first and last frames Video continuation Generate a video based on a first frame image and audio. curl curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \ -H 'X-DashScope-Async: enable' \ -H "Authorization: Bearer $DASHSCOPE_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "wan2.7-i2v-2026-04-25", "input": { "prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of the rap, with no other dialogue or noise.", "media": [ { "type": "first_frame", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png" }, { "type": "driving_audio", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3" } ] }, "parameters": { "resolution": "720P", "duration": 10, "prompt_extend": true, "watermark": true } }' Pass a first frame and a last frame to generate a video. curl curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \ -H 'X-DashScope-Async: enable' \ -H "Authorization: Bearer $DASHSCOPE_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "wan2.7-i2v-2026-04-25", "input": { "prompt": "Realistic style, a small black cat looks up at the sky curiously. The camera angle gradually rises from eye level, finally capturing its curious gaze from a top-down view.", "media": [ { "type": "first_frame", "url": "https://wanx.alicdn.com/material/20250318/first_frame.png" }, { "type": "last_frame", "url": "https://wanx.alicdn.com/material/20250318/last_frame.png" } ] }, "parameters": { "resolution": "720P", "duration": 10, "prompt_extend": false, "watermark": true } }' Generate subsequent content based on an initial video clip. curl curl --location 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/services/aigc/video-generation/video-synthesis' \ -H 'X-DashScope-Async: enable' \ -H "Authorization: Bearer $DASHSCOPE_API_KEY" \ -H 'Content-Type: application/json' \ -d '{ "model": "wan2.7-i2v-2026-04-25", "input": { "prompt": "A girl takes a selfie in the mirror, then leaves with her backpack.", "media": [ { "type": "first_clip", "url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20260129/hfugmr/wan-r2v-role1.mp4" } ] }, "parameters": { "resolution": "720P", "duration": 10, "prompt_extend": true, "watermark": true } }' |
Content-Typestring (Required) The content type of the request. Must be application/json. | |
Authorizationstring (Required) Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
X-DashScope-Asyncstring (Required) Enables asynchronous processing. HTTP requests support only asynchronous calls. Must be enable. Important If this request header is missing, the error "current user api does not support synchronous calls" is returned. | |
| ##### Request body | |
modelstring (Required) The model name. For a list of models and their pricing, see Model pricing. Example: wan2.7-i2v-2026-04-25. | |
inputobject (Required) Basic input information, including the prompt. Properties promptstring (Optional) Text prompt that describes the elements and visual characteristics for the generated video. Chinese and English are supported. Up to 5,000 characters. Each Chinese character or letter counts as one character. Text that exceeds the limit is automatically truncated. Example: A kitten runs on the grass. For more information about how to use prompts, see Text-to-video/image-to-video prompt guide. negative_promptstring (Optional) Describes content to exclude from the video. Chinese and English are supported. Maximum 500 characters. Text that exceeds the limit is automatically truncated. Example: low resolution, error, worst quality, low quality, deformed, extra fingers, bad proportions. mediaarray (Required) Reference materials (images, audio, and video) for video generation. Each element is a media object with type and url fields. Asset combinations Only the following asset combinations are valid. Invalid combinations return an error. - Video generation from the first frame: - First frame: first_frame - First frame + audio: first_frame+driving_audio - Video generation from the first and last frames: - First frame + last frame: first_frame+last_frame - First frame + last frame + audio: first_frame+last_frame+driving_audio - Video continuation: - First video clip continuation: first_clip - First video clip + last frame continuation: first_clip+last_frame Properties typestring (Required) The media asset type. Valid values: - first_frame - last_frame - driving_audio - first_clip Limit: Each type can appear at most once in the media array. For example, you cannot pass two first_frame assets. urlstring (Required) The URL of the media asset (image, audio, or video). Pass an image (type=first_frame or last_frame) URL or Base64-encoded data for the first or last frame image. Image limits: - Format: JPEG, JPG, PNG (alpha channel not supported), BMP, WEBP. - Resolution: The width and height must be in the range of [240, 8000] pixels. - Aspect ratio: 1:8 to 8:1. - File size: up to 20 MB. Supported input formats: 1. Public URL: - The HTTP or HTTPS protocol is supported. - Example: https://xxx/xxx.png. 2. A Base64-encoded image string: - Data format: data:{MIME_type};base64,{base64_data}. - Example: data:image/png;base64,GDU7MtCZzEbTbmRZ...... (The example is truncated for demonstration purposes). Base64-encoded data format Format: data:{MIME_type};base64,{base64_data} . - {base64_data}: The Base64-encoded string of the image file. - {MIME_type}: The Multipurpose Internet Mail Extensions (MIME) type of the image, which must correspond to the file format. Pass audio (type=driving_audio) URL of the audio file. - With audio: The model uses it as a driving source for lip-sync and action timing. - Without audio: The model automatically generates matching background music or sound effects. Audio limits: - Format: wav, mp3. - Duration: 2 s to 30 s. - File size: up to 15 MB. - Truncation: If the audio duration exceeds the duration value (for example, 5 s), the audio is automatically truncated to the first 5 seconds, and the rest is discarded. If the audio duration is shorter than the video duration, the portion of the video that exceeds the audio duration will be silent. For example, if the audio is 3 s long and the video is 5 s long, the first 3 seconds of the output video will have sound, and the last 2 seconds will be silent. Supported input formats: 1. Public URL: - The HTTP and HTTPS protocols are supported. - Example: https://xxx/xxx.mp3. Pass a video (type=first_clip) URL of the video file. The model generates a continuation based on the video content. The duration parameter controls the maximum total duration of the output. > For example, if duration=15 and the input video is 3 s long, the model generates a 12-s continuation. The final output video is 15 s long and is billed for 15 s. Video limits: - Format: mp4, mov. - Duration: 2 s to 10 s. - Resolution: The width and height must be in the range of [240, 4096] pixels. - Aspect ratio: 1:8 to 8:1. - File size: up to 100 MB. Supported input formats: 1. Public URL: - The HTTP and HTTPS protocols are supported. - Example: https://xxx/xxx.mp4. | |
parametersobject (Optional) Video processing parameters: resolution, duration, prompt rewriting, and watermarks. Properties resolutionstring (Optional) Important Resolution directly affects cost. Before calling, check the Model pricing. Resolution tier for the generated video. Controls the total pixel count. The model automatically scales the video to a total pixel count close to the selected tier. The output aspect ratio follows the input material (first frame or first video clip). For details, see FAQ. Valid values are 720P and 1080P. Default: 1080P. durationinteger (Optional) Important Duration directly affects cost. Billing is per second. Before calling, check the Model pricing. Duration of the generated video in seconds. Valid range depends on the model: Valid values: an integer from 2 to 15. Default: 5. prompt_extendboolean (Optional) Whether to enable prompt rewriting. When enabled, a model rewrites the input prompt to improve results for short prompts, but increases processing time. - true (default) - false watermarkboolean (Optional) Whether to add an "AI Generated" watermark in the lower-right corner of the video. - false (default) - true seedinteger (Optional) The random number seed must be an integer in the range [0, 2147483647]. If not specified, a random seed is generated. A fixed seed improves reproducibility. Because model generation is probabilistic, the same seed does not guarantee identical results. |
| #### Response parameters | Successful response Error response Save the task_id to query the task status and result. json { "output": { "task_status": "PENDING", "task_id": "0385dc79-5ff8-4d82-bcb6-xxxxxx" }, "request_id": "4909100c-7b5a-9f92-bfe5-xxxxxx" } Task creation failed. See Error codes. json { "code": "InvalidApiKey", "message": "No API-key provided.", "request_id": "7438d53d-6eb8-4596-8835-xxxxxx" } |
outputobject Task output information. Properties task_idstring The task ID. Valid for queries for 24 hours. task_statusstring The status of the task. Enumeration values - PENDING - RUNNING - SUCCEEDED - FAILED - CANCELED - UNKNOWN: The task does not exist or its status is unknown. | |
request_idstring Unique request identifier for tracing and troubleshooting. | |
codestring Error code. Returned only for failed requests. See Error codes. | |
messagestring Detailed error message. Returned only for failed requests. See Error codes. |
Step 2: Query the result by task ID
Singapore
Beijing
GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id}
Replace WorkspaceId with your actual Workspace ID.
GET https://dashscope.aliyuncs.com/api/v1/tasks/{task_id}
Note
Polling recommendation: Video generation takes several minutes. Use a polling mechanism with a reasonable interval, such as 15 seconds.
Task state transition: PENDING → RUNNING → SUCCEEDED or FAILED.
Result link: After a task succeeds, a video URL valid for 24 hours is returned. Download and save the video to permanent storage, such as OSS.
task_idvalidity: 24 hours. After this period, queries return the task status asUNKNOWN.
| #### Request parameters | Query task result Replace {task_id} with the task_id value returned by the previous API call. The task_id is valid for queries for 24 hours. curl curl -X GET https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1/tasks/{task_id} \ --header "Authorization: Bearer $DASHSCOPE_API_KEY" |
| ##### Headers | |
Authorizationstring (Required) Authenticates the request with a Model Studio API key. Example: Bearer sk-xxxx. | |
| ##### Path parameters | |
task_idstring (Required) The ID of the task. |
| #### Response parameters | Task successful Task failed Task query expired Video URLs are valid for only 24 hours and then automatically purged. Save generated videos promptly. json { "request_id": "2ca1c497-f9e0-449d-9a3f-xxxxxx", "output": { "task_id": "af6efbc0-4bef-4194-8246-xxxxxx", "task_status": "SUCCEEDED", "submit_time": "2025-09-25 11:07:28.590", "scheduled_time": "2025-09-25 11:07:35.349", "end_time": "2025-09-25 11:17:11.650", "orig_prompt": "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.", "video_url": "https://dashscope-result-sh.oss-cn-shanghai.aliyuncs.com/xxx.mp4?Expires=xxx" }, "usage": { "duration": 15, "input_video_duration": 0, "output_video_duration": 15, "video_count": 1, "SR": 720 } } When a task fails, task_status is FAILED with an error code and message. See Error codes. json { "request_id": "e5d70b02-ebd3-98ce-9fe8-759d7d7b107d", "output": { "task_id": "86ecf553-d340-4e21-af6e-a0c6a421c010", "task_status": "FAILED", "code": "InvalidParameter", "message": "The size is not match xxxxxx" } } The task_id is valid for 24 hours. After this period, queries return the following error. json { "request_id": "a4de7c32-7057-9f82-8581-xxxxxx", "output": { "task_id": "502a00b1-19d9-4839-a82f-xxxxxx", "task_status": "UNKNOWN" } } |
outputobject Task output information. Properties task_idstring The task ID. Valid for queries for 24 hours. task_statusstring The status of the task. Enumeration values - PENDING - RUNNING - SUCCEEDED - FAILED - CANCELED - UNKNOWN: The task does not exist or its status is unknown. State transitions during polling: - PENDING → RUNNING → SUCCEEDED or FAILED. - The initial query status is usually PENDING or RUNNING. - When the status changes to SUCCEEDED, the response contains the generated video URL. - If the status is FAILED, check the error message and retry the task. submit_timestring The time when the task was submitted. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS. scheduled_timestring The time when the task was executed. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS. end_timestring The time when the task was completed. The time is in UTC+8 and the format is YYYY-MM-DD HH:mm:ss.SSS. video_urlstring URL of the generated video. Returned only when task_status is SUCCEEDED. Valid for 24 hours. The video is in MP4 format with H.264 encoding. orig_promptstring The original input prompt, corresponding to the request parameter prompt. codestring Error code. Returned only for failed requests. See Error codes. messagestring Detailed error message. Returned only for failed requests. See Error codes. | |
usageobject Usage statistics. Calculated only for successful tasks. Properties input_video_durationinteger Duration of the input video, in seconds. output_video_durationinteger Duration of the output video, in seconds. durationinteger Total video duration used for billing. SRinteger Output video resolution. Example: 720. video_countinteger Number of output videos. Fixed at 1. | |
request_idstring Unique request identifier for tracing and troubleshooting. |
DashScope SDK
The SDK parameter names match those in the HTTP API. The parameter structure is encapsulated based on language conventions.
Image-to-video tasks typically take 1 to 5 minutes. The SDK encapsulates the HTTP asynchronous invocation process and supports both synchronous and asynchronous calls.
Actual processing time depends on the task queue and service load. Wait for the result.
Python SDK
Important
Make sure the DashScope Python SDK version is not lower than 1.25.16 before running the following code.
If the version is too old, errors such as "url error, please check url!" may occur. For more information, see Install the SDK to update it.
Set dashscope.base_http_api_url based on the model's region:
Singapore
Beijing
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
Replace WorkspaceId with your actual Workspace ID.
dashscope.base_http_api_url = 'https://dashscope.aliyuncs.com/api/v1'
Synchronous call
Asynchronous call
Request example
python
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# This is the URL for the Singapore region. The URL varies by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/image-to-video-general-api-reference
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# If you have not configured the environment variable, replace the following line with: api_key="sk-xxx"
# API keys vary by region. For more information, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
media = [\
{\
"type": "first_frame",\
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"\
},\
{\
"type": "driving_audio",\
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"\
}\
]
def sample_sync_call():
print('----Synchronous call, please wait a moment----')
rsp = VideoSynthesis.call(
api_key=api_key,
model="wan2.7-i2v-2026-04-25",
media=media,
resolution="720P",
duration=10,
watermark=True,
prompt="An urban fantasy art scene featuring a dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night, lit by a single street lamp. This creates a cinematic atmosphere with high energy and amazing detail. The video's audio consists entirely of the rap, with no other dialogue or noise.",
)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_sync_call()Response example
The video_url is valid for 24 hours. Download the video promptly.
json
{
"status_code": 200,
"request_id": "ac5faf37-ddfa-9720-a0c5-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "b97c6d86-ad73-4bb7-80ff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-04-13 10:45:47.597",
"scheduled_time": "2026-04-13 10:45:56.342",
"end_time": "2026-04-13 10:47:26.273",
"orig_prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He performs a fast-paced English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere with high energy and incredible detail. The audio consists solely of the rap, with no other dialogue or background noise."
},
"usage": {
"video_count": 1,
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"SR": 720
}
}Request example
python
# -*- coding: utf-8 -*-
from http import HTTPStatus
from dashscope import VideoSynthesis
import dashscope
import os
# This is the URL for the Singapore region. The URL varies by region. To obtain the URL for your region, see https://www.alibabacloud.com/help/en/model-studio/image-to-video-general-api-reference
dashscope.base_http_api_url = 'https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1'
# If the environment variable is not set, replace the following line with: api_key="sk-xxx"
# API keys vary by region. To obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
api_key = os.getenv("DASHSCOPE_API_KEY")
media = [\
{\
"type": "first_frame",\
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png"\
},\
{\
"type": "driving_audio",\
"url": "https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3"\
}\
]
def sample_async_call():
# Submit an asynchronous task. Information about the task is returned immediately.
rsp = VideoSynthesis.async_call(
api_key=api_key,
model="wan2.7-i2v-2026-04-25",
media=media,
resolution="720P",
duration=10,
watermark=True,
prompt="A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of the rap, with no other dialogue or noise.",
)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print("task_id: %s" % rsp.output.task_id)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
# Query the task status.
status = VideoSynthesis.fetch(task=rsp, api_key=api_key)
if status.status_code == HTTPStatus.OK:
print(status.output.task_status)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(status.status_code, status.code, status.message))
# Wait for the task to complete.
rsp = VideoSynthesis.wait(task=rsp, api_key=api_key)
print(rsp)
if rsp.status_code == HTTPStatus.OK:
print(rsp.output.video_url)
else:
print('Failed, status_code: %s, code: %s, message: %s' %
(rsp.status_code, rsp.code, rsp.message))
if __name__ == '__main__':
sample_async_call()Response example
- Response example for creating a task
json
{
"status_code": 200,
"request_id": "6dc3bf6c-be18-9268-9c27-xxxxxx",
"code": "",
"message": "",
"output": {
"task_id": "686391d9-7ecf-4290-a8e9-xxxxxx",
"task_status": "PENDING",
"video_url": ""
},
"usage": null
}- Response example for querying a task result
The video_url is valid for 24 hours. Download the video promptly.
json
{
"status_code": 200,
"request_id": "ac5faf37-ddfa-9720-a0c5-xxxxxx",
"code": null,
"message": "",
"output": {
"task_id": "b97c6d86-ad73-4bb7-80ff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"submit_time": "2026-04-13 10:45:47.597",
"scheduled_time": "2026-04-13 10:45:56.342",
"end_time": "2026-04-13 10:47:26.273",
"orig_prompt": "An urban fantasy art scene. A dynamic graffiti character. A boy made of spray paint comes to life on a concrete wall. He performs a fast-paced English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere with high energy and incredible detail. The audio consists solely of the rap, with no other dialogue or background noise."
},
"usage": {
"video_count": 1,
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"SR": 720
}
}Java SDK
Important
Ensure that the DashScope Java SDK version is not lower than 2.22.14 before running the following code.
If the version is too old, errors such as "url error, please check url!" may occur. For more information, see Install the SDK to update it.
Set Constants.baseHttpApiUrl based on the model's region:
Singapore
Beijing
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1"
Replace WorkspaceId with your actual Workspace ID.
Constants.baseHttpApiUrl = "https://dashscope.aliyuncs.com/api/v1"
Synchronous call
Asynchronous call
A synchronous call blocks until the video generation is complete and the result is returned.
Request example
java
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class Image2Video {
static {
// This is the URL for the Singapore region. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// If the environment variable is not configured, replace the following line with: apiKey="sk-xxx"
// API keys are region-specific. To obtain an API key, visit: https://www.alibabacloud.com/help/en/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void syncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
final String prompt = "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.";
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png")
.type("first_frame")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3")
.type("driving_audio")
.build());
}};
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-i2v-2026-04-25")
.prompt(prompt)
.media(media)
.watermark(true)
.duration(10)
.resolution("720P")
.build();
VideoSynthesisResult result = null;
try {
System.out.println("---Sync call, please wait...----");
result = videoSynthesis.call(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
}
public static void main(String[] args) {
syncCall();
}
}Response example
The video_url is valid for 24 hours. Download the video promptly.
json
{
"request_id": "78178b55-8399-9823-8173-xxxxxx",
"output": {
"task_id": "be457e1b-8a79-47ed-aeff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"orig_prompt": "An urban fantasy art scene featuring a dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He rapidly sings an English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. A single street lamp provides the light, creating a high-energy cinematic atmosphere with incredible detail. The audio consists entirely of his rap, with no other dialogue or background noise.",
"submit_time": "2026-04-13 10:57:36.795",
"scheduled_time": "2026-04-13 10:57:46.280",
"end_time": "2026-04-13 10:59:16.338"
},
"usage": {
"video_count": 1,
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"SR": 720
},
"status_code": 200,
"code": "",
"message": ""
}Request example
java
// Copyright (c) Alibaba, Inc. and its affiliates.
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesis;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisParam;
import com.alibaba.dashscope.aigc.videosynthesis.VideoSynthesisResult;
import com.alibaba.dashscope.exception.ApiException;
import com.alibaba.dashscope.exception.InputRequiredException;
import com.alibaba.dashscope.exception.NoApiKeyException;
import com.alibaba.dashscope.utils.Constants;
import com.alibaba.dashscope.utils.JsonUtils;
import java.util.ArrayList;
import java.util.List;
public class Image2Video {
static {
// This is the URL for the Singapore region. If you use a model in the Beijing region, replace the URL with: https://dashscope.aliyuncs.com/api/v1
Constants.baseHttpApiUrl = "https://{WorkspaceId}.ap-southeast-1.maas.aliyuncs.com/api/v1";
}
// If the environment variable is not configured, replace the following line with: apiKey = "sk-xxx"
// API keys are region-specific. To obtain an API key, see https://www.alibabacloud.com/help/en/model-studio/get-api-key
static String apiKey = System.getenv("DASHSCOPE_API_KEY");
public static void asyncCall() {
VideoSynthesis videoSynthesis = new VideoSynthesis();
final String prompt = "A scene of urban fantasy art. A dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He sings an English rap song at high speed while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. The light comes from a single street lamp, creating a cinematic atmosphere full of high energy and amazing detail. The audio of the video consists entirely of his rap, with no other dialogue or noise.";
List<VideoSynthesisParam.Media> media = new ArrayList<VideoSynthesisParam.Media>(){{
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/wpimhv/rap.png")
.type("first_frame")
.build());
add(VideoSynthesisParam.Media.builder()
.url("https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3")
.type("driving_audio")
.build());
}};
VideoSynthesisParam param =
VideoSynthesisParam.builder()
.apiKey(apiKey)
.model("wan2.7-i2v-2026-04-25")
.prompt(prompt)
.media(media)
.watermark(true)
.duration(10)
.resolution("720P")
.build();
VideoSynthesisResult result = null;
try {
System.out.println("--- Starting the asynchronous call. Please wait... ---");
result = videoSynthesis.asyncCall(param);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
} catch (InputRequiredException e) {
throw new RuntimeException(e);
}
System.out.println(JsonUtils.toJson(result));
String taskId = result.getOutput().getTaskId();
System.out.println("taskId=" + taskId);
try {
result = videoSynthesis.wait(taskId, apiKey);
} catch (ApiException | NoApiKeyException e){
throw new RuntimeException(e.getMessage());
}
System.out.println(JsonUtils.toJson(result));
System.out.println(JsonUtils.toJson(result.getOutput()));
}
public static void main(String[] args) {
asyncCall();
}
}Response example
- Response example for creating a task
json
{
"request_id": "5dbf9dc5-4f4c-9605-85ea-xxxxxxxx",
"output": {
"task_id": "7277e20e-aa01-4709-xxxxxxxx",
"task_status": "PENDING"
}
}- Response example for querying a task result
The video_url is valid for 24 hours. Download the video promptly.
json
{
"request_id": "78178b55-8399-9823-8173-xxxxxx",
"output": {
"task_id": "be457e1b-8a79-47ed-aeff-xxxxxx",
"task_status": "SUCCEEDED",
"video_url": "https://dashscope-a717.oss-accelerate.aliyuncs.com/xxx.mp4?Expires=xxx",
"orig_prompt": "An urban fantasy art scene featuring a dynamic graffiti art character. A boy made of spray paint comes to life on a concrete wall. He rapidly sings an English rap song while striking a classic, energetic rapper pose. The scene is set under an urban railway bridge at night. A single street lamp provides the light, creating a high-energy cinematic atmosphere with incredible detail. The audio consists entirely of his rap, with no other dialogue or background noise.",
"submit_time": "2026-04-13 10:57:36.795",
"scheduled_time": "2026-04-13 10:57:46.280",
"end_time": "2026-04-13 10:59:16.338"
},
"usage": {
"video_count": 1,
"duration": 10,
"input_video_duration": 0,
"output_video_duration": 10,
"SR": 720
},
"status_code": 200,
"code": "",
"message": ""
}Error codes
If a model call fails and returns an error message, see Error codes to resolve the issue.
FAQ
Q: How do I generate a video with a specific aspect ratio, such as 3:4?
A: The output aspect ratio is determined by the input material (first frame image or first video clip) but is not guaranteed to match exactly. A slight drift may occur.
The following example explains the logic using a first frame image as input:
- Why does drift occur?
Execution logic: The system uses the input image's aspect ratio as a baseline, combined with the target total pixels for the
resolutiontier. Because video encoding requires width and height to be multiples of 16, the system adjusts the output to the closest valid resolution.Calculation example: A 750 x 1000 pixel input image (3:4 ratio = 0.75) with "720P" resolution (~920,000 total pixels) produces an 816 x 1104 pixel output (ratio ~0.739, ~900,000 total pixels).
- Recommendations:
Input control: Use a first frame or video clip that matches your target aspect ratio.
Post-processing: For strict aspect ratio requirements, crop the video or add black bars after generation.
Q: How do I get the whitelist of domain names for video storage access?
A: Videos generated by models are stored in OSS. The API returns a temporary public URL. To configure a firewall whitelist for this download URL, note the following: The underlying storage may change dynamically. This topic does not provide a fixed OSS domain name whitelist to prevent access issues caused by outdated information. If you have security control requirements, contact your account manager to obtain the latest OSS domain name list.
Previous: HappyHorse - video editingNext: Wan2.7 - text-to-video
Is this page helpful?
Availability
HTTP
Step 1: Create a task and get the task ID
Step 2: Query the result by task ID
DashScope SDK
Python SDK
Java SDK
Error codes
FAQ
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