跳转到主要内容
POST
/
v1
/
videos
Create a Sora video job
curl --request POST \
  --url https://api.cometapi.com/v1/videos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form 'prompt=A paper airplane glides across a desk.' \
  --form input_reference='@example-file'
{
  "created_at": 1773296991,
  "id": "video_69b25d5f467c81908733a56bc236b4df",
  "model": "sora-2",
  "object": "video",
  "progress": 0,
  "seconds": "4",
  "size": "1280x720",
  "status": "queued"
}
使用此端点可通过文本,或通过文本加一张参考图片,启动新的 Sora 渲染任务。API 会立即返回一个视频 id,而不会等待渲染完成。

从最小可用任务开始

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

端到端流程

1

创建渲染任务

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

轮询直到任务完成

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

下载或重混结果

渲染完成后,使用 Retrieve Video Content 获取文件。如果你想要有针对性的变体,可对已完成的结果使用 Remix Video

仍然适用的 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 a current model from the Models page.

示例:

"sora-2"

seconds
enum<string>
默认值:4

Clip duration in seconds.

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

"4"

size
enum<string>
默认值:1280x720

Output resolution formatted as width x height.

可用选项:
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
必填