Skip to main content
POST
cURL
Sử dụng endpoint này để bắt đầu một tác vụ video Veo 3.1. API trả về task ID ngay lập tức, vì vậy hãy lưu id được trả về và thăm dò tác vụ cho đến khi nó đạt trạng thái kết thúc. POST /v1/videos sử dụng multipart/form-data; truyền các điều khiển vô hướng dưới dạng form field và đầu vào media dưới dạng file field input_reference.

Chọn một model

Chọn chế độ đầu vào

Đặt thời lượng và kích thước

Đối với tuyến tương thích OpenAI, dùng seconds cho thời lượng và size cho kích thước đầu ra. Gửi các giá trị dưới dạng form field. Đặt size thành một trong các giá trị WxH bên dưới.

Luồng tác vụ

1

Tạo tác vụ

Gửi yêu cầu biểu mẫu multipart và lưu id được trả về.
2

Thăm dò tác vụ

Sử dụng Veo3 Retrieve cho đến khi statuscompleted, failed, hoặc error.
3

Tải xuống kết quả

Khi tác vụ ở trạng thái completed, hãy tải tệp MP4 xuống từ phản hồi tác vụ đã hoàn tất.

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

multipart/form-data
model
enum<string>
bắt buộc

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

Tùy chọn có sẵn:
veo3.1-fast,
veo3.1
Ví dụ:

"veo3.1-fast"

prompt
string
bắt buộc

Text prompt for the video job.

Ví dụ:

"A paper kite floats above a field."

seconds
enum<string>
mặc định:4

Requested clip duration. Use 4, 6, or 8. Send the value as a form field string.

Tùy chọn có sẵn:
4,
6,
8
Ví dụ:

"4"

size
string

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

Ví dụ:

"1280x720"

input_reference
file

Optional first-frame image file for image-to-video.

Phản hồi

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

id
string
bắt buộc

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

Ví dụ:

"task_example"

object
string
bắt buộc

Object type. Video tasks return video.

Ví dụ:

"video"

model
string
bắt buộc

Model ID used for the task.

Ví dụ:

"veo3.1-fast"

status
enum<string>
bắt buộc

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

Tùy chọn có sẵn:
queued,
in_progress,
completed,
failed,
error
Ví dụ:

"queued"

progress
integer
bắt buộc

Task progress as a coarse percentage.

Phạm vi bắt buộc: 0 <= x <= 100
Ví dụ:

0

created_at
integer
bắt buộc

Task creation time as a Unix timestamp in seconds.

Ví dụ:

1779938152

task_id
string

Compatibility alias for id when present.

Ví dụ:

"task_example"

completed_at
integer

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

Ví dụ:

1779938219

video_url
string

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

Ví dụ:

"<temporary-video-url>"

error
object

Failure details. This field appears when the task fails.