happyhorse-1-1
Alibaba HappyHorse 1.1 — one async video endpoint that auto-routes text-to-video, image-to-video, and reference-to-video (up to 9 images) by request shape.
Alibaba HappyHorse 1.1 — a single async video endpoint that auto-routes between T2V / I2V / R2V based on which media field your request carries. 720p or 1080p, 3–15 second outputs, billed only by resolution × duration regardless of mode. See current pricing on the model page.
Generation is asynchronous: the POST returns a task id, then poll
GET /api/v1/tasks/{id} until status is completed.
Quick example
curl https://reapi.ai/api/v1/videos/generations \
-H "Authorization: Bearer rk_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1-1",
"prompt": "A coastal road at sunset, slow-motion camera push-in, cinematic feel",
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5
}'import requests
resp = requests.post(
"https://reapi.ai/api/v1/videos/generations",
headers={
"Authorization": "Bearer rk_live_xxx",
"Content-Type": "application/json",
},
json={
"model": "happyhorse-1-1",
"prompt": "A coastal road at sunset, slow-motion camera push-in",
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
},
timeout=30,
)
print(resp.json())const r = await fetch("https://reapi.ai/api/v1/videos/generations", {
method: "POST",
headers: {
Authorization: "Bearer rk_live_xxx",
"Content-Type": "application/json",
},
body: JSON.stringify({
model: "happyhorse-1-1",
prompt: "A coastal road at sunset, slow-motion camera push-in",
resolution: "1080p",
aspect_ratio: "16:9",
duration: 5,
}),
});
console.log(await r.json());package main
import (
"bytes"
"encoding/json"
"fmt"
"net/http"
)
func main() {
body, _ := json.Marshal(map[string]any{
"model": "happyhorse-1-1",
"prompt": "A coastal road at sunset, slow-motion camera push-in",
"resolution": "1080p",
"aspect_ratio": "16:9",
"duration": 5,
})
req, _ := http.NewRequest("POST",
"https://reapi.ai/api/v1/videos/generations", bytes.NewReader(body))
req.Header.Set("Authorization", "Bearer rk_live_xxx")
req.Header.Set("Content-Type", "application/json")
resp, _ := http.DefaultClient.Do(req)
defer resp.Body.Close()
var out map[string]any
json.NewDecoder(resp.Body).Decode(&out)
fmt.Println(out)
}Endpoint
POST /api/v1/videos/generations
Authorization: Bearer rk_live_xxx
Content-Type: application/jsonSubmitting returns a task id; poll GET /api/v1/tasks/{id}
for the result. Polling does not consume credits.
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
model | string | yes | — | happyhorse-1-1 |
prompt | string | T2V / R2V: yes · I2V: no | — | Any language. ≤5000 non-CJK / ≤2500 CJK characters (over-length is auto-truncated upstream). In R2V, reference images with [Image 1], [Image 2], … |
image_urls | string[] | I2V | — | First-frame image, exactly 1 public URL. Presence selects image-to-video. JPEG/PNG/WEBP, short side ≥300px, ratio 1:2.5–2.5:1, ≤20MB. |
reference_image_urls | string[] | R2V | — | 1–9 reference image URLs. Presence selects reference-to-video. JPEG/PNG/WEBP, short side ≥400px, ≤20MB. |
resolution | enum | no | 720p | 720p · 1080p |
aspect_ratio | enum | no | 16:9 | 16:9 9:16 3:4 4:3 4:5 5:4 1:1 9:21 21:9. T2V / R2V only — in I2V the orientation is derived from the source image. |
duration | integer | no | 5 | Output length in seconds, 3–15. |
image_urls (I2V) and reference_image_urls (R2V) are mutually exclusive.
All media inputs must be public HTTP(S) URLs — base64 / data: URIs are rejected.
Modes
Mode is implicit — selected by which inputs you send:
| Mode | Trigger | prompt | aspect_ratio |
|---|---|---|---|
| Text-to-video (T2V) | no media | required | yes |
| Image-to-video (I2V) | image_urls (1) | optional | no (from image) |
| Reference-to-video (R2V) | reference_image_urls (1–9) | required | yes |
// I2V — animate a first frame
{ "model": "happyhorse-1-1", "image_urls": ["https://…/frame.jpg"], "resolution": "1080p", "duration": 5 }
// R2V — keep subjects consistent across the clip
{ "model": "happyhorse-1-1", "prompt": "the woman in [Image 1] walks through [Image 2]", "reference_image_urls": ["https://…/a.jpg", "https://…/b.jpg"], "resolution": "1080p", "duration": 5 }Pricing
Billed by per-second rate × resolution × duration; the routing mode does
not change the rate. Two tiers: 720p and 1080p. See the
model page for current rates.
Bill formula (1 credit = $0.001):
credits = ceil(per_second_usd × duration × 1000)Output
On success, GET /api/v1/tasks/{id} returns:
{
"id": "task_…",
"model": "happyhorse-1-1",
"status": "completed",
"output": { "video_urls": ["https://cdn.reapi.ai/media/tasks/…/0.mp4"] },
"error": null
}Errors
| HTTP | code | When |
|---|---|---|
| 400 | 20002 | Missing / invalid parameter (e.g. prompt required in T2V/R2V, both image fields set) |
| 401 | 10001 – 10005 | Auth missing / invalid / revoked |
| 402 | 30001 | Insufficient credits |
| 429 | 50001 | Per-user rate limit exceeded |
Failed generations are surfaced under error in the polling response and are
refunded automatically. Full catalog: Errors.
Tips
- Pick the mode by inputs, not a flag. Sending
reference_image_urlsswitches to R2V; sendingimage_urlsswitches to I2V; neither → T2V. - In R2V, name each subject explicitly and reference it by
[Image N]in the prompt, matching the array order, for the strongest identity retention. aspect_ratiois ignored in I2V — crop your source image to the orientation you want instead.- Longer
durationscales the bill linearly; start at 5s while iterating.
Related
- Tasks — universal polling endpoint
- Errors — full error catalog
- happyhorse-1-0 — the previous generation