Skip to main content
POST
cURL
Sử dụng endpoint beta này để tạo một tác vụ video Omni. 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. Beta POST /v1/videos sử dụng multipart/form-data; truyền các tham số điều khiển dạng scalar dưới dạng form field.

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

Sử dụng model=omni-fast cho trang này.

Đặt thời lượng, tỷ lệ và độ phân giải

Omni được đánh dấu beta vì độ ổn định khi tạo có thể thay đổi tùy theo đầu vào và route được chọn. Hãy giữ yêu cầu đầu tiên ở mức nhỏ, sau đó kiểm tra video đã hoàn tất trước khi dựa vào một thời lượng render hoặc kích thước khung hình cụ thể. Vì endpoint này đang ở beta, hãy xem aspect_ratioresolution là các tùy chọn ưu tiên khi tạo và xác minh tệp MP4 đã tải xuống trước khi phụ thuộc vào số pixel cuối cùng.

Luồng tác vụ

1

Tạo tác vụ

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

Thăm dò tác vụ

Gọi Truy xuất một video Omni cho đến khi statuscompleted hoặc failed.
3

Tải xuống kết quả

Khi tác vụ ở trạng thái completed, hãy gọi Truy xuất nội dung video Omni để tải xuống tệp MP4.

Ủ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

Omni model ID for this endpoint. Use omni-fast for text-to-video.

Tùy chọn có sẵn:
omni-fast
Ví dụ:

"omni-fast"

prompt
string
bắt buộc

Text prompt that describes the video to generate.

Ví dụ:

"Ocean waves rolling onto a sandy beach at golden hour"

seconds
string
mặc định:4

Requested clip duration in seconds. Start with 4 while this endpoint is beta.

Ví dụ:

"4"

aspect_ratio
enum<string>
mặc định:16:9

Output aspect ratio preference. 16:9 and 9:16 are the most predictable; 1:1 can be accepted but may render as landscape.

Tùy chọn có sẵn:
16:9,
9:16,
1:1
Ví dụ:

"16:9"

resolution
string

Output resolution preference. Start with 720p. 1080p can be accepted but current production output may normalize to 720p.

Ví dụ:

"720p"

Phản hồi

200 - application/json

Task accepted. 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ụ:

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