HappyHorse 1.0
HappyHorse 1.0 is Alibaba's cinematic video generation model, exposing two modes: text-to-video and image-to-video.
Models
| Model Name | Mode |
|---|---|
happyhorse-1.0-text-to-video | Text-to-video |
happyhorse-1.0-image-to-video | Image-to-video |
Pricing
Billed per second × resolution:
| Resolution | Credits/sec |
|---|---|
720p | 34 |
1080p | 67 |
Credits are pre-charged as
duration × ratewhen the task is created. Failed tasks are automatically refunded.
Create Task
POST https://api.aivideoapi.ai/v1/videos/generations
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
model | string | Yes | happyhorse-1.0-text-to-video or happyhorse-1.0-image-to-video |
input | object | Yes | Generation parameters, see below |
callback_url | string | No | URL to receive task completion/failure notifications |
Text-to-Video Input
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text prompt, max 2500 characters |
aspect_ratio | string | No | 16:9, 9:16, 1:1, 4:3, or 3:4 |
resolution | string | No | 720p or 1080p (default 720p) |
duration | integer | No | 3-15 seconds (default 5) |
seed | integer | No | Integer between 0 and 2147483647 |
Image-to-Video Input
| Field | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Text prompt, max 2500 characters |
image_urls | string[] | Yes | Exactly 1 image URL, used as the first frame |
resolution | string | No | 720p or 1080p (default 720p) |
duration | integer | No | 3-15 seconds (default 5) |
seed | integer | No | Integer between 0 and 2147483647 |
Image-to-video accepts a single HTTP(S) image URL only. Recommended formats: JPEG / PNG / BMP / WEBP. The source image should be at least 300px on the short side, under 10 MB, and roughly within a
1:2.5to2.5:1aspect ratio.
Example: Text-to-Video
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.0-text-to-video",
"input": {
"prompt": "A cinematic tracking shot through a rainy neon street at night",
"aspect_ratio": "16:9",
"resolution": "720p",
"duration": 5
}
}'
Example: Image-to-Video
curl -X POST https://api.aivideoapi.ai/v1/videos/generations \
-H "Authorization: Bearer sk-your-api-key" \
-H "Content-Type: application/json" \
-d '{
"model": "happyhorse-1.0-image-to-video",
"input": {
"prompt": "The girl slowly turns her head and the camera gently pushes in",
"image_urls": ["https://example.com/portrait.png"],
"resolution": "1080p",
"duration": 5,
"seed": 12345
}
}'
Response
{
"code": 200,
"msg": "success",
"data": {
"taskId": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24"
}
}
Query Task
curl https://api.aivideoapi.ai/v1/tasks/{taskId} \
-H "Authorization: Bearer sk-your-api-key"
Status transitions: pending -> processing -> completed or failed.
Processing
{
"id": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24",
"status": "processing",
"model": "happyhorse-1.0-text-to-video",
"created_at": 1775400000,
"progress": null
}
Completed
{
"id": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24",
"status": "completed",
"model": "happyhorse-1.0-text-to-video",
"created_at": 1775400000,
"completed_at": 1775400123,
"output": {
"urls": [
"https://file.aivideoapi.ai/videos/2026/04/29/happyhorse-example.mp4"
],
"metadata": {
"model": "alibaba/happyhorse-1.0/text-to-video",
"has_nsfw_contents": false
}
}
}
Failed
{
"id": "8b6a5162-5c91-4a42-8e80-4c8ef5486f24",
"status": "failed",
"model": "happyhorse-1.0-text-to-video",
"created_at": 1775400000,
"error": {
"code": "upstream_error",
"message": "Video generation failed"
}
}
When a task fails, pre-charged credits are automatically refunded.
Error Codes
When a request fails, the API returns a JSON error response:
{
"error": {
"code": "insufficient_credits",
"message": "Your credit balance is too low. Please top up.",
"type": "billing_error"
}
}
Error Reference
| HTTP Status | Code | Type | Description |
|---|---|---|---|
| 400 | invalid_request | invalid_request_error | Missing or invalid parameters |
| 401 | invalid_api_key | authentication_error | API key is invalid, disabled, or deleted |
| 402 | insufficient_credits | billing_error | Credit balance too low, please top up |
| 403 | ip_not_allowed | permission_error | Request IP not in the key's allowlist |
| 404 | model_not_found | invalid_request_error | Model does not exist or is inactive |
| 404 | task_not_found | invalid_request_error | Task ID does not exist |
| 429 | rate_limit_exceeded | rate_limit_error | Too many requests, please slow down |
| 429 | spend_limit_exceeded | billing_error | Key spend limit reached (hourly/daily/total) |
| 500 | internal_error | api_error | Unexpected server error |
| 503 | upstream_error | upstream_error | Upstream AI provider returned an error |
Common Scenarios
invalid_request (400)
Returned when required fields are missing or invalid.
{
"error": {
"code": "invalid_request",
"message": "'model' is required.",
"type": "invalid_request_error"
}
}
insufficient_credits (402)
Your balance is too low. Check your balance with GET /v1/credits and top up in Dashboard > Billing.
invalid_api_key (401)
Possible causes:
- The key does not start with
sk- - The key has been disabled or deleted
- The user account has been banned
upstream_error (503)
The upstream AI provider returned an error. This may happen when:
- The input contains sensitive or prohibited content
- The provider is temporarily unavailable
- The request parameters are not supported by the provider
Credits are automatically refunded when a task fails due to upstream errors.