Skip to main content
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Reference-to-video: create a video task that preserves subject features from reference images/videos
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-r2v",
  "input": {
    "prompt": "A girl wearing this gown walks slowly through a garden bathed in sunset, the breeze gently lifting her skirt, cinematic lighting",
    "media": [
      {
        "type": "reference_image",
        "url": "https://your-cdn.com/dress.png"
      }
    ]
  }
}
'
{
  "output": {
    "task_id": "acda59b4-3b10-4789-a5e5-edadae48adcb",
    "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-r2v (reference-to-video): give reference images/videos and the model preserves their subjects (people/animals/objects) and scene features, generating single-character performances or multi-character interactions. If you need more reference images (up to 9), consider HappyHorse r2v. For the full async flow, see the Wan Overview.
  • Reference-asset citation convention: in the prompt, use “image 1 / image 2” to refer to reference_image and “video 1 / video 2” to refer to reference_video, in the same order as the media array (images and videos counted separately). With a single image/video, you can simply write “the reference image” / “the reference video”.
  • Count limits: reference_image + reference_video total ≤5; at most 1 first_frame.
  • Creation requests go to /wan/api/v1/... with X-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-r2v",
    "input": {
      "prompt": "A girl wearing this gown walks slowly through a garden bathed in sunset, the breeze gently lifting her skirt, cinematic lighting",
      "media": [
        {"type": "reference_image", "url": "https://your-cdn.com/dress.png"}
      ]
    },
    "parameters": {"resolution": "720P", "duration": 5, "prompt_extend": true, "watermark": true}
  }'

Parameter and media quick reference

ParameterTypeRequiredDefaultNotes
modelstringFixed wan2.7-r2v
input.promptstring≤5000 characters; use “image 1/video 1” to reference assets
input.mediaarraySee the media table below
parameters.resolutionstring1080P720P / 1080P
parameters.ratiostring16:916:9 / 9:16 / 1:1 / 4:3 / 3:4 (ignored when a first frame is passed)
parameters.durationint52-10 with a reference video; 2-15 without
parameters.prompt_extendbooltrueSmart rewriting
parameters.watermarkboolfalse”AI generated” watermark

media[] values

typeCount / limitNotes
reference_image≤5 combined with videoReference image, provides a subject (person/animal/object) or scene; can attach reference_voice to set the voice
reference_video≤5 combined with imageReference video, provides subject and voice reference; do not pass empty-scene footage
first_frame≤1Optional first frame, jointly controls the starting frame
reference_voiceattached fieldAttached to a reference_image/reference_video to set that subject’s voice (wav/mp3, 1-10s)

Response format

{
  "output": { "task_id": "acda59b4-3b10-4789-a5e5-edadae48adcb", "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). Reference-to-video usually takes 1-5 minutes; a 10-second polling interval and a 20-minute client timeout are recommended. For the full loop, see Wan Overview · Async call flow.

Authorizations

Authorization
string
header
required

The API Key obtained from the APIYI console

Headers

X-DashScope-Async
enum<string>
default:enable
required

Async processing switch; must be set to enable

Available options:
enable

Body

application/json
model
enum<string>
default:wan2.7-r2v
required

Model ID; for reference-to-video use wan2.7-r2v (legacy versions wan2.6-r2v / wan2.6-r2v-flash)

Available options:
wan2.7-r2v,
wan2.6-r2v,
wan2.6-r2v-flash
input
object
required
parameters
object

Response

Task submitted; returns task_id and PENDING status

output
object
request_id
string

Unique request identifier

Example:

"..."