Skip to main content
POST
使用此端点可以从文本,或从文本加一张参考图片,启动一个 Sora 渲染任务。API 会立即返回一个 video id,而不会等待渲染完成。

从最小可用任务开始

  • 使用 sora-2 以更快地迭代,或者在输出质量比速度更重要时使用 sora-2-pro
  • 首次请求时将 seconds 保持为 4
  • 除非你明确需要竖屏输出,否则从 size: 1280x720 开始
  • 最多上传一张参考图片

时长和尺寸

Sora 要求 size 字段必须采用精确的 WxH 形式。像 720p 这样的分辨率标记以及像 16:9 这样的比例标签,在此端点上都不是有效的 Sora size 值。

端到端流程

1

创建渲染任务

发送 modelpromptsecondssize,然后保存返回的 id
2

轮询直到任务完成

调用 Retrieve Video,直到状态变为 completedfailed
3

下载结果

当渲染完成后,使用 Retrieve Video Content 获取文件。

仍然适用的 Sora 行为

OpenAI 在 Videos API 中记录了相同的 create -> retrieve -> download 流程。在 CometAPI 上,你保留 Sora 的请求结构,但使用 CometAPI 的 base URL 和 key。完成后的下载 URL 是临时的,因此如果你需要长期保留,请将已完成的资源复制到你自己的存储中。

授权

Authorization
string
header
必填

Bearer token authentication. Use your CometAPI key.

请求体

multipart/form-data
prompt
string
必填

Text prompt that describes the video you want to create.

示例:

"A paper airplane glides across a desk."

model
string
默认值:sora-2

Sora model ID. Choose an available model from the Models page.

示例:

"sora-2"

seconds
enum<string>
默认值:4

Clip duration in seconds. Use 4, 8, 12, 16, or 20.

可用选项:
4,
8,
12,
16,
20
示例:

"4"

size
enum<string>
默认值:1280x720

Output resolution formatted as width x height. Use 1280x720 or 720x1280 for standard Sora output. Use 1792x1024 or 1024x1792 with a Pro model when you need larger Pro output.

可用选项:
720x1280,
1280x720,
1024x1792,
1792x1024
示例:

"1280x720"

input_reference
file

Optional reference image uploaded as a file. The image should match the target size you request.

响应

200 - application/json

Video job accepted.

created_at
integer
必填
id
string
必填
model
string
必填
object
string
必填
progress
integer
必填
seconds
string
必填
size
string
必填
status
string
必填