Authentication
authorization string required
All APIs require authentication via Bearer Token.
Get API Key:
Visit API Key Management Page to get your API Key
Usage:
Add to request header:
Authorization: Bearer YOUR_API_KEY
Parameters
model string required
Model ID to use for the request
Value: wan26_i2v
input object required
Input parameters for the generation request
prompt
stringText prompt used to describe the expected elements and visual characteristics in the generated video. Supports Chinese and English. Each Chinese character/letter counts as one character, and excess content will be automatically truncated.
Maximum length:
1500characters for wan2.6-i2vNote: When using video effects parameters (i.e., template is not empty), the prompt parameter is invalid and does not need to be filled.
Example:
A kitten running on the grass
img_url
stringrequiredURL or Base64 encoded data of the first frame image.
Image Limitations:
Supported formats: JPEG, JPG, PNG (no transparency), BMP, WEBP
Image resolution: Width and height range[360, 2000]pixels
File size: Maximum10MBInput Methods:
Method 1: Publicly accessible URL
Supports HTTP or HTTPS protocol
Example:https://cdn.translate.alibaba.com/r/wanx-demo-1.pngMethod 2: Base64 encoded string
Format:data:{MIME_type};base64,{base64_data}
Example:data:image/png;base64,GDU7MtCZzEbTbmRZ...
audio_url
stringURL of the audio file. The model will use this audio to generate the video.
Supports HTTP or HTTPS protocol. Local files can obtain temporary URLs by uploading files.
Audio Limitations:
Supported formats: wav, mp3
Duration:3-30seconds
File size: Maximum15MBHandling Excess:
If audio length exceeds the duration value (5or10seconds), the first5or10seconds are automatically extracted, and the rest is discarded.
If audio length is less than video duration, the portion beyond audio length will be silent. For example, if audio is3seconds and video duration is5seconds, the output video has sound for the first3seconds and is silent for the last2seconds.Example:
https://help-static-aliyun-doc.aliyuncs.com/file-manage-files/zh-CN/20250925/ozwpvi/rap.mp3
parameters object
Generation parameters
resolution
stringImportant: The
resolutionparameter directly affects billing costs. For the same model: 1080P > 720P > 480P. Please confirm the model pricing before calling.Specifies the video resolution level to adjust video clarity (total pixels). The model automatically scales to similar total pixels based on the selected resolution level. The video aspect ratio will try to match the aspect ratio of the input image
img_url.Options:
720P,1080PDefault:
1080P
duration
integerImportant: The
durationparameter directly affects billing costs. Billing is per second - longer duration means higher cost. Please confirm the model pricing before calling.Duration of the generated video in seconds (integers only).
Options:
5,10,15Range:
2-15Default:
5
prompt_extend
booleanWhether to enable intelligent prompt rewriting.
When enabled, uses a large model to intelligently rewrite the input prompt. This significantly improves generation results for shorter prompts but adds processing time.
Options:
true,falseDefault:
true
watermark
booleanWhether to add a watermark identifier. The watermark is located in the lower right corner of the video with fixed text “AI Generated”.
Options:
true,falseDefault:
false
audio
booleanWhether to generate video with audio.
Parameter priority:
audio>audio_url. Whenaudio=false, even ifaudio_urlis provided, the output will still be a silent video, and billing will be calculated as silent video.Options:
true,falseDefault:
true
shot_type
stringSpecifies the shot type of the generated video, i.e., whether the video consists of one continuous shot or multiple switching shots.
Effective condition: Only takes effect when
prompt_extend: true.Parameter priority:
shot_type>prompt. For example, ifshot_typeis set tosingle, even if the prompt contains “generate multi-shot video”, the model will still output a single-shot video.Note: When strict control over video narrative structure is needed (e.g., single shot for product demonstrations, multi-shot for short stories), this parameter can be specified.
Options:
single,multiDefault:
single
negative_prompt
stringNegative prompt describing content you don’t want to appear in the video
seed
integerRandom seed. If not specified, the system automatically generates a random seed. To improve reproducibility of generation results, it is recommended to fix the seed value.
Note: Due to the probabilistic nature of model generation, even with the same seed, it cannot guarantee that generation results will be completely consistent every time.
Example:
12345Range:
0-2147483647
Polling
Since video generation takes time, you need to poll the task status after creation.
The initial response returns the task ID and initial status. The actual generation results must be obtained through polling the task status endpoint.
Response Format
error object
Error information. Only present when status is failed.
code
stringError code
message
stringDetailed error message
output array
Generation results. Only present when status is completed.
status
stringTask status
Options:
in_queue,processing,done,failed
content
arrayList of generated video content
type
stringResource type
Value:
videourl
stringProcessed video URL (CDN address)
jobId
stringRemote task ID
usage object
Usage statistics. Only present when status is completed.
cost
stringTotal cost in USD
discount
numberDiscount amount
metadata object
Metadata information.
Error Codes
| Error Code | Description |
|---|---|
| 001027095 | Internal generation error |
| 001027096 | Result parsing error |
| 001027097 | HTTP error response |
| 001027098 | Status check error |
| 001027099 | Task creation error |