跳轉到主要內容
POST
從文字或圖片建立 Veo 3.1 影片。API 會立即傳回任務 ID。儲存傳回的 id,以輪詢任務並下載完成的影片。 POST /v1/videos 使用 multipart/form-data。將控制項作為表單欄位傳送,並將圖片作為 input_reference 檔案欄位傳送。

選擇模型

選擇輸入模式

若要讓圖片產生動畫效果,請透過 input_reference 上傳一個檔案,並僅使用一次該欄位。圖片會設定開場畫面;prompt 則描述後續的動作和攝影機行為。

設定時長和尺寸

對於此與 OpenAI 相容的路由,請使用明確的整數 seconds 值設定時長,並使用 size 設定輸出尺寸。將兩個值都作為表單欄位傳送。 將 size 設為下列其中一種 WxH 值。

任務流程

1

建立任務

傳送 multipart 表單請求,並儲存傳回的 id。
2

輪詢任務

使用 Veo3 Retrieve 直到 status 為 completed、failed 或 error。
3

下載結果

當任務為 completed 時,從已完成的任務回應下載 MP4 檔案。

授權

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

主體

multipart/form-data
model
enum<string>
必填

Veo 3.1 model ID. Use veo3.1-fast for the default route or veo3.1 when you specifically need the standard model.

可用選項:
veo3.1-fast,
veo3.1
範例:

"veo3.1-fast"

prompt
string
必填

Text prompt for the video job.

範例:

"A paper kite floats above a field."

seconds
enum<integer>
預設值:4

Requested clip duration in whole seconds. Send 4, 6, or 8 as a form field.

可用選項:
4,
6,
8
範例:

4

size
string

Supported WxH size values: 1280x720, 720x1280, 1920x1080, 3840x2160. Default is 1280x720.

範例:

"1280x720"

input_reference
file

One image file that sets the opening frame for image-to-video. Send input_reference once with one file. Use prompt to describe the motion and camera behavior that follow.

回應

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.

範例:

"veo3.1-fast"

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.

最後修改於 2026年9月9日