Skip to main content

Endpoints

MethodEndpointDescription
POST/api/v1/generateTask/happyHorseCreate generation or edit task
GET/api/v1/statusTask/happyHorseQuery 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

request_type
string
default:"async"
async (polling) or callback (webhook)
callback_url
string
Callback URL, required when request_type=callback (conditional)
provider
string
default:"auto"
Routing strategy: auto, value, or official
input
object
required
Model input parameters
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.