Skip to main content
POST
使用此 Beta 端点创建文本转视频或视频转视频任务。API 会立即返回任务 ID,因此请存储返回的 id,并轮询任务,直到其达到终止状态。 选择与输入模式匹配的请求内容类型。将文本转视频控件作为 multipart/form-data 字段发送。将参考视频编辑作为 application/json 请求体发送。

选择输入模式

文本转视频示例使用 model=omni-fast。视频转视频示例使用 model=omni-fast-v2v。使用 列出可用模型 以确认模型 ID 对您的 API 密钥可见。

编辑参考视频

对于视频转视频,请将本地 MP4 文件编码为 base64,并在编码后的字节前添加 data:video/mp4;base64, 前缀。在 video 字段中发送完整的数据 URL。 prompt 中描述请求的更改。还请说明结果应保留的主体、对象、构图或运动。代码示例选择器包含 Shell、Python 和 JavaScript 示例,这些示例从工作目录读取 reference.mp4 此请求结构涵盖内联 MP4 数据 URL。它不定义 URL 输入、其他视频容器格式或文件大小限制。

设置时长、比例和分辨率

Omni 被标记为 Beta 版,因为生成稳定性可能因输入和所选路由而异。请保持首次请求较小,然后检查完成的视频,再依赖特定的渲染时长或帧尺寸。 由于此端点处于 Beta 阶段,请将 aspect_ratioresolution 视为生成偏好,并在依赖最终像素前验证下载的 MP4。

任务流程

1

创建任务

使用所选输入模式对应的内容类型发送请求,并存储返回的 id
2

轮询任务

调用 检索 Omni 视频 直到 statuscompletedfailed
3

下载结果

当任务为 completed 时,调用 检索 Omni 视频内容 以下载 MP4 文件。

授权

Authorization
string
header
必填

Bearer authentication. Use your CometAPI API key.

请求体

model
string
必填

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

示例:

"omni-fast"

prompt
string
必填

Text prompt that describes the video to generate.

示例:

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

seconds
string

Requested clip duration in seconds. The completed video can use a different duration.

示例:

"4"

aspect_ratio
enum<string>
默认值: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.

可用选项:
16:9,
9:16,
1:1
示例:

"16:9"

resolution
string

Output resolution preference. Start with 720p. A request for 1080p can render at 720p.

示例:

"720p"

响应

200 - application/json

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

示例:

"omni-fast"

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.