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: wan22_i2v_flash
input object required
Basic input object, such as prompts and source image
prompt
stringText prompt used to describe expected elements and visual characteristics in the generated video
Supports Chinese and English, each Chinese character or letter counts as one character, overflow is automatically truncated
For wan2.2 and wan2.1 series, maximum length is800characters
negative_prompt
stringNegative prompt used to describe content that should not appear in the generated video
Supports Chinese and English, maximum length is500characters, overflow is automatically truncated
img_url
stringrequiredURL or Base64 encoded data of the first-frame image
Image Constraints:
Formats: JPEG, JPG, PNG (no alpha channel), BMP, WEBP
Resolution: width and height range360to2000pixels
File size: up to10MBSupported Input Formats:
Public URL via HTTP or HTTPS
Base64 string in formatdata:{MIME_type};base64,{base64_data}
parameters object
Video processing parameters, such as resolution tier, duration, prompt rewrite, watermark, and seed
resolution
stringSpecifies output resolution tier and the model scales to similar total pixels, while keeping aspect ratio close to
img_urlOptions:
480P,720PDefault:
720P
duration
integerFor
wan2.2-i2v-flash, duration is fixed at5seconds and cannot be modifiedValue:
5
prompt_extend
booleanWhether to enable intelligent prompt rewriting, when enabled a large model rewrites input prompt, usually improving short prompts while increasing latency
Options:
true,falseDefault:
true
watermark
booleanWhether to add watermark in the lower-right corner
Options:
false,trueDefault:
false
seed
integerRandom seed in range
0to2147483647, system generates a random seed when omitted
Fixingseedcan improve reproducibility, but identical seed does not guarantee exactly identical output every runRange:
0-2147483647
Polling
Since result generation takes time, you need to poll the task status after creating the task.
The initial response only returns information such as the task ID and initial status. The final result must be obtained by polling the task status endpoint using the task ID.
See the examples on the right for polling requests and responses.
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
content
arrayList of generated resource content
type
stringResource type
Value:
image|videourl
stringProcessed resource URL
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