Overview
The HappyHorse video generation endpoint is based on Alibaba Cloud DashScope and supports four modes: text-to-video (T2V), image-to-video (I2V), reference-to-video (R2V), and video editing (V2V).
Base URL: https://mm-internal-cn.leonecloud.com
Authentication
All endpoints require a token in the request header for authentication:
Authorization: Bearer {YOUR_AUTH_TOKEN}Quick Start
cURL Example
Create HappyHorse Task (Text-to-Video)
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/hh" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A young girl walking down the road",
"resolution": "1080P",
"ratio": "16:9",
"duration": 5
}'Create HappyHorse Task (Image-to-Video)
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/hh" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Animate the scene in the image",
"genType": "i2v",
"imageUrls": ["https://example.com/image.jpg"],
"resolution": "1080P",
"duration": 5
}'Create HappyHorse Task (Reference-to-Video)
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/hh" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "A woman in a red qipao as character1 holds a folding fan as character2, while earrings as character3 sway gently with the motion",
"genType": "r2v",
"imageUrls": [
"https://example.com/girl.jpg",
"https://example.com/fan.jpg",
"https://example.com/earrings.jpg"
],
"resolution": "1080P",
"ratio": "16:9",
"duration": 5
}'Create HappyHorse Task (Video Editing)
curl -X POST "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/hh" \
-H "Authorization: Bearer your_auth_token_here" \
-H "Content-Type: application/json" \
-d '{
"prompt": "Make the character in the video wear the striped sweater from the image",
"genType": "v2v",
"videoUrl": "https://example.com/input.mp4",
"imageUrls": ["https://example.com/sweater.jpg"],
"resolution": "720P",
"audioSetting": "origin"
}'Query Task Status
curl -X GET "https://mm-internal-cn.leonecloud.com/api/v2/open/aigc/73b75c04-d565-441a-a499-1d8f4f696d51" \
-H "Authorization: Bearer fc_e6495f062c19dfd54f204442bdc7a4c5cc4174ad936e2588effd43e2b3ff51f6"Endpoints
1. Create HappyHorse Task
POST /open/aigc/hh
Create a HappyHorse Video Generationtask.
Content-Type: application/json
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| prompt | string | Yes | Video prompt, up to 2,500 characters. In R2V mode, use character1, character2, and similar markers to refer to reference images by position |
| genType | string | No | Generation type: t2v (text-to-video, default), i2v (image-to-video), r2v (reference-to-video), or v2v (video editing). If omitted, it is inferred automatically: videoUrl -> v2v, multiple images -> r2v, one image -> i2v, no image -> t2v |
| imageUrls | string[] | Condition | Reference image URLs. Required for I2V (first image only), required for R2V (1-9 images), optional for V2V (0-5 images) |
| base64File | string | No | Base64 encoded image data, supported jpg/png/bmp/webp, maximum 10MB |
| base64FileList | string[] | No | Base64 multiple encoded imagesdata, each supported jpg/png/bmp/webp, single imagemaximum 10MB |
| videoUrl | string | Condition | Input video URL. Required for V2V (video editing). Supports MP4/MOV, 3-60 seconds, maximum 100 MB |
| resolution | string | No | Resolution:1080P(default) / 720P |
| ratio | string | No | Aspect ratio:16:9(default) / 9:16 / 1:1 / 4:3 / 3:4.onlyt2vand r2v supported, i2v automatically follows first frame, v2v supported |
| duration | int | No | videoDuration:3-15seconds, default5seconds.onlyt2v/i2v/r2vsupported, v2v output Duration input video( maximum 15seconds) |
| seed | int | No | random seed,, range[0, 2147483647] |
| watermark | bool | No | watermark, default true |
| audioSetting | string | No | Audio control (V2V only): auto (default, controlled by the model) or origin (keep original audio) |
| callbackUrl | string | No | Callback notification URL after the task is complete |
Description:
-base64File,imageUrls,base64FileListcan be used together, image processing order is:base64File(single image, placed first)→imageUrls(URLlist)→base64FileList(multiple imagesbase64, appended to the end)
- supported any external image URL, the system will automatically downloads and stores#### input imageRequirements (I2V/R2V/V2V)
-dimensions:width and height at least 300px (r2vrecommended short side at least 400px)
-Aspect ratio:between 1:2.5 ~ 2.5:1 -Format:JPEG, JPG, PNG, WEBP
- File size:exceeds 10MB#### input videoRequirements (V2V)
-Format:MP4, MOV (recommendedH.264encoded)
- Duration:3-60seconds (output maximum 15seconds, exceeds 15seconds first 15seconds)
-Resolution:long side exceeds 2160px, short side at least 320px
-Aspect ratio:1:2.5 ~ 2.5:1
- File size:exceeds 100MB
-frame rate:greater than 8fps#### Request Example
Text-to-Video(T2V):
{
"prompt": "A young girl walking down the road",
"resolution": "1080P",
"ratio": "16:9",
"duration": 5
}Image-to-Video(I2V):
{
"prompt": "Animate the scene in the image",
"genType": "i2v",
"imageUrls": ["https://example.com/image.jpg"],
"resolution": "1080P",
"duration": 5
}Reference-to-Video(R2V):
{
"prompt": "A woman in a red qipao as character1 holds a folding fan as character2, while earrings as character3 sway gently with the motion",
"genType": "r2v",
"imageUrls": [
"https://example.com/girl.jpg",
"https://example.com/fan.jpg",
"https://example.com/earrings.jpg"
],
"resolution": "1080P",
"ratio": "16:9",
"duration": 5
}Video Editing(V2V):
{
"prompt": "Make the character in the video wear the striped sweater from the image",
"genType": "v2v",
"videoUrl": "https://example.com/input.mp4",
"imageUrls": ["https://example.com/sweater.jpg"],
"resolution": "720P",
"audioSetting": "origin"
}Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | Status Code, 0 indicates success |
| msg | string | Message |
| data.taskId | string | Task ID, used to query task status |
| data.status | string | Task Status, fixed to processing |
| data.createdAt | string | Created Time |
Response Example
Success
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260422150000_abc12345",
"status": "processing",
"createdAt": "2026-04-22 15:00:00"
}
}2. Query Task Status
GET /open/aigc/{taskId}
query task execute Status.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskId | string | Yes | Task ID |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | int | Status Code, 0 indicates success |
| msg | string | Message |
| data.taskId | string | Task ID |
| data.status | string | Task Status:processing / success / failed |
| data.result | string[] | Generated video URL list (Successreturned when applicable) |
| data.errorMsg | string | Error Message (Failurereturned when applicable) |
| data.createdAt | string | Created Time |
| data.updatedAt | string | Updated Time |
Response Example
processing
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260422150000_abc12345",
"status": "processing",
"createdAt": "2026-04-22 15:00:00",
"updatedAt": "2026-04-22 15:00:05"
}
}Success
{
"code": 0,
"msg": "success",
"data": {
"taskId": "task_20260422150000_abc12345",
"status": "success",
"result": [
"https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/2026/04/22/output.mp4"
],
"createdAt": "2026-04-22 15:00:00",
"updatedAt": "2026-04-22 15:02:30"
}
}3. Batch Query Task Status
POST /open/aigc/batch
query task execute Status (up to 100 ).
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| taskIds | string[] | Yes | Task ID list, up to 100 |
Request Example
{
"taskIds": ["task_20260422150000_abc12345", "task_20260422150200_def67890"]
}Callback Notification
task complete (Success or Failure) when, if Create Task when providecallbackUrl, was provided when creating the task, the system sends a POST request to that URL.
Callback Request
Headers
Content-Type: application/json
X-Funcloud-Event: task.completed
X-Funcloud-Signature: {localized example text}Body
{
"event": "task.completed",
"taskId": "task_20260422150000_abc12345",
"status": "success",
"result": ["https://fc-gw-sh.oss-accelerate.aliyuncs.com/videos/output.mp4"],
"errorMsg": "",
"timestamp": "2026-04-22T15:02:30+08:00",
"signature": "a1b2c3d4e5f6..."
}Error Codes
| code | Description |
|---|---|
| 0 | Success |
| 10002 | Parametermissing or malformed |
| 10005 | API Key invalid or missing |
| 30003 | Task not found |
| 90003 | Internal server error |
Best Practices
1. Polling Strategy
recommendedPolling:
- First 30 seconds:query every 3 seconds
- 30 seconds~ 2 minutes:query every 5 seconds
- After 2 minutes:query every 10 seconds
2. Processing Time Reference
- Text-to-Video(T2V):Usually 1 ~ 3 minutes (Duration and Resolution)
- Image-to-Video(I2V):Usually 1~ 3 minutes (Duration and Resolution)
- Reference-to-Video(R2V):Usually 1~ 5 minutes (Reference image, Duration and Resolution)
- Video Editing(V2V):Usually 1~ 5 minutes (input videoDuration and Resolution)### 3. Prompt Tips
-, subject,, Scenario, etc.
- can (,, etc. )
- maximum supported 2500 characters