Skip to main content

Documentation Index

Fetch the complete documentation index at: https://apixo.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Overview

HappyHorse is an Alibaba video model for text-to-video, image-to-video, reference-guided video generation, and video editing. Use this page when you are ready to call the API after trying the model in the APIXO playground.
CapabilityValue
Model IDhappyHorse
Modestext-to-video, image-to-video, reference-to-video, video-edit
PromptRequired for text-to-video, reference-to-video, and video-edit; optional for image-to-video
Prompt lengthUp to 2500 characters
Input imagesExactly 1 URL for image-to-video; 1-9 URLs for reference-to-video; 0-5 optional reference image URLs for video-edit
Input videosExactly 1 URL for video-edit
Aspect ratios16:9, 9:16, 1:1, 4:3, 3:4 for text-to-video and reference-to-video
Resolution tiers720p, 1080p
Duration3-15 seconds for text-to-video, image-to-video, and reference-to-video
HappyHorse outputs video with audio by default. The public API does not expose a switch to fully disable generated audio. For video-edit, use audio_setting to choose automatic audio behavior or preserve the original input audio.

Endpoint and authentication

Base URL:
https://api.apixo.ai/api/v1
MethodEndpointPurpose
POST/generateTask/happyHorseSubmit a generation or edit task
GET/statusTask/happyHorse?taskId={taskId}Poll task status and retrieve results
All requests require your APIXO API key:
Authorization: Bearer YOUR_API_KEY
Submit requests also require:
Content-Type: application/json

Copy-paste async quickstart

This minimal request submits a text-to-video task and returns a taskId.
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",
    "input": {
      "mode": "text-to-video",
      "prompt": "a cinematic rainy night in tokyo, slow dolly shot, reflective streets",
      "resolution": "720p",
      "ratio": "16:9",
      "duration": 5
    }
  }'
Successful response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678"
  }
}
Save the taskId; you need it to poll for the final video.

Poll for result

curl -X GET "https://api.apixo.ai/api/v1/statusTask/happyHorse?taskId=task_12345678" \
  -H "Authorization: Bearer YOUR_API_KEY"
Processing response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "processing",
    "createTime": 1767965610929
  }
}
Success response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "success",
    "resultJson": "{\"resultUrls\":[\"https://r2.apixo.ai/video.mp4\"]}",
    "createTime": 1767965610929,
    "completeTime": 1767965652317,
    "costTime": 41388
  }
}
Failed response:
{
  "code": 200,
  "message": "success",
  "data": {
    "taskId": "task_12345678",
    "state": "failed",
    "failCode": "PromptInvalid",
    "failMsg": "Prompt is invalid or rejected by provider",
    "createTime": 1767965610929,
    "completeTime": 1767965620132
  }
}
Parse resultJson after state becomes success:
const payload = JSON.parse(data.resultJson);
const videoUrls = payload.resultUrls;

Request body

Text-to-video

{
  "request_type": "async",
  "input": {
    "mode": "text-to-video",
    "prompt": "a cinematic rainy night in tokyo, slow dolly shot, reflective streets",
    "resolution": "1080p",
    "ratio": "16:9",
    "duration": 5,
    "watermark": false
  }
}

Image-to-video

{
  "request_type": "async",
  "input": {
    "mode": "image-to-video",
    "image_urls": [
      "https://example.com/first-frame.png"
    ],
    "prompt": "animate the scene with a gentle camera move",
    "resolution": "720p",
    "duration": 5,
    "watermark": false
  }
}

Reference-to-video

{
  "request_type": "async",
  "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,
    "watermark": false
  }
}

Video edit

{
  "request_type": "async",
  "input": {
    "mode": "video-edit",
    "video_urls": [
      "https://example.com/input.mp4"
    ],
    "image_urls": [
      "https://example.com/reference.png"
    ],
    "prompt": "change the scene to watercolor style",
    "resolution": "1080p",
    "audio_setting": "origin",
    "watermark": false
  }
}

Parameters

request_type
string
default:"async"
required
Result delivery mode. Use async for polling with statusTask, or callback for webhook delivery.
callback_url
string
Required when request_type is callback. Must be a public HTTPS URL that can receive the final task payload. See Webhooks.
input
object
required
HappyHorse input parameters.

Response format

Submit task response

POST /generateTask/happyHorse returns a task ID when the task is accepted:
code
integer
API status code. 200 means the task was accepted.
message
string
Human-readable status message.
data.taskId
string
Unique task identifier used with the status endpoint.

