跳轉到主要內容
POST
使用此端點建立 Vidu 影片任務。Vidu Q3 模型可建立文字轉影片及圖片轉影片任務。viduq4-preview 可建立圖片轉影片及參考圖轉影片任務。API 會立即傳回任務 ID,因此請儲存傳回的 id,並輪詢任務直到其進入終止狀態。 POST /v1/videos 使用 multipart/form-data。將純量控制項作為表單欄位傳送,並將參考圖片作為 input_reference 欄位傳送。

選擇輸入模式

viduq4-preview 會根據請求選擇模式。一張未附參考音訊的參考圖片會建立圖片轉影片任務。兩張以上的參考圖片,或一張附帶 reference_audios 的參考圖片,會建立參考圖轉影片任務。 若要確認您的 API 金鑰是否可使用 viduq3 或 viduq3-turbo,請使用 列出可用模型.

使用參考圖片

針對 Q3 圖片轉影片,請透過 input_reference multipart 欄位上傳一張參考圖片。檔案大小上限為 20 MB。 圖片會引導所產生影片的構圖與外觀。請使用 Prompt 描述動作、攝影機行為,以及影片應保留的細節。 針對 viduq4-preview 圖片轉影片,請將一張圖片作為上傳檔案傳送,或在 input_reference 中提供可公開存取的 HTTPS URL。影片會從此圖片開始,並保留其長寬比。 針對 viduq4-preview 參考圖轉影片,請傳送 2–12 個可公開存取的 HTTPS 圖片 URL。每張圖片重複一次 input_reference,並在各自的欄位中傳送每個 URL。請使用 PNG、JPEG 或 WEBP 圖片。 在 Prompt 中,請依照請求中的順序參照參考圖片:@1 是第一張 input_reference 圖片,@2 是第二張,依此類推。例如:The pink car from @1 drives across the snowy hill from @2.

新增參考音訊

針對 viduq4-preview 參考圖轉影片,reference_audios 可新增語音參考。請傳送最多 3 個可公開存取、每個長度為 3–12 秒的 MP3 片段 HTTPS URL,並為每個片段重複一次 reference_audios。在同一請求中至少傳送一張 input_reference 圖片。

設定時長和尺寸

對於 Q3 模型,請將 size 設為下列其中一個 WxH 值。 對於 viduq4-preview,請將 size 設為下列其中一個 WxH 值。對於參考轉影片,size 會設定影格形狀。對於圖像轉影片,輸出會保留輸入圖像的長寬比。 viduq4-preview 影片包含生成的音訊軌。

任務流程

1

建立任務

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

輪詢任務

呼叫 擷取 Vidu 影片 ,直到 status 為 completed、failed 或 error。
3

下載結果

當任務為 completed 時,呼叫 擷取 Vidu 影片內容 以下載 MP4 檔案。

授權

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

主體

multipart/form-data
model
string
必填

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.

範例:

"viduq3-turbo"

prompt
string
必填

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.

範例:

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

範例:

"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://

回應

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

範例:

"viduq3-turbo"

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年10月27日