Happy Horse 1.1 API
Complete API reference for Happy Horse 1.1 video generation models by Alibaba.
Model Variants
This API supports three model variants:
Quick Comparison
Supported Aspect Ratios (Text to Video & Reference to Video)
Happy Horse 1.1 Text to Video
Endpoint
POST /api/v1/video/task
Request Parameters
Required
Optional
Example Request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.1-text-to-video',
prompt: 'A cat playing with a ball of yarn on a sunny windowsill',
duration: 5,
resolution: '1080p',
aspect_ratio: '16:9',
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Happy Horse 1.1 Image to Video
Request Parameters
Required
Optional
Note: aspect_ratio is not supported for image-to-video. Output framing follows the uploaded first-frame image.
Example Request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.1-image-to-video',
image_url: 'https://example.com/first-frame.jpg',
prompt: 'Gentle motion; cinematic lighting',
duration: 5,
resolution: '1080p',
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Happy Horse 1.1 Reference to Video
Request Parameters
Required
@ (AT) Reference Placeholders
The @ (AT) reference feature links reference images to the prompt through numbered <<<image_N>>> placeholders. Numbering starts at 1 and follows the order of the images array.
Optional
Reference Image Requirements
- Supported formats:
JPEG, JPG, PNG, WEBP
- Maximum file size: 20 MB per image
- Minimum short side: 400 px
- Count: at least 1, up to 9 images
Example Request
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.1-reference-to-video',
prompt: 'Subject moves naturally while preserving reference style and appearance',
duration: 5,
resolution: '1080p',
aspect_ratio: '16:9',
images: [
'https://example.com/ref-1.jpg',
'https://example.com/ref-2.jpg',
],
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
@ (AT) Reference-to-Video Request Example
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
model_name: 'happyhorse-1.1-reference-to-video',
prompt: 'Show the person from <<<image_1>>> walking beside the bicycle from <<<image_2>>> through the street in <<<image_3>>>, preserving all reference details',
duration: 5,
resolution: '1080p',
aspect_ratio: '16:9',
images: [
'https://example.com/person-reference.jpg',
'https://example.com/bicycle-reference.jpg',
'https://example.com/street-reference.jpg',
],
seed: 42,
}),
});
const { data } = await response.json();
const taskId = data.task_id;
Initial Response
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
Polling Response
Poll GET /api/v1/video/{taskId} to check status:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
Status Values
submitted: Task accepted and waiting to be processed
processing: Video generation in progress
succeed: Video generation completed
failed: Video generation failed
Processing Time
Typical processing time: 2-5 minutes depending on duration and queue load.
Best Practices
- Describe Motion Clearly: Add subject movement, camera movement, and scene progression to improve video dynamics.
- Use Short Iterations First: Start with 3-5 second generations to validate prompt direction before running longer clips.
- Choose the Right Input Image: For image-to-video, use a clear, well-lit first-frame image with a strong subject focus.
- Curate Reference Images: For reference-to-video, provide consistent, high-quality reference images that clearly represent the subject or style you want to preserve.
- Reuse Seeds for Variants: Keep the same
seed when testing prompt refinements to compare outputs more consistently.
- Match Ratio to Delivery Channel: Use
16:9 for landscape video, 9:16 for shorts and reels, and 1:1 for square placements.