HappyHorse Videos
Call HappyHorse through the unified video API for text-to-video, image-to-video, reference-to-video and video editing.
/v1/video/generations
HappyHorse is called through the unified video API; tasks are submitted and queried the same way as for other video models. You do not pick a generation mode — the gateway chooses it from the inputs you send:
| Inputs | Mode |
|---|---|
prompt only |
Text-to-video |
One image (image, or images with a single entry) |
Image-to-video, the image is the first frame |
2–9 images (images) |
Reference-to-video |
A video (input_reference), plus 0–9 reference images |
Video editing |
Authentication
Send your key in the Authorization: Bearer sk-xxxx header.
Request body
Content type: application/json.
| Parameter | Type | Required | Description |
|---|---|---|---|
model |
string | Yes | Model ID, for example happyhorse-1.0. |
prompt |
string | Yes | Text description of the video. |
image |
string | No | First-frame image URL. |
images |
string[] | No | Image URLs, up to 9. A single image is used as the first frame; several are used as reference images. |
input_reference |
string | No | URL of the video to edit. When present the task is a video edit and images are reference images. |
duration |
integer | No | Video length in seconds, 3–15, default 5. Not used for video editing — the output matches the source length. |
size |
string | No | Resolution: 720P or 1080P, default 1080P. 720p, 1280x720 and similar forms are also accepted. |
ratio |
string | No | Aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4. aspect_ratio is also accepted. |
metadata |
object | No | Extra parameters passed to the provider, such as seed (integer) and watermark (boolean, default false — no watermark). |
The content array format shown on the model details page also works: text is the prompt, image_url is an image ("role": "first_frame" marks the first frame), video_url is the video to edit, and resolution replaces size.
Image and video URLs must be publicly reachable over HTTPS; URLs that need a login or have expired signatures do not work. A duration, resolution or aspect ratio outside the ranges above is rejected with 400 and is not charged.
Request examples
curl https://rutoken.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "happyhorse-1.0",
"prompt": "An orange cat runs across a sunny meadow, tracking shot",
"duration": 5,
"size": "720P",
"ratio": "16:9"
}'
curl https://rutoken.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "happyhorse-1.0",
"prompt": "The person from reference 1 picks up the fan from reference 2, slow push-in",
"images": [
"https://example.com/person.png",
"https://example.com/fan.png"
],
"duration": 5,
"size": "1080P",
"ratio": "9:16"
}'
curl https://rutoken.ai/v1/video/generations \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $API_KEY" \
-d '{
"model": "happyhorse-1.0",
"prompt": "Restyle the video as a watercolor painting, keep the motion",
"input_reference": "https://example.com/input.mp4",
"images": ["https://example.com/style.png"],
"size": "720P"
}'
The response is a task object; query the task with its id. See the unified video API for the response format, task statuses and polling.
Billing
HappyHorse is billed per second of video, with different prices for 720P and 1080P; see the model marketplace for prices.
- Text-, image- and reference-to-video: billed by
duration. - Video editing: the provider bills input video length + output video length, and the output is as long as the source, so a 5-second edit is billed as about 10 seconds. Submission pre-charges twice the source length (30 seconds if the source length cannot be read), and the task is settled on the actual seconds reported by the provider when it finishes.
If a task fails, the charged quota is refunded automatically. Provider video URLs expire, so download the video soon after the task succeeds.
See also: Unified video API, Errors.