Image-to-video: create a video generation task from a first frame (+ optional driving audio)
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-i2v",
"input": {
"prompt": "A spray-painted boy comes to life off the wall and performs an English rap, at night under a railway bridge, cinematic lighting",
"media": [
{
"type": "first_frame",
"url": "https://your-cdn.com/rap.png"
},
{
"type": "driving_audio",
"url": "https://your-cdn.com/rap.mp3"
}
]
}
}
'{
"output": {
"task_id": "f8ca39a0-6f4b-4ec2-99bf-8b9649d946c4",
"task_status": "PENDING"
},
"request_id": "..."
}Wan2.7 Video Generation (Alibaba)
Wan2.7 Image-to-Video API Reference
Wan2.7-i2v image-to-video API reference and live playground: generate video from a first frame, with driving_audio support for lip-sync / rap.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Image-to-video: create a video generation task from a first frame (+ optional driving audio)
curl --request POST \
--url https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'X-DashScope-Async: <x-dashscope-async>' \
--data '
{
"model": "wan2.7-i2v",
"input": {
"prompt": "A spray-painted boy comes to life off the wall and performs an English rap, at night under a railway bridge, cinematic lighting",
"media": [
{
"type": "first_frame",
"url": "https://your-cdn.com/rap.png"
},
{
"type": "driving_audio",
"url": "https://your-cdn.com/rap.mp3"
}
]
}
}
'{
"output": {
"task_id": "f8ca39a0-6f4b-4ec2-99bf-8b9649d946c4",
"task_status": "PENDING"
},
"request_id": "..."
}Documentation Index
Fetch the complete documentation index at: https://docs.apiyi.com/llms.txt
Use this file to discover all available pages before exploring further.
The Playground on the right lets you debug directly: put
Bearer sk-your-api-key in Authorization, fill in model / input.media / parameters, and send the request. A successful submission returns a task_id; see below for polling and download.This page is the creation endpoint for
wan2.7-i2v (image-to-video): give a first frame + prompt to bring the image to life, and optionally pass driving_audio to make the portrait follow the audio’s mouth movements and rhythm. For the full async flow, see the Wan Overview.- Audio drive is exclusive to
wan2.7-i2v: HappyHorse i2v does not supportdriving_audio, so lip-sync / rap must usewan2.7-i2v. input.mediais required, otherwise the upstream returnsimage-to-video model ... must provide an image. Each mediaurlmust be a public https link that can be fetched directly with GET.- Creation requests go to
/wan/api/v1/...withX-DashScope-Async: enable; do not use/v1/videos.
Code examples
curl -X POST "https://api.apiyi.com/wan/api/v1/services/aigc/video-generation/video-synthesis" \
-H "X-DashScope-Async: enable" \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "wan2.7-i2v",
"input": {
"prompt": "A spray-painted boy comes to life off the wall and performs an English rap, at night under a railway bridge, cinematic lighting",
"media": [
{"type": "first_frame", "url": "https://your-cdn.com/rap.png"},
{"type": "driving_audio", "url": "https://your-cdn.com/rap.mp3"}
]
},
"parameters": {"resolution": "720P", "duration": 10, "prompt_extend": true, "watermark": true}
}'
Parameter and media quick reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed wan2.7-i2v |
input.prompt | string | ✓ | — | Text prompt |
input.media | array | ✓ | — | See the media table below |
parameters.resolution | string | 720P | 720P / 1080P | |
parameters.duration | int | 5 | 2-15 second integer | |
parameters.prompt_extend | bool | true | Smart rewriting, recommended on | |
parameters.watermark | bool | false | ”AI generated” watermark |
media[] values
type | Required | Count | Notes |
|---|---|---|---|
first_frame | ✓ | 1 | First frame; the video starts from this image |
driving_audio | 1 | Driving audio (wav/mp3); makes the portrait follow the audio’s mouth movements and rhythm |
Response format
{
"output": { "task_id": "f8ca39a0-6f4b-4ec2-99bf-8b9649d946c4", "task_status": "PENDING" },
"request_id": "..."
}
After submitting, poll
GET /v1/tasks/{task_id} until completed, then download the mp4 from result_url (no Authorization header, expires in 24 hours). For the full polling loop, see Wan Overview · Async call flow.Authorizations
The API Key obtained from the APIYI console
Headers
Async processing switch; must be set to enable
Available options:
enable Body
application/json
Was this page helpful?
⌘I