Skip to main content
POST
根据文本、参考图像或首帧创建 HappyHorse 视频。API 会立即返回任务 ID。请存储返回的 id,以便轮询任务并下载完成的视频。 POST /v1/videos 使用 multipart/form-data。将控制参数作为表单字段发送,并将参考图像作为 input_reference 字段发送,每个字段对应一个 HTTPS URL 或上传的图像文件。

选择输入模式

参考图像可引导视频中的主体和视觉细节。发送 1–9 个可公开访问的 HTTPS 图像 URL 或 1–9 个图像文件,按图像顺序为每张图像重复发送一次 input_reference 在此字段中只能使用 URL 或只能使用文件。请分别发送每个 URL,而不是用逗号连接多个 URL。 对于 input_reference,每张参考图像必须不超过 10 MB,且需满足 happyhorse-1.0。 使用 happyhorse-1.1 时,每张参考图像必须不超过 20 MB。 这些模型限制同时适用于图像 URL 和上传的文件。 请使用 JPEG、JPG、PNG 或 WEBP 图像,且最短边至少为 400 px。 每个文件的 input_reference 上传限制为 20 MiB(20 × 1024 × 1024 字节)。上传的图像还必须满足上述模型专属限制。 本页顶部的请求示例展示了 HappyHorse 1.1 的多个图像 URL,以及两个模型的多个文件上传。 要设置首帧,请使用一个可公开访问的 HTTPS 图像 URL 或一个图像文件发送一次 first_frame。请在与 input_reference 分开的请求中使用此字段。

设置时长和尺寸

请从下表中为 WxH 选择一个精确的 size 值。 对于首帧请求,图像决定画面构图和宽高比,而 size 用于选择输出分辨率级别。

任务流程

1

创建任务

发送 multipart 表单请求,并存储返回的 id
2

轮询任务

调用 获取 HappyHorse 视频 直到 statuscompletedfailederror
3

下载结果

当任务处于 completed 时,调用 获取 HappyHorse 视频内容 以下载 MP4 文件。

授权

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

请求体

multipart/form-data
model
enum<string>
必填

HappyHorse model ID for this endpoint.

可用选项:
happyhorse-1.0,
happyhorse-1.1
示例:

"happyhorse-1.1"

prompt
string
必填

Text prompt that describes the video to generate. For image inputs, describe the motion and visual details to preserve.

示例:

"Use the uploaded reference image as the visual guide. Create a short cinematic shot with gentle natural motion."

seconds
integer
默认值:5

Requested clip duration in whole seconds. Send an integer from 3 through 15 as a form field. The default is 5.

必填范围: 3 <= x <= 15
示例:

3

size
string

Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model. For first-frame requests, size selects the resolution tier; the image determines the framing and aspect ratio.

示例:

"1920x1080"

input_reference

Reference images for reference-to-video. Send 1–9 publicly accessible HTTPS image URLs or 1–9 uploaded image files by repeating input_reference once per image. Use only URLs or only files within this field; do not join URLs with commas. Reference images guide subjects and visual details. CometAPI preserves image order. Use JPEG, JPG, PNG, or WEBP images with a shortest side of at least 400 px. Each reference image must be at or below 10 MB for happyhorse-1.0 or 20 MB for happyhorse-1.1. These model limits apply to both image URLs and uploaded files. The input_reference file upload limit is 20 MiB (20 x 1024 x 1024 bytes) per file. Keep uploads within the model limit as well. Keep this field separate from first_frame.

Pattern: ^https://
first_frame

Opening-frame image as one publicly accessible HTTPS URL or one image file. Send this field once, using either a URL or a file. Use JPEG, JPG, PNG, or WEBP images up to 20 MB. Do not combine first_frame with input_reference.

Pattern: ^https://

响应

Task created. Store the returned id and poll GET /v1/videos/{task_id}.

id
string
必填

Task ID. Use this value with retrieve and content endpoints.

示例:

"task_example"

object
string
必填

Object type. Video tasks return video.

示例:

"video"

model
string
必填

Model ID used for the task.

示例:

"happyhorse-1.1"

status
enum<string>
必填

Task lifecycle status. Poll until the value is completed, failed, or error.

可用选项:
queued,
in_progress,
completed,
failed,
error
示例:

"queued"

progress
integer
必填

Task progress as a coarse percentage.

必填范围: 0 <= x <= 100
示例:

0

created_at
integer
必填

Task creation time as a Unix timestamp in seconds.

示例:

1779938152

task_id
string

Compatibility alias for id when present.

示例:

"task_example"

completed_at
integer

Task completion time as a Unix timestamp in seconds. This field appears on completed tasks.

示例:

1779938219

video_url
string

Temporary video delivery URL. This field appears on completed tasks.

示例:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

最后修改于 2026年9月9日