Skip to main content
POST
Verwenden Sie diesen Endpunkt, um eine HappyHorse-Videoaufgabe zu erstellen. Die API gibt sofort eine Aufgaben-ID zurück. Speichern Sie daher die zurückgegebene id und rufen Sie die Aufgabe ab, bis sie einen Endstatus erreicht. POST /v1/videos verwendet multipart/form-data; übergeben Sie skalare Steuerparameter als Formularfelder und Referenzbilder als input_reference-Dateifelder.

Einen Eingabemodus auswählen

Für Referenz-zu-Video laden Sie 1–9 Referenzbilder hoch, indem Sie das Multipart-Feld input_reference wiederholen. CometAPI sendet jede hochgeladene Datei als HappyHorse-Referenzbild. Verwenden Sie JPEG-, JPG-, PNG- oder WEBP-Bilder mit bis zu 20 MB pro Bild; für die besten Ergebnisse verwenden Sie Bilder, deren kürzere Seite mindestens 400 px hat.

Dauer und Größe festlegen

Setzen Sie size auf einen exakten WxH-Wert.

Aufgabenablauf

1

Aufgabe erstellen

Senden Sie die Multipart-Formularanfrage und speichern Sie die zurückgegebene id.
2

Aufgabe abfragen

Rufen Sie Ein HappyHorse-Video abrufen auf, bis status den Wert completed, failed oder error hat.
3

Ergebnis herunterladen

Wenn die Aufgabe completed ist, rufen Sie HappyHorse-Videoinhalt abrufen auf, um die MP4-Datei herunterzuladen.

Autorisierungen

Authorization
string
header
erforderlich

Bearer authentication. Use your CometAPI API key.

Body

multipart/form-data
model
enum<string>
erforderlich

HappyHorse model ID for this endpoint.

Verfügbare Optionen:
happyhorse-1.0,
happyhorse-1.1
Beispiel:

"happyhorse-1.1"

prompt
string
erforderlich

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

Beispiel:

"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.

Beispiel:

"3"

size
string

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

Beispiel:

"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.

Antwort

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

id
string
erforderlich

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

Beispiel:

"task_example"

object
string
erforderlich

Object type. Video tasks return video.

Beispiel:

"video"

model
string
erforderlich

Model ID used for the task.

Beispiel:

"happyhorse-1.1"

status
enum<string>
erforderlich

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

Verfügbare Optionen:
queued,
in_progress,
completed,
failed,
error
Beispiel:

"queued"

progress
integer
erforderlich

Task progress as a coarse percentage.

Erforderlicher Bereich: 0 <= x <= 100
Beispiel:

0

created_at
integer
erforderlich

Task creation time as a Unix timestamp in seconds.

Beispiel:

1779938152

task_id
string

Compatibility alias for id when present.

Beispiel:

"task_example"

completed_at
integer

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

Beispiel:

1779938219

video_url
string

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

Beispiel:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.