# 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: | Model | ID | Description | | --------------------------------------- | ------------------------------------ | ---------------------------------------------------- | | **Happy Horse 1.1 Text to Video** | `happyhorse-1.1-text-to-video` | Generate videos directly from text prompts | | **Happy Horse 1.1 Image to Video** | `happyhorse-1.1-image-to-video` | Animate a single first-frame image with prompt guidance | | **Happy Horse 1.1 Reference to Video** | `happyhorse-1.1-reference-to-video` | Generate videos guided by up to 9 reference images | ## Quick Comparison | Feature | Text to Video | Image to Video | Reference to Video | | -------------- | ------------------------- | ------------------------- | ------------------------- | | Input | Text prompt | First-frame image + prompt | Reference images + prompt | | Duration Range | 3-15 seconds | 3-15 seconds | 3-15 seconds | | Resolution | 720p, 1080p (default 1080p) | 720p, 1080p (default 1080p) | 720p, 1080p (default 1080p) | | Aspect Ratio | 9 supported ratios (default 16:9) | Not supported (follows input image) | 9 supported ratios (default 16:9) | | Seed | Optional | Optional | Optional | ### Supported Aspect Ratios (Text to Video & Reference to Video) | Ratio | Description | | ------ | ---------------------- | | `16:9` | Landscape (widescreen) | | `9:16` | Portrait (vertical) | | `3:4` | Standard portrait | | `4:3` | Standard landscape | | `4:5` | Portrait | | `5:4` | Landscape | | `1:1` | Square | | `9:21` | Ultra-tall portrait | | `21:9` | Ultra-wide landscape | ## Happy Horse 1.1 Text to Video ### Endpoint ``` POST /api/v1/video/task ``` ### Request Parameters #### Required | Parameter | Type | Description | | -------------- | ------ | ------------------------------------------------------------------ | | `model_name` | string | Must be `"happyhorse-1.1-text-to-video"` | | `prompt` | string | Video generation prompt | | `duration` | number | Video duration in seconds (3-15) | | `resolution` | string | Output resolution: `"720p"` or `"1080p"` (default `"1080p"`) | | `aspect_ratio` | string | Video aspect ratio (see table above; default `"16:9"`) | #### Optional | Parameter | Type | Description | | --------- | ------ | ---------------------------------------------------------------------------------- | | `seed` | number | Random seed for reproducible generations, integer in the range `0` to `2147483647` | ### Example Request ```javascript 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 | Parameter | Type | Description | | ------------ | ------ | ------------------------------------------------------------------ | | `model_name` | string | Must be `"happyhorse-1.1-image-to-video"` | | `prompt` | string | Video generation prompt | | `duration` | number | Video duration in seconds (3-15) | | `resolution` | string | Output resolution: `"720p"` or `"1080p"` (default `"1080p"`) | | `image_url` | string | First-frame image URL (first frame only) | #### Optional | Parameter | Type | Description | | --------- | ------ | ---------------------------------------------------------------------------------- | | `seed` | number | Random seed for reproducible generations, integer in the range `0` to `2147483647` | > **Note:** `aspect_ratio` is not supported for image-to-video. Output framing follows the uploaded first-frame image. ### Example Request ```javascript 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 | Parameter | Type | Description | | -------------- | -------- | ------------------------------------------------------------------ | | `model_name` | string | Must be `"happyhorse-1.1-reference-to-video"` | | `prompt` | string | Video generation prompt. Write a standard prompt without placeholders, or optionally use the @ (AT) reference feature with `<<>>` to explicitly reference items from the `images` array | | `duration` | number | Video duration in seconds (3-15) | | `resolution` | string | Output resolution: `"720p"` or `"1080p"` (default `"1080p"`) | | `aspect_ratio` | string | Video aspect ratio (see table above; default `"16:9"`) | | `images` | string[] | Reference image URLs (1-9 images) | #### @ (AT) Reference Placeholders The @ (AT) reference feature links reference images to the prompt through numbered `<<>>` placeholders. Numbering starts at `1` and follows the order of the `images` array. | Placeholder | Referenced value | |-------------|------------------| | `<<>>` | `images[0]` | | `<<>>` | `images[1]` | | `<<>>` | `images[2]` | #### Optional | Parameter | Type | Description | | --------- | ------ | ---------------------------------------------------------------------------------- | | `seed` | number | Random seed for reproducible generations, integer in the range `0` to `2147483647` | ### 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 ```javascript 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 ```javascript 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 <<>> walking beside the bicycle from <<>> through the street in <<>>, 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; ``` ## Response Format ### Initial Response ```json { "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: ```json { "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": { "credit": 0.2, "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 1. **Describe Motion Clearly**: Add subject movement, camera movement, and scene progression to improve video dynamics. 2. **Use Short Iterations First**: Start with 3-5 second generations to validate prompt direction before running longer clips. 3. **Choose the Right Input Image**: For image-to-video, use a clear, well-lit first-frame image with a strong subject focus. 4. **Curate Reference Images**: For reference-to-video, provide consistent, high-quality reference images that clearly represent the subject or style you want to preserve. 5. **Reuse Seeds for Variants**: Keep the same `seed` when testing prompt refinements to compare outputs more consistently. 6. **Match Ratio to Delivery Channel**: Use `16:9` for landscape video, `9:16` for shorts and reels, and `1:1` for square placements.