Skip to main content
POST
このエンドポイントを使用して HappyHorse の動画タスクを作成します。API はすぐにタスク ID を返すため、返された id を保存し、タスクが終了ステータスに到達するまでポーリングしてください。 POST /v1/videosmultipart/form-data を使用します。スカラー制御はフォームフィールドとして渡し、参照画像は input_reference ファイルフィールドとして渡します。

入力モードを選択する

参照画像から動画の場合は、input_reference の multipart フィールドを繰り返して、1~9 枚の参照画像をアップロードします。CometAPI はアップロードされた各ファイルを HappyHorse の参照画像として送信します。各画像は 20 MB までの JPEG、JPG、PNG、または WEBP を使用できます。より良い結果を得るには、短辺が少なくとも 400 px の画像を使用してください。

長さとサイズを設定する

size は正確な WxH の値に設定してください。

タスクの流れ

1

タスクを作成する

multipart フォームリクエストを送信し、返された id を保存します。
2

タスクをポーリングする

statuscompletedfailed、または error になるまで HappyHorse 動画を取得する を呼び出します。
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 reference-image requests, combine the prompt with the uploaded reference image.

:

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

:

"3"

size
string

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

:

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

レスポンス

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.