Skip to main content
POST
Tạo video HappyHorse từ văn bản, hình ảnh tham chiếu hoặc khung hình mở đầu. API trả về ngay một ID tác vụ. Lưu id được trả về để thăm dò tác vụ và tải xuống video đã hoàn tất. POST /v1/videos sử dụng multipart/form-data. Gửi các tùy chọn điều khiển dưới dạng trường biểu mẫu và hình ảnh tham chiếu dưới dạng trường input_reference, với một URL HTTPS hoặc tệp hình ảnh đã tải lên cho mỗi trường.

Chọn chế độ đầu vào

Hình ảnh tham chiếu định hướng chủ thể và chi tiết hình ảnh trong video. Gửi 1–9 URL hình ảnh HTTPS có thể truy cập công khai hoặc 1–9 tệp hình ảnh, lặp lại input_reference một lần cho mỗi hình ảnh theo thứ tự hình ảnh. Chỉ sử dụng URL hoặc chỉ sử dụng tệp trong trường này. Gửi riêng từng URL thay vì nối các URL bằng dấu phẩy. Với input_reference, mỗi hình ảnh tham chiếu phải có dung lượng từ 10 MB trở xuống với happyhorse-1.0. Với happyhorse-1.1, mỗi hình ảnh tham chiếu phải có dung lượng từ 20 MB trở xuống. Các giới hạn mô hình này áp dụng cho cả URL hình ảnh và tệp đã tải lên. Sử dụng hình ảnh JPEG, JPG, PNG hoặc WEBP có cạnh ngắn nhất tối thiểu 400 px. Giới hạn tải lên input_reference là 20 MiB (20 × 1024 × 1024 byte) cho mỗi tệp. Hình ảnh đã tải lên cũng phải đáp ứng giới hạn dành riêng cho mô hình ở trên. Các mẫu yêu cầu ở đầu trang này hiển thị nhiều URL hình ảnh cho HappyHorse 1.1 và nhiều tệp tải lên cho cả hai mô hình. Để đặt khung hình mở đầu, hãy gửi first_frame một lần cùng một URL hình ảnh HTTPS có thể truy cập công khai hoặc một tệp hình ảnh. Sử dụng trường này trong một yêu cầu riêng biệt với input_reference.

Đặt thời lượng và kích thước

Chọn một giá trị WxH chính xác cho size từ bảng bên dưới. Đối với các yêu cầu khung hình đầu tiên, hình ảnh quyết định bố cục khung hình và tỷ lệ khung hình, còn size chọn cấp độ phân giải đầu ra.

Quy trình tác vụ

1

Tạo tác vụ

Gửi yêu cầu biểu mẫu multipart và lưu id được trả về.
2

Thăm dò tác vụ

Gọi Truy xuất video HappyHorse cho đến khi statuscompleted, failed hoặc error.
3

Tải xuống kết quả

Khi tác vụ ở trạng thái completed, hãy gọi Truy xuất nội dung video HappyHorse để tải xuống tệp MP4.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

multipart/form-data
model
enum<string>
bắt buộc

HappyHorse model ID for this endpoint.

Tùy chọn có sẵn:
happyhorse-1.0,
happyhorse-1.1
Ví dụ:

"happyhorse-1.1"

prompt
string
bắt buộc

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

Ví dụ:

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

seconds
integer
mặc định:5

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

Phạm vi bắt buộc: 3 <= x <= 15
Ví dụ:

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.

Ví dụ:

"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://

Phản hồi

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

id
string
bắt buộc

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

Ví dụ:

"task_example"

object
string
bắt buộc

Object type. Video tasks return video.

Ví dụ:

"video"

model
string
bắt buộc

Model ID used for the task.

Ví dụ:

"happyhorse-1.1"

status
enum<string>
bắt buộc

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

Tùy chọn có sẵn:
queued,
in_progress,
completed,
failed,
error
Ví dụ:

"queued"

progress
integer
bắt buộc

Task progress as a coarse percentage.

Phạm vi bắt buộc: 0 <= x <= 100
Ví dụ:

0

created_at
integer
bắt buộc

Task creation time as a Unix timestamp in seconds.

Ví dụ:

1779938152

task_id
string

Compatibility alias for id when present.

Ví dụ:

"task_example"

completed_at
integer

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

Ví dụ:

1779938219

video_url
string

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

Ví dụ:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.

Lần sửa đổi cuối 9 tháng 9, 2026