Skip to main content
POST
/
wan
/
api
/
v1
/
services
/
aigc
/
video-generation
/
video-synthesis
Video Edit: create an edit task from video + reference images + instruction
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-video-edit",
  "input": {
    "prompt": "Replace the clothes of the girl in the video with the clothes in the image",
    "media": [
      {
        "type": "video",
        "url": "https://your-cdn.com/source.mp4"
      },
      {
        "type": "reference_image",
        "url": "https://your-cdn.com/new-clothes.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-video-edit (Video Edit): provide a video + up to 5 reference images + natural-language instructions to make local/global edits to video elements. Note that the model name has a hyphen (video-edit). For the complete async flow, see the HappyHorse Overview.
  • input.media must include both a video (the video being edited) and at least 1 reference_image (≤5).
  • The model name is happyhorse-1.0-video-edit (has a hyphen), different from Wan’s wan2.7-videoedit (no hyphen) — don’t get it wrong.
  • The create request goes 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": "happyhorse-1.0-video-edit",
    "input": {
      "prompt": "Replace the clothes of the girl in the video with the clothes in the image",
      "media": [
        {"type": "video",           "url": "https://your-cdn.com/source.mp4"},
        {"type": "reference_image", "url": "https://your-cdn.com/new-clothes.png"}
      ]
    },
    "parameters": {"resolution": "720P", "prompt_extend": true, "watermark": true}
  }'

Parameter and Media Quick Reference

ParameterTypeRequiredDefaultNotes
modelstringFixed to happyhorse-1.0-video-edit
input.promptstringNatural-language editing instruction
input.mediaarraySee the media table below
parameters.resolutionstring720P720P / 1080P
parameters.prompt_extendbooltrueSmart rewriting
parameters.watermarkboolfalse”AI Generated” watermark

media[] Values

typeRequiredCountNotes
video1The source video being edited
reference_image1–5Reference material (new clothing, new background, etc.)
The output duration of video editing follows the input video and is not determined by duration, so this capability typically does not pass duration.

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

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:happyhorse-1.0-video-edit
required

Model ID, fixed to happyhorse-1.0-video-edit (has a hyphen)

Available options:
happyhorse-1.0-video-edit
input
object
required
parameters
object

Response

Task submitted, returns task_id and PENDING status

output
object
request_id
string

Unique request identifier

Example:

"..."