Reference-to-Video: create a video task with up to 9 reference images to preserve the subject
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": "happyhorse-1.0-r2v",
"input": {
"prompt": "Following the reference image, a girl walking slowly through a garden bathed in sunset light, cinematic lighting",
"media": [
{
"type": "reference_image",
"url": "https://your-cdn.com/girl.png"
}
]
}
}
'{
"output": {
"task_id": "hh-...",
"task_status": "PENDING"
},
"request_id": "..."
}HappyHorse1.0 Video Generation (Alibaba)
HappyHorse Reference-to-Video API Reference
HappyHorse-1.0-r2v Reference-to-Video API reference and online debugging: up to 9 reference images to keep the subject and scene consistent, DashScope async passthrough endpoint.
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Reference-to-Video: create a video task with up to 9 reference images to preserve the subject
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": "happyhorse-1.0-r2v",
"input": {
"prompt": "Following the reference image, a girl walking slowly through a garden bathed in sunset light, cinematic lighting",
"media": [
{
"type": "reference_image",
"url": "https://your-cdn.com/girl.png"
}
]
}
}
'{
"output": {
"task_id": "hh-...",
"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.
You can debug directly in the Playground on the right: fill in Authorization with
Bearer sk-your-api-key, set model / input.media / parameters, then send the request. A successful submission returns a task_id; see below for polling and downloading.This page covers the create endpoint for
happyhorse-1.0-r2v (Reference-to-Video): provide reference images, and the model preserves the subjects and scene features in them. HappyHorse-r2v supports up to 9 reference images, giving stronger subject consistency in multi-reference scenarios. For the complete async flow, see the HappyHorse Overview.happyhorse-1.0-r2vsupports up to 9reference_imageentries (more than Wan2.7-r2v’s combined ≤5).input.mediais required, and the mediaurlmust be a public https link that can be fetched directly via GET.- The create request goes 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": "happyhorse-1.0-r2v",
"input": {
"prompt": "Following the reference image, a girl walking slowly through a garden bathed in sunset light, cinematic lighting",
"media": [
{"type": "reference_image", "url": "https://your-cdn.com/girl.png"}
]
},
"parameters": {"resolution": "720P", "duration": 5, "prompt_extend": true, "watermark": true}
}'
Parameter and Media Quick Reference
| Parameter | Type | Required | Default | Notes |
|---|---|---|---|---|
model | string | ✓ | — | Fixed to happyhorse-1.0-r2v |
input.prompt | string | ✓ | — | Text prompt |
input.media | array | ✓ | — | See the media table below |
parameters.resolution | string | 720P | 720P / 1080P | |
parameters.duration | int | 5 | Integer of 2–15 seconds | |
parameters.prompt_extend | bool | true | Smart rewriting, recommended on | |
parameters.watermark | bool | false | ”AI Generated” watermark |
media[] Values
type | Required | Count | Notes |
|---|---|---|---|
reference_image | ✓ | 1–9 | Reference image; preserves subject (person/animal/object) and scene features |
Response Format
{
"output": { "task_id": "...", "task_status": "PENDING" },
"request_id": "..."
}
After submission, poll
GET /v1/tasks/{task_id} until completed, then download the mp4 from result_url (without the Authorization header, expires in 24 hours). See the full polling loop in HappyHorse 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