Skip to content

HappyHorse Video

HappyHorse Video uses an asynchronous video task API. Create a task first, then poll the task endpoint for status and the final video URL.

Endpoints

CapabilityMethodPath
Create video taskPOST/v1/video/generations
Retrieve video taskGET/v1/video/generations/{task_id}

Every request requires an API key:

http
Authorization: Bearer YOUR_API_KEY
Content-Type: application/json

Models

ModelUse caseRequired media
happyhorse-1.0-t2vText to videoprompt only
happyhorse-1.0-i2vImage to videoOne first-frame image
happyhorse-1.0-r2vReference image to videoOne or more reference images
happyhorse-1.0-video-editVideo editingSource video URL

Request Parameters

FieldTypeRequiredDescription
modelstringYesHappyHorse model name
promptstringYesVideo generation or editing prompt
durationnumberNoVideo duration in seconds. Defaults to 5 if omitted
secondsstringNoDuration as a string. Use either duration or seconds
sizestringNoSize or aspect ratio, such as 1920x1080, 1080x1920, 1:1, 16:9
imagestringNoSingle image URL for image-to-video or reference image use cases
imagesstring[]NoMultiple image URLs for reference images or editing references
input_referencestringNoReference media URL. It can be an image or a video
metadataobjectNoHappyHorse-specific options

metadata Fields

FieldTypeDescription
resolutionstringOutput resolution, 720P or 1080P
ratiostringOutput aspect ratio, such as 16:9, 9:16, 1:1, 4:3, 3:4
watermarkbooleanWhether to add a watermark
seednumberRandom seed
audio_settingstringAudio setting, such as origin
image_urlstringSingle image URL
image_urlsstring[]Multiple image URLs
video_urlstringSource video URL for video editing
video_urlsstring[]Source video URL list. The first URL is used by default
mediaobject[]Explicit media list for advanced use cases

media item example:

json
{
  "type": "first_frame",
  "url": "https://example.com/first-frame.png"
}

Common type values:

typeDescription
first_frameFirst-frame image
reference_imageReference image
videoSource video

Text to Video

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "happyhorse-1.0-t2v",
    "prompt": "A cinematic aerial shot of a futuristic cubic city at sunrise, slow camera push-in, realistic lighting",
    "duration": 5,
    "size": "1920x1080",
    "metadata": {
      "resolution": "1080P",
      "ratio": "16:9",
      "watermark": false
    }
  }'

Image to Video

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "happyhorse-1.0-i2v",
    "prompt": "Animate the product from the first frame with a slow clockwise rotation, keep the original composition and product shape stable",
    "image": "https://example.com/first-frame.png",
    "duration": 5,
    "metadata": {
      "resolution": "1080P",
      "watermark": false
    }
  }'

You can also provide the first-frame image as:

json
{
  "input_reference": "https://example.com/first-frame.png"
}

or:

json
{
  "metadata": {
    "image_url": "https://example.com/first-frame.png"
  }
}

Reference Image to Video

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "happyhorse-1.0-r2v",
    "prompt": "Use the reference images to generate a short product showcase video, maintain the product identity and lighting consistency",
    "images": [
      "https://example.com/ref-1.png",
      "https://example.com/ref-2.png"
    ],
    "duration": 6,
    "metadata": {
      "resolution": "1080P",
      "ratio": "16:9",
      "watermark": false
    }
  }'

Video Editing

bash
curl -X POST https://cubicspaces.cloud/v1/video/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
    "model": "happyhorse-1.0-video-edit",
    "prompt": "Replace the background with a clean studio scene while preserving the person, motion path, and timing of the source video",
    "metadata": {
      "video_url": "https://example.com/source.mp4",
      "resolution": "720P",
      "watermark": false
    }
  }'

You can also provide the source video as input_reference:

json
{
  "input_reference": "https://example.com/source.mp4"
}

Create Response

A successful create request returns a video task object:

json
{
  "id": "video_xxx",
  "task_id": "video_xxx",
  "object": "video",
  "model": "happyhorse-1.0-t2v",
  "status": "queued",
  "progress": 0,
  "created_at": 1770000000
}

Use either id or task_id to retrieve the task.

Retrieve Task

bash
curl https://cubicspaces.cloud/v1/video/generations/video_xxx \
  -H "Authorization: Bearer YOUR_API_KEY"

Retrieve Response

json
{
  "id": "video_xxx",
  "task_id": "video_xxx",
  "object": "video",
  "model": "happyhorse-1.0-t2v",
  "status": "completed",
  "progress": 100,
  "created_at": 1770000000,
  "completed_at": 1770000120,
  "metadata": {
    "url": "https://example.com/output.mp4"
  }
}

Status Values

statusDescription
queuedThe task is queued
in_progressThe task is running
completedThe task has completed
failedThe task failed

When the task is completed, read the video URL from metadata.url.