HappyHorse 1.0 Video Edit API

Edit 720p or 1080p video with natural-language instructions and up to five reference images. Use video-edit and provide input.video_url.

POST /v1/videos/generations

Video editing: Rewrite the existing video based on prompt, up to 5 reference images can be added.

Request parameters

ParameterTypeRequiredDescription
modelstringYesThe model name to be called, fill in the name from the model gallery.
durationintegerYesVideo duration (seconds). ⚠️ Must be placed at the **top level**, and must match the actual value in input/parameters — values placed inside nested structures will not be read.
resolutionstringYesResolution, take 480p / 720p / 1080p. ⚠️ Must also be placed at the **top level**, and must match parameters.size.
inputobjectYesGeneration inputs in the model’s native format. See the input.* fields below for the required inputs for each use case.
parametersobjectNoPass the generation parameters in their native format. Common pixel sizes for size: 480p → 832 × 480; 720p → 1280 × 720; 1080p → 1920 × 1080.
aspect_ratiostringNoAspect ratio, e.g. 16:9 / 9:16
waitbooleanNotrue = block until result (up to 60 seconds), false/omitted = immediately return task_id and then poll yourself (recommended).
callback_urlstringNoCallback URL after task completion.
idempotency_keystringNoIdempotency key, repeated submissions with the same key return the same task and do not incur additional charges.
input.promptstringYesPrompt, describing the scene to be generated.
input.video_urlstringYesURL of the original video to be edited.
input.ref_imgsarrayNoOptional array of reference image URLs, up to 5 images.
input.functionstringNoinput.function can be omitted — when omitted, automatically inferred from model name; when provided, uses the provided value.
parameters.sizestringNoPixel dimensions, e.g. 1280*720. Must be consistent with the top-level resolution.

Request example

curl https://api.router.ai/v1/videos/generations \
  -H "Authorization: Bearer sk-你的令牌" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0-video-edit",
    "duration": 5,
    "resolution": "720p",
    "input": {
      "prompt": "把天空换成黄昏,整体偏暖调",
      "video_url": "https://example.com/src.mp4"
    },
    "parameters": {"size": "1280*720"}
  }'

Endpoint reference: Aliyun Wan video generation