Status response fields

taskId
string
Unique task identifier.
state
string
Current task state: processing, success, or failed.
resultJson
string
JSON string containing generated video URLs in resultUrls. Present when state is success.
failCode
string
Machine-readable failure code. Present when state is failed.
failMsg
string
Human-readable failure message. Present when state is failed.
createTime
integer
Task creation timestamp in Unix milliseconds.
completeTime
integer
Task completion timestamp in Unix milliseconds. Present after completion.
costTime
integer
Processing duration in milliseconds. Present after successful completion when available.

Webhook callback mode

Use callback mode when your backend should receive the final result automatically instead of polling.
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/webhooks/apixo",
    "input": {
      "mode": "video-edit",
      "video_urls": [
        "https://example.com/input.mp4"
      ],
      "image_urls": [
        "https://example.com/reference.png"
      ],
      "prompt": "change the scene to watercolor style",
      "resolution": "1080p",
      "audio_setting": "origin",
      "watermark": false
    }
  }'
See Webhooks for delivery requirements and retry behavior.

Billing

HappyHorse is billed per second. The selected resolution determines the unit price.
ResolutionAPIXO official priceMarket reference
720p$0.125 / second$0.1625 / second
1080p$0.225 / second$0.2875 / second
Billing formulas:
ModeFormula
text-to-videoduration * unitPrice
image-to-videoduration * unitPrice
reference-to-videoduration * unitPrice
video-edit(input video seconds + output video seconds) * unitPrice
For video-edit, the backend probes the input video duration and does not send a public duration parameter to the provider. Billing uses the input video seconds plus the generated output video seconds; APIXO caps the billable input side at 15 seconds, and the generated output side is billed at the same capped duration. For current route and market comparison pricing, see Pricing.

Latency and polling

HappyHorse tasks are asynchronous. The backend does not enforce a fixed public latency SLA; actual time varies by mode, resolution, duration, prompt complexity, media fetch speed, and provider queue load.
WorkflowWhat affects latencyRecommended first pollPoll interval
text-to-videoResolution, duration, prompt complexity, queue load30s after task creation10s
image-to-videoImage fetch time, resolution, duration, queue load30s after task creation10s
reference-to-videoNumber of references, resolution, duration, queue load45s after task creation10s-15s
video-editInput video fetch/probe time, input duration, references, queue load60s after task creation10s-15s
For production workloads, use callback mode to avoid frequent polling for long-running video jobs.
Rate limits and concurrency can vary by account, API key, and route. If you receive 429, slow down requests and retry with backoff. For account-level details, see System APIs.

Errors and troubleshooting

HTTP errors

CodeMeaningWhat to do
400Invalid request body, mode, parameter, media URL shape, or provider rejectionFix the request before retrying
401Missing or invalid API keyCheck the Authorization header
402Insufficient balance or quotaAdd balance or switch account/key
403Key or route cannot access the modelCheck permissions and route strategy
429Rate limit or concurrency limit reachedRetry with exponential backoff
500Server errorRetry with backoff
502Upstream provider errorRetry with backoff
504Upstream timeoutRetry or use callback mode for long-running jobs

Task failure codes

Fail codeMeaningWhat to do
PromptInvalidPrompt was invalid or rejected by the providerRewrite the prompt with clearer, policy-safe instructions
SensitiveContent / SensitiveContentDetectedPrompt, input media, or output failed safety checksChange the prompt or media
MissingParameter / BadRequestRequired mode-specific fields are missing or malformedCheck mode, prompt, image_urls, video_urls, resolution, ratio, and duration
RateLimited / RateLimitExceededProvider or APIXO rate limit was reachedRetry with exponential backoff
Timeout / Task TimeOutThe provider did not finish in timeRetry, reduce input complexity, or use callback mode
Unknown errorUpstream failure could not be mapped to a known categoryRetry with backoff or contact support with the taskId

Troubleshooting tips

  • Use public, direct, fetchable URLs for image_urls and video_urls.
  • For image-to-video, send exactly one image URL.
  • For reference-to-video, send 1-9 image URLs and include a non-empty prompt.
  • For video-edit, send exactly one video URL. Optional reference images are limited to 5.
  • Use ratio only with text-to-video and reference-to-video.
  • Use duration only with text-to-video, image-to-video, and reference-to-video; video-edit duration is determined from the input video and billed as input video seconds plus output video seconds.
  • Store result URLs promptly if your application needs long-term access.
See Error Codes for the full error reference.