Skip to main content
POST
Użyj tego endpointu, aby utworzyć zadanie filmu HappyHorse. API natychmiast zwraca ID zadania, więc zapisz zwrócone id i odpytuj zadanie, aż osiągnie status końcowy. POST /v1/videos używa multipart/form-data; przekaż kontrolki skalarne jako pola formularza, a obrazy referencyjne jako pola plików input_reference.

Wybierz tryb wejścia

W przypadku reference-to-video prześlij 1–9 obrazów referencyjnych, powtarzając pole multipart input_reference. CometAPI wysyła każdy przesłany plik jako obraz referencyjny HappyHorse. Używaj obrazów JPEG, JPG, PNG lub WEBP o rozmiarze do 20 MB każdy; aby uzyskać najlepsze rezultaty, używaj obrazów, których krótszy bok ma co najmniej 400 px.

Ustaw czas trwania i rozmiar

Ustaw size na dokładną wartość WxH.

Przebieg zadania

1

Utwórz zadanie

Wyślij żądanie formularza multipart i zapisz zwrócone id.
2

Odpytuj zadanie

Wywołuj Pobierz film HappyHorse, aż status będzie równy completed, failed lub error.
3

Pobierz wynik

Gdy zadanie ma status completed, wywołaj Pobierz zawartość filmu HappyHorse, aby pobrać plik MP4.

Autoryzacje

Authorization
string
header
wymagane

Bearer authentication. Use your CometAPI API key.

Treść

multipart/form-data
model
enum<string>
wymagane

HappyHorse model ID for this endpoint.

Dostępne opcje:
happyhorse-1.0,
happyhorse-1.1
Przykład:

"happyhorse-1.1"

prompt
string
wymagane

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

Przykład:

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

Przykład:

"3"

size
string

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

Przykład:

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

Odpowiedź

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

id
string
wymagane

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

Przykład:

"task_example"

object
string
wymagane

Object type. Video tasks return video.

Przykład:

"video"

model
string
wymagane

Model ID used for the task.

Przykład:

"happyhorse-1.1"

status
enum<string>
wymagane

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

Dostępne opcje:
queued,
in_progress,
completed,
failed,
error
Przykład:

"queued"

progress
integer
wymagane

Task progress as a coarse percentage.

Wymagany zakres: 0 <= x <= 100
Przykład:

0

created_at
integer
wymagane

Task creation time as a Unix timestamp in seconds.

Przykład:

1779938152

task_id
string

Compatibility alias for id when present.

Przykład:

"task_example"

completed_at
integer

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

Przykład:

1779938219

video_url
string

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

Przykład:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.