HappyHorse Text-to-Video API Reference#
Provider: DataEyes
Base URL: https://platform.dataeyes.ai/ali
Version: v1
Last Updated: 2026-06-26
Overview#
The HappyHorse Text-to-Video API enables you to generate videos from text prompts using DataEyes' HappyHorse video generation models. The API follows an asynchronous task-based workflow: you submit a generation request and then poll for results until the task completes.Supported Models#
| Model ID | Description |
|---|
happyhorse-1.1-t2v | HappyHorse v1.1 Text-to-Video |
happyhorse-1.0-t2v | HappyHorse v1.0 Text-to-Video |
Endpoint#
| Operation | Method | URL |
|---|
| Create Task | POST | https://platform.dataeyes.ai/ali/api/v1/services/aigc/video-generation/video-synthesis |
| Query Results | GET | https://platform.dataeyes.ai/ali/api/v1/tasks/{task_id} |
Authentication#
All requests must include an API key in the Authorization header using the Bearer scheme:Authorization: Bearer sk-xxxx
Workflow#
The Text-to-Video API uses an asynchronous two-step workflow: +------------------+
| Client |
+--------+---------+
|
Step 1: POST /video-synthesis
(prompt + parameters)
|
v
+------------------+
| DataEyes API |
+--------+---------+
|
Returns task_id +
task_status: PENDING
|
v
+------------------+
| Client |
+--------+---------+
|
Step 2: GET /tasks/{task_id}
(poll every ~15 seconds)
|
v
+------------------+
| DataEyes API |
+--------+---------+
|
+-------------+-------------+
| |
SUCCEEDED FAILED
video_url returned error returned
1.
Create Task -- Submit a POST request with your prompt and parameters. The API returns a task_id immediately.
2.
Query Results -- Poll the task status using GET /tasks/{task_id} at recommended intervals of 15 seconds until the status is SUCCEEDED or FAILED.
Step 1: Create Task#
Request#
Method: POST
URL: https://platform.dataeyes.ai/ali/api/v1/services/aigc/video-generation/video-synthesis| Header | Required | Value |
|---|
Content-Type | Yes | application/json |
Authorization | Yes | Bearer sk-xxxx |
X-DashScope-Async | Yes | enable |
Request Body#
| Field | Type | Required | Description |
|---|
model | string | Yes | Model identifier. One of happyhorse-1.1-t2v or happyhorse-1.0-t2v. |
input | object | Yes | Input object containing the prompt. |
parameters | object | No | Generation parameters (resolution, ratio, duration, etc.). |
input Object#
| Field | Type | Required | Description |
|---|
prompt | string | Yes | Text description of the video to generate. Maximum 5000 non-Chinese characters or 2500 Chinese characters. |
parameters Object#
| Field | Type | Required | Default | Description |
|---|
resolution | string | No | 1080P | Output video resolution. Values: 720P, 1080P. |
ratio | string | No | 16:9 | Aspect ratio. Values: 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9. |
duration | integer | No | 5 | Video duration in seconds. Range: 3 -- 15. |
watermark | boolean | No | true | Whether to include a watermark on the generated video. |
seed | integer | No | -- | Random seed for reproducible generation. Range: 0 -- 2,147,483,647. |
cURL Example#
Success Response#
{
"output": {
"task_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"task_status": "PENDING"
},
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Error Response#
{
"code": "InvalidParameter",
"message": "The prompt exceeds the maximum allowed length.",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Response Fields#
| Field | Type | Description |
|---|
output.task_id | string | Unique identifier for the created task. Valid for 24 hours. |
output.task_status | string | Initial task status (typically PENDING). |
request_id | string | Unique identifier for this API request. |
code | string | Error code (present only on failure). |
message | string | Error message (present only on failure). |
Step 2: Query Results#
Request#
Method: GET
URL: https://platform.dataeyes.ai/ali/api/v1/tasks/{task_id}Replace {task_id} with the task_id returned from Step 1.| Header | Required | Value |
|---|
Authorization | Yes | Bearer sk-xxxx |
Polling Tips#
Recommended poll interval: 15 seconds.
Query RPS limit: 20 requests per second.
The task_id is valid for 24 hours after creation.
The video_url in the response is valid for 24 hours after generation completes. Download the video promptly.
cURL Example#
Success Response (SUCCEEDED)#
{
"output": {
"task_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"task_status": "SUCCEEDED",
"submit_time": "2026-06-26 10:00:00.000",
"scheduled_time": "2026-06-26 10:00:01.000",
"end_time": "2026-06-26 10:01:30.000",
"video_url": "https://example.oss.aliyuncs.com/output/video.mp4",
"orig_prompt": "A golden retriever running across a sunlit meadow, cinematic slow motion, 4K quality"
},
"usage": {
"duration": 5,
"input_video_duration": 0,
"output_video_duration": 5,
"video_count": 1,
"SR": 0,
"ratio": "16:9"
},
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Failure Response (FAILED)#
{
"output": {
"task_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx",
"task_status": "FAILED",
"submit_time": "2026-06-26 10:00:00.000",
"scheduled_time": "2026-06-26 10:00:01.000",
"end_time": "2026-06-26 10:01:00.000",
"code": "InvalidParameter",
"message": "Generation failed due to invalid input parameters."
},
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Expired Task Response#
When querying a task_id that has expired (older than 24 hours):{
"code": "InvalidParameter",
"message": "Task not found or has expired.",
"request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
}
Response Fields#
| Field | Type | Description |
|---|
output.task_id | string | Unique identifier for the task. |
output.task_status | string | Current task status. See Task Status Reference. |
output.submit_time | string | Timestamp when the task was submitted. |
output.scheduled_time | string | Timestamp when the task was scheduled for processing. |
output.end_time | string | Timestamp when the task completed (succeeded or failed). |
output.video_url | string | URL of the generated video (MP4, H.264 codec). Valid for 24 hours. Present only when task_status is SUCCEEDED. |
output.orig_prompt | string | The original prompt submitted with the task. |
output.code | string | Error code (present only when task_status is FAILED). |
output.message | string | Error message (present only when task_status is FAILED). |
usage.duration | integer | Requested video duration in seconds. |
usage.input_video_duration | integer | Input video duration in seconds. Fixed to 0 for text-to-video. |
usage.output_video_duration | integer | Actual output video duration in seconds. |
usage.video_count | integer | Number of videos generated. Fixed to 1. |
usage.SR | integer | Super-resolution flag. |
usage.ratio | string | Aspect ratio used for generation (e.g., "16:9"). |
request_id | string | Unique identifier for this API request. |
Task Status Reference#
| Status | Description |
|---|
PENDING | Task has been created and is waiting to be processed. |
RUNNING | Task is currently being processed (video is being generated). |
SUCCEEDED | Task completed successfully. The video_url is available. |
FAILED | Task failed. Check output.code and output.message for details. |
CANCELED | Task was canceled. |
UNKNOWN | Task status is unknown. |
Full Python Example#
The following example demonstrates the complete workflow: creating a text-to-video task and polling until completion.
Important Notes#
1.
Asynchronous workflow required. The X-DashScope-Async: enable header is mandatory. The API does not support synchronous video generation.
2.
Task ID validity. The task_id is valid for 24 hours after creation. After expiration, query requests will return an error.
3.
Video URL validity. The video_url returned upon task completion is valid for 24 hours. Download or cache the video before the URL expires.
4.
Poll interval. Use a minimum interval of 15 seconds between poll requests. The query endpoint has a rate limit of 20 requests per second.
5.
Prompt length limits. The prompt supports a maximum of 5,000 non-Chinese characters or 2,500 Chinese characters. Exceeding this limit will result in an InvalidParameter error.
6.
Video format. Generated videos are in MP4 format with H.264 codec.
7.
Duration range. The duration parameter accepts integer values from 3 to 15 seconds (inclusive). The default is 5 seconds.
8.
Watermark. By default, a watermark is applied to generated videos. Set "watermark": false to disable it.
Error Codes#
| Error Code | HTTP Status | Description | Recommended Action |
|---|
InvalidApiKey | 401 | The API key is missing, malformed, or invalid. | Verify your API key and ensure the Authorization header uses the Bearer scheme. |
InvalidParameter | 400 | One or more request parameters are invalid (e.g., unsupported resolution, prompt too long, expired task ID). | Check the error message for details and correct the request parameters. |
Throttling | 429 | Request rate limit exceeded. | Reduce request frequency. For task queries, use the recommended 15-second poll interval. |
This document is provided by DataEyes. For additional support, contact DataEyes technical support.Modified at 2026-10-19 10:10:04