Chuyển đến nội dung chính
POST
Sử dụng endpoint này để tạo tác vụ video Vidu. Các model Vidu Q3 tạo tác vụ text-to-video và image-to-video. viduq4-preview tạo tác vụ image-to-video và reference-to-video. API trả về ngay một ID tác vụ, vì vậy hãy lưu id được trả về và thăm dò tác vụ cho đến khi tác vụ đạt trạng thái kết thúc. POST /v1/videos sử dụng multipart/form-data. Gửi các tham số điều khiển vô hướng dưới dạng trường biểu mẫu và hình ảnh tham chiếu dưới dạng trường input_reference.

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

viduq4-preview chọn chế độ từ yêu cầu. Một hình ảnh tham chiếu không có audio tham chiếu sẽ tạo tác vụ image-to-video. Hai hoặc nhiều hình ảnh tham chiếu, hoặc một hình ảnh tham chiếu có reference_audios, sẽ tạo tác vụ reference-to-video. Để xác nhận rằng viduq3 hoặc viduq3-turbo khả dụng cho API key của bạn, hãy sử dụng Liệt kê các model khả dụng.

Sử dụng hình ảnh tham chiếu

Đối với image-to-video Q3, hãy tải lên một hình ảnh tham chiếu qua trường multipart input_reference. Tệp có thể có dung lượng tối đa 20 MB. Hình ảnh sẽ định hướng bố cục và diện mạo của video được tạo. Sử dụng prompt để mô tả chuyển động, hành vi của camera và các chi tiết mà video cần giữ lại. Đối với image-to-video viduq4-preview, hãy gửi một hình ảnh dưới dạng tệp được tải lên hoặc URL HTTPS có thể truy cập công khai trong input_reference. Video bắt đầu từ hình ảnh này và giữ nguyên tỷ lệ khung hình của hình ảnh. Đối với reference-to-video viduq4-preview, hãy gửi 2–12 URL hình ảnh HTTPS có thể truy cập công khai. Lặp lại input_reference một lần cho mỗi hình ảnh và gửi từng URL trong trường riêng. Sử dụng hình ảnh PNG, JPEG hoặc WEBP. Trong prompt, hãy tham chiếu đến các hình ảnh tham chiếu theo thứ tự của chúng trong yêu cầu: @1 là hình ảnh input_reference đầu tiên, @2 là hình ảnh thứ hai, v.v. Ví dụ: The pink car from @1 drives across the snowy hill from @2.

Thêm audio tham chiếu

Đối với reference-to-video viduq4-preview, reference_audios thêm tham chiếu giọng nói. Gửi tối đa 3 URL HTTPS có thể truy cập công khai của các đoạn MP3, mỗi đoạn dài 3–12 giây, và lặp lại reference_audios một lần cho mỗi đoạn. Gửi ít nhất một hình ảnh input_reference trong cùng yêu cầu.

Thiết lập thời lượng và kích thước

Đối với các mô hình Q3, hãy đặt size thành một trong các giá trị WxH bên dưới. Đối với viduq4-preview, hãy đặt size thành một trong các giá trị WxH bên dưới. Đối với reference-to-video, size đặt hình dạng khung hình. Đối với image-to-video, đầu ra giữ nguyên tỷ lệ khung hình của ảnh đầu vào. viduq4-preview video bao gồm một bản âm thanh được tạo.

Quy trình 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ụ

Gọi Truy xuất video Vidu cho đến khi status là completed, failed hoặc error.
3

Tải kết quả xuống

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

Ủy quyền

Authorization
string
header
bắt buộc

Bearer authentication. Use your CometAPI API key.

Nội dung

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

Vidu model ID for this route: viduq3 or viduq3-turbo for text-to-video and image-to-video, or viduq4-preview for image-to-video and reference-to-video. Choose an available model from the Models page.

Ví dụ:

"viduq3-turbo"

prompt
string
bắt buộc

Text prompt that describes the video to generate. For image-to-video, describe the motion and camera behavior that should animate the reference image. For viduq4-preview reference-to-video, refer to reference images as @1, @2, and so on, in the order of the input_reference fields. Up to 5000 characters for viduq4-preview.

Ví dụ:

"An astronaut walks through soft blue fog with a slow cinematic camera move."

seconds
string

Requested clip duration in seconds, sent as an integer string. Use 1 through 16 for viduq3 and viduq3-turbo, or 3 through 16 for viduq4-preview. Default is 5.

Ví dụ:

"1"

size
string

Output size as WxH. Supported WxH size values for viduq3 and viduq3-turbo: 960x528, 1280x720, 1920x1080. Supported WxH size values for viduq4-preview: 1280x720, 720x1280, 960x960, 1104x816, 816x1104. Default is 1280x720. For viduq4-preview reference-to-video, size sets the frame shape. For viduq4-preview image-to-video, the output keeps the aspect ratio of the input image.

input_reference

Reference images. For Q3 image-to-video, upload one image file up to 20 MB. For viduq4-preview image-to-video, send one image file or one publicly accessible HTTPS image URL. For viduq4-preview reference-to-video, send 2-12 publicly accessible HTTPS image URLs by repeating input_reference once per image. Use PNG, JPEG, or WEBP images. Omit this field for text-to-video.

reference_audios

Voice references for viduq4-preview reference-to-video. Send up to 3 publicly accessible HTTPS URLs of MP3 clips, each 3-12 seconds long, by repeating reference_audios once per clip. Send at least one input_reference image in the same request.

Pattern: ^https://

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, such as viduq3-turbo or viduq4-preview.

Ví dụ:

"viduq3-turbo"

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.

Lần sửa đổi cuối 27 tháng 10, 2026