Skip to main content
POST

Authorizations

Authorization
string
header
required

All APIs require Bearer Token authentication

Get your API Key:

Visit the API Key management page to obtain your API Key

Add to request headers:

Body

application/json
model
enum<string>
required

Model name, must be wan2.7-image-to-video

Available options:
wan2.7-image-to-video
Example:

"wan2.7-image-to-video"

generation_mode
enum<string>

Generation mode that determines which material combinations are valid. Explicitly specifying it is recommended

Values:

  • first_frame: First-frame to video. Required: image_start. Optional: audio_urls. Not accepted: image_end, video_urls
  • first_last_frame: First-and-last-frame to video. Required: image_start + image_end. Optional: audio_urls. Not accepted: video_urls
  • video_continuation: Video continuation. Required: video_urls[0]. Optional: image_end (used as ending frame). Not accepted: image_start, audio_urls

Backward-compatible behavior: when generation_mode is omitted, an appropriate mode will be selected automatically based on the materials in the request; explicit specification is recommended to avoid ambiguity

Available options:
first_frame,
first_last_frame,
video_continuation
Example:

"first_frame"

prompt
string

Text prompt for video generation. Supports both Chinese and English; each character/letter counts as 1, with overflow auto-truncated. Maximum length: 5000 characters

Maximum string length: 5000
Example:

"A cat playing piano"

negative_prompt
string

Negative prompt describing what should not appear in the video. Supports both Chinese and English. Maximum length 500 characters; overflow is auto-truncated

Maximum string length: 500
Example:

"Blurry, low quality"

image_start
string<uri>

First-frame image URL

Mode constraints:

  • first_frame mode: required
  • first_last_frame mode: required
  • video_continuation mode: not allowed

Image limits:

  • Formats: JPEG, JPG, PNG (transparency not supported), BMP, WEBP
  • Resolution: width and height in [240, 8000] pixels
  • Aspect ratio: 1:8 ~ 8:1
  • File size: up to 20MB
Example:

"https://example.com/first_frame.jpg"

image_end
string<uri>

Ending-frame image URL

Mode constraints:

  • first_last_frame mode: required
  • video_continuation mode: optional (acts as the ending frame for the continuation)
  • first_frame mode: not allowed (use first_last_frame if both first and last frames are needed)

Image limits:

  • Formats: JPEG, JPG, PNG (transparency not supported), BMP, WEBP
  • Resolution: width and height in [240, 8000] pixels
  • Aspect ratio: 1:8 ~ 8:1
  • File size: up to 20MB
Example:

"https://example.com/last_frame.jpg"

video_urls
string<uri>[]

Video continuation URL array. Only 1 element is supported

Mode constraints:

  • video_continuation mode: required
  • first_frame / first_last_frame mode: not allowed
  • Cannot be combined with audio_urls

Video limits:

  • Formats: mp4, mov
  • Duration: 2 ~ 10 seconds (length of the input clip itself)
  • Resolution: width and height in [240, 4096] pixels
  • Aspect ratio: 1:8 ~ 8:1
  • File size: up to 100MB

Continuation duration rules:

  • duration represents the total final output video length (input clip + model-generated continuation)
  • Generated continuation length = duration − input video length
  • duration must be ≥ input video length
  • Billing is based on the total final output length (i.e. duration)

Examples:

Example:
audio_urls
string<uri>[]

Driving audio URL array. Currently supports only 1 element. The model will use this audio as the driving source for video generation (e.g. lip sync, motion alignment)

Mode constraints:

  • first_frame mode: optional
  • first_last_frame mode: optional
  • video_continuation mode: not allowed (cannot be combined with video_urls)

Format requirements:

  • Supported formats: wav, mp3
  • Duration range: 2 ~ 30 seconds
  • File size: up to 15MB

Truncation handling:

  • If audio length exceeds duration, the first N seconds are extracted and the rest discarded
  • If audio length is shorter than the video duration, the remaining portion is silent. For example: if audio is 3s and video duration is 5s, the first 3s have sound and the last 2s are silent
Required array length: 1 element
Example:
quality
enum<string>
default:720p

Video quality, defaults to 720p

Options:

  • 720p: Standard definition, standard price, this is the default
  • 1080p: High definition, higher price
Available options:
720p,
1080p
Example:

"720p"

duration
number
default:5

Video duration in seconds (integer). Range 2 ~ 15, default 5

Meaning:

  • first_frame / first_last_frame modes: total length of the generated video
  • video_continuation mode: total length of the final output video (= original input clip + model-generated continuation)

Additional constraints in video_continuation mode:

  • duration must be ≥ input video length (otherwise an error is returned)
  • Generated continuation length = duration − input video length
  • When duration equals the input video length, no continuation is generated and the input clip is returned as-is
  • See the continuation duration rules and examples in the video_urls field for details

Billing: based on the actual generated video duration

Required range: 2 <= x <= 15
Example:

5

seed
integer

Random seed, defaults to random

Notes:

  • Range: 1 ~ 2147483647
  • Fixing the seed reduces variation when iterating on prompts and improves reproducibility
Required range: 1 <= x <= 2147483647
Example:

42

prompt_extend
boolean
default:false

Whether to enable intelligent prompt rewriting. When enabled, a large model will optimize the prompt, which significantly improves results for simple or insufficiently descriptive prompts.

Note: Default is false. Omitting the field or sending false will not trigger rewriting; explicitly send true to enable.

Example:

false

callback_url
string<uri>

HTTPS callback URL for task completion

Callback Timing:

  • Triggered when task is completed, failed, or cancelled
  • Sent after billing confirmation

Security Restrictions:

  • Only HTTPS protocol is supported
  • Callbacks to internal IP addresses are prohibited (127.0.0.1, 10.x.x.x, 172.16-31.x.x, 192.168.x.x, etc.)
  • URL length must not exceed 2048 characters

Callback Mechanism:

  • Timeout: 10 seconds
  • Up to 3 retries after failure (retries at 1/2/4 seconds after failure)
  • Callback response format is consistent with the task query API response
  • 2xx status codes are considered successful, other status codes trigger retries
Example:

"https://your-domain.com/webhooks/video-task-completed"

Response

Video task created successfully

created
integer

Task creation timestamp

Example:

1757169743

id
string

Task ID

Example:

"task-unified-1757169743-7cvnl5zw"

model
string

Actual model name used

Example:

"wan2.7-image-to-video"

object
enum<string>

Specific task type

Available options:
video.generation.task
progress
integer

Task progress percentage (0-100)

Required range: 0 <= x <= 100
Example:

0

status
enum<string>

Task status

Available options:
pending,
processing,
completed,
failed
Example:

"pending"

task_info
object

Detailed video task information

type
enum<string>

Task output type

Available options:
text,
image,
audio,
video
Example:

"video"

usage
object

Usage and billing information