Skip to main content
POST
Gunakan endpoint ini untuk membuat tugas video HappyHorse. API segera mengembalikan task ID, jadi simpan id yang dikembalikan dan lakukan polling pada tugas hingga mencapai status terminal. POST /v1/videos menggunakan multipart/form-data; kirim kontrol skalar sebagai form field dan gambar referensi sebagai input_reference file field.

Pilih mode input

Untuk referensi-ke-video, unggah 1-9 gambar referensi dengan mengulangi multipart field input_reference. CometAPI mengirim setiap file yang diunggah sebagai gambar referensi HappyHorse. Gunakan gambar JPEG, JPG, PNG, atau WEBP hingga 20 MB per gambar; untuk hasil terbaik, gunakan gambar dengan sisi terpendek setidaknya 400 px.

Atur durasi dan ukuran

Atur size ke nilai WxH yang tepat.

Alur tugas

1

Buat tugas

Kirim permintaan form multipart dan simpan id yang dikembalikan.
2

Polling tugas

Panggil Retrieve a HappyHorse video hingga status bernilai completed, failed, atau error.
3

Unduh hasil

Saat tugas berstatus completed, panggil Retrieve HappyHorse video content untuk mengunduh file MP4.

Otorisasi

Authorization
string
header
wajib

Bearer authentication. Use your CometAPI API key.

Body

multipart/form-data
model
enum<string>
wajib

HappyHorse model ID for this endpoint.

Opsi yang tersedia:
happyhorse-1.0,
happyhorse-1.1
Contoh:

"happyhorse-1.1"

prompt
string
wajib

Text prompt that describes the video to generate. For reference-image requests, combine the prompt with the uploaded reference image.

Contoh:

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

seconds
string

Requested clip duration in seconds. Use an integer from 3 through 15. Default is 5.

Contoh:

"3"

size
string

Output size as an exact WxH value. Use one of the documented size values for the selected HappyHorse model.

Contoh:

"1920x1080"

input_reference
file

Reference image file for reference-to-video. Required when using reference-to-video; repeat this multipart field to send additional reference images. CometAPI preserves upload order. Use JPEG, JPG, PNG, or WEBP images up to 20 MB each.

Respons

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

id
string
wajib

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

Contoh:

"task_example"

object
string
wajib

Object type. Video tasks return video.

Contoh:

"video"

model
string
wajib

Model ID used for the task.

Contoh:

"happyhorse-1.1"

status
enum<string>
wajib

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

Opsi yang tersedia:
queued,
in_progress,
completed,
failed,
error
Contoh:

"queued"

progress
integer
wajib

Task progress as a coarse percentage.

Rentang yang diperlukan: 0 <= x <= 100
Contoh:

0

created_at
integer
wajib

Task creation time as a Unix timestamp in seconds.

Contoh:

1779938152

task_id
string

Compatibility alias for id when present.

Contoh:

"task_example"

completed_at
integer

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

Contoh:

1779938219

video_url
string

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

Contoh:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.