Endpoints
| Method | Endpoint | Description |
|---|
| POST | /api/v1/generateTask/happyHorse | Create generation or edit task |
| GET | /api/v1/statusTask/happyHorse | Query task status |
Authentication
All requests require an API Key in the header:
Authorization: Bearer YOUR_API_KEY
Request Body
{
"request_type": "async",
"provider": "official",
"input": {
"mode": "text-to-video",
"prompt": "a cinematic rainy night in tokyo",
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"watermark": false
}
}
Parameters
async (polling) or callback (webhook)
Callback URL, required when request_type=callback (conditional)
Routing strategy: auto, value, or official
Model input parameters
text-to-video, image-to-video, reference-to-video, or video-edit
Required for text-to-video, reference-to-video, and video-edit. Optional for image-to-video. Maximum 2500 characters.
Output resolution: 720p or 1080p
Only for text-to-video and reference-to-video. Supported values: 16:9, 9:16, 1:1, 4:3, 3:4
Output duration in seconds, 3-15. Only for text-to-video, image-to-video, and reference-to-video.
image-to-video: exactly 1 image. reference-to-video: 1-9 images. video-edit: optional 0-5 reference images.
video-edit only, exactly 1 input video URL
video-edit only. auto or origin
Whether to add a watermark
Optional random seed. If omitted, the system auto-generates one in [0, 2147483647].
Mode Options:
text-to-video — Generate video from a text prompt.
image-to-video — Upload exactly one image as the first frame.
reference-to-video — Upload 1-9 reference images and guide the video with text.
video-edit — Edit one existing video with a prompt and optional reference images.
Constraints:
image-to-video requires exactly 1 image.
reference-to-video requires 1-9 reference images.
video-edit requires exactly 1 input video and supports 0-5 reference images.
video-edit ignores public duration; billing uses the input video duration.
- HappyHorse output includes audio by default, and inference audio cannot be fully disabled.
Examples
Text-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/happyHorse" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "official",
"input": {
"mode": "text-to-video",
"prompt": "a cinematic rainy night in tokyo",
"resolution": "720p",
"ratio": "16:9",
"duration": 5,
"watermark": false
}
}'
Image-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/happyHorse" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "official",
"input": {
"mode": "image-to-video",
"image_urls": ["https://example.com/first-frame.png"],
"prompt": "turn this image into a smooth camera move",
"resolution": "720p",
"duration": 5
}
}'
Reference-to-Video
curl -X POST "https://api.apixo.ai/api/v1/generateTask/happyHorse" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "async",
"provider": "official",
"input": {
"mode": "reference-to-video",
"prompt": "keep the character style consistent across all references",
"image_urls": [
"https://example.com/ref-1.png",
"https://example.com/ref-2.png"
],
"resolution": "1080p",
"ratio": "16:9",
"duration": 6
}
}'
Video Edit
curl -X POST "https://api.apixo.ai/api/v1/generateTask/happyHorse" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"request_type": "callback",
"callback_url": "https://your-server.com/callback",
"provider": "official",
"input": {
"mode": "video-edit",
"video_urls": ["https://example.com/input.mp4"],
"image_urls": ["https://example.com/ref.png"],
"prompt": "change the scene to watercolor style",
"resolution": "1080p",
"audio_setting": "origin",
"watermark": false
}
}'
Response
POST /api/v1/generateTask/happyHorse
Returns taskId on success for subsequent status queries.
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678"
}
}
GET /api/v1/statusTask/happyHorse
curl -X GET "https://api.apixo.ai/api/v1/statusTask/happyHorse?taskId=task_12345678" \
-H "Authorization: Bearer YOUR_API_KEY"
{
"code": 200,
"message": "success",
"data": {
"taskId": "task_12345678",
"state": "success",
"resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
"createTime": 1767965610929,
"completeTime": 1767965652317,
"costTime": 41388
}
}
Billing
- Unit: per second.
- 720p:
$0.125/s official, $0.1625/s market reference.
- 1080p:
$0.225/s official, $0.2875/s market reference.
- text-to-video, image-to-video, and reference-to-video:
duration × unitPrice.
- video-edit:
min(inputVideoDuration, 15) × 2 × unitPrice.