Edit 720p or 1080p video with natural-language instructions and up to five reference images. Use video-edit and provide input.video_url.
happyhorse-1.0-video-editVideo editing: Rewrite the existing video based on prompt, up to 5 reference images can be added.
| Parameter | Type | Required | Description |
|---|---|---|---|
model | string | Yes | The model name to be called, fill in the name from the model gallery. |
duration | integer | Yes | Video 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. |
resolution | string | Yes | Resolution, take 480p / 720p / 1080p. ⚠️ Must also be placed at the **top level**, and must match parameters.size. |
input | object | Yes | Generation inputs in the model’s native format. See the input.* fields below for the required inputs for each use case. |
parameters | object | No | Pass the generation parameters in their native format. Common pixel sizes for size: 480p → 832 × 480; 720p → 1280 × 720; 1080p → 1920 × 1080. |
aspect_ratio | string | No | Aspect ratio, e.g. 16:9 / 9:16 |
wait | boolean | No | true = block until result (up to 60 seconds), false/omitted = immediately return task_id and then poll yourself (recommended). |
callback_url | string | No | Callback URL after task completion. |
idempotency_key | string | No | Idempotency key, repeated submissions with the same key return the same task and do not incur additional charges. |
input.prompt | string | Yes | Prompt, describing the scene to be generated. |
input.video_url | string | Yes | URL of the original video to be edited. |
input.ref_imgs | array | No | Optional array of reference image URLs, up to 5 images. |
input.function | string | No | input.function can be omitted — when omitted, automatically inferred from model name; when provided, uses the provided value. |
parameters.size | string | No | Pixel dimensions, e.g. 1280*720. Must be consistent with the top-level resolution. |
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"}
}'