Skip to main content
POST
/
v1
/
video
/
generations
HappyHorse Video Generation
curl --request POST \
  --url https://api.gravitex.ai/v1/video/generations \
  --header 'Authorization: <authorization>'

Documentation Index

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

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

Introduction

HappyHorse is Alibaba Cloud Bailian’s video generation family: text-to-video (HappyHorse-T2V), image-to-video (HappyHorse-I2V), and reference-to-video (HappyHorse-R2V). It produces physically realistic, smooth-motion videos at 720P and 1080P, with durations from 3–15 seconds. Use GravitexAI’s unified video API: submit a task to get a task_id, then query the task to poll status and get url.
HappyHorse passes underlying DashScope parameters via metadata.input and metadata.parameters, same structure as Wan 2.7. Reference-to-video uses [Image 1], [Image 2] in the prompt (English bracket format) and supports image references only—no video references.

Authentication

Authorization
string
required
Bearer Token, e.g. Bearer sk-xxxxxxxxxx

Supported models

Model IDDescriptionResolutionMax durationHighlights
happyhorse-1.0-t2vText-to-video720P, 1080P15sText semantics, multiple aspect ratios
happyhorse-1.0-i2vImage-to-video (first frame)720P, 1080P15sFirst-frame driven; aspect ratio follows input
happyhorse-1.0-r2vReference-to-video720P, 1080P15sUp to 9 reference images, subject fusion

Workflow

  1. Submit task: POST /v1/video/generations with model, prompt, duration, and HappyHorse params in metadata.
  2. Poll status: GET /v1/video/generations/{task_id} every 3–15 seconds until status is succeeded or failed.
  3. Get result: On success, url contains the video link (typically valid for 24 hours—download promptly).

Common request structure

FieldTypeRequiredDescription
modelstringYesModel ID (see table above)
promptstringVariesVideo prompt (same as metadata.input.prompt)
durationintegerNoDuration in seconds; keep in sync with metadata.parameters.duration
metadata.inputobjectYesInput: prompt, media, etc.
metadata.parametersobjectNoParams: resolution, ratio, duration, watermark, seed, etc.

Submit response

{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "submitted",
  "format": "mp4"
}

Query response (success)

{
  "task_id": "video_69095b4ce0048190893a01510c0c98b0",
  "status": "succeeded",
  "format": "mp4",
  "url": "https://gravitex-ads.oss-cn-guangzhou.aliyuncs.com/2025/11/18/abc123/video.mp4"
}

Use cases

Generate physically realistic, smooth-motion video from a text prompt.
metadata.input.prompt
string
required
Text prompt describing the desired video
metadata.parameters.resolution
string
default:"1080P"
720P or 1080P
metadata.parameters.ratio
string
default:"16:9"
Aspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9
metadata.parameters.duration
integer
default:"5"
Duration in seconds, range 3–15
metadata.parameters.watermark
boolean
default:"true"
Add watermark (fixed text “Happy Horse” at bottom-right)
metadata.parameters.seed
integer
Random seed, range [0, 2147483647], for reproducibility
Example:
curl -X POST "https://api.gravitex.ai/v1/video/generations" \
  -H "Authorization: Bearer sk-xxxxxxxxxx" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "happyhorse-1.0-t2v",
    "prompt": "A miniature city built from cardboard and bottle caps comes alive at night. A cardboard train rolls through, tiny lights illuminating the path ahead.",
    "duration": 5,
    "metadata": {
      "input": {
        "prompt": "A miniature city built from cardboard and bottle caps comes alive at night. A cardboard train rolls through, tiny lights illuminating the path ahead."
      },
      "parameters": {
        "resolution": "720P",
        "ratio": "16:9",
        "duration": 5,
        "watermark": false
      }
    }
  }'

Parameter reference

Common parameters

ParameterTypeDescription
durationinteger3–15 seconds, default 5
resolutionstring720P or 1080P, default 1080P
watermarkbooleanAdd watermark, default true
seedintegerRandom seed, range [0, 2147483647]

Text-to-video & reference-to-video

ParameterTypeDescription
ratiostring16:9, 9:16, 1:1, 4:3, 3:4, 4:5, 5:4, 9:21, 21:9, default 16:9. I2V follows first frame—omit ratio

Media input limits

TypeFormatSizeOther limits
First frame (first_frame)JPEG, JPG, PNG, WEBP≤ 20MBWidth and height ≥ 300px
Reference image (reference_image)JPEG, JPG, PNG, WEBP≤ 20MBShort edge ≥ 400px; recommend 720P+ clarity; 1–9 images

Error handling

HTTP statusMeaningSuggestion
400Invalid requestCheck metadata structure and media limits
401UnauthorizedCheck API Key
429Rate limitedRetry with lower frequency
502Upstream errorRetry later
On failure, status is failed and error.message contains the reason.

FAQ

Video url and task_id are typically valid for 24 hours. Download and store promptly.
Use [Image 1], [Image 2] in the prompt. Order matches reference_image entries in media. Describe specific objects in each reference.
HappyHorse I2V supports first frame (first_frame) only—no first+last frame, continuation, or audio driving.
Same metadata.input / metadata.parameters structure. HappyHorse R2V uses [Image n] and images only (up to 9); Wan 2.7 uses 图n/视频n with video refs and voice clone. HappyHorse defaults to 1080P and watermark on; duration is 3–15s.

Submit video task

Unified video submission and multi-model parameters

Query video task

Poll task status and get video URL