跳转到主要内容
POST
使用此端点创建 Vidu 视频任务。Vidu Q3 模型可创建文生视频和图生视频任务。viduq4-preview 可创建图生视频和参考图生视频任务。API 会立即返回任务 ID,因此请存储返回的 id,并轮询任务直至其达到终止状态。 POST /v1/videos 使用 multipart/form-data。将标量控制项作为表单字段发送,并将参考图像作为 input_reference 字段发送。

选择输入模式

viduq4-preview 根据请求选择模式。一个不含参考音频的参考图像会创建图生视频任务。两个或更多参考图像,或者一个带有 reference_audios 的参考图像,会创建参考图生视频任务。 要确认 viduq3 或 viduq3-turbo 是否可供您的 API 密钥使用,请使用 列出可用模型.

使用参考图像

对于 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 个可公开访问的 MP3 片段 HTTPS URL,每个片段时长为 3–12 秒,并为每个片段重复一次 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日