官方 API
创建视频
使用 POST /v1/videos 通过文本 Prompt 或参考图片创建 Sora 2 视频生成任务,然后通过任务 ID 轮询状态并获取结果。
POST
Create a Sora video job
使用此端点可通过文本,或通过文本加一张参考图片,启动新的 Sora 渲染任务。API 会立即返回一个视频 id,而不会等待渲染完成。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
从最小可用任务开始
- 使用
sora-2以获得更快的迭代速度,或在输出质量比速度更重要时使用sora-2-pro - 首次请求将
seconds保持为4 - 除非你明确需要竖屏输出,否则从
size: 1280x720开始 - 最多上传一张参考图片
端到端流程
轮询直到任务完成
调用 Retrieve Video,直到状态变为
completed 或 failed。下载或重混结果
渲染完成后,使用 Retrieve Video Content 获取文件。如果你想要有针对性的变体,可对已完成的结果使用 Remix Video。
仍然适用的 Sora 行为
OpenAI 在 Videos API 中记录了相同的 create -> retrieve -> download 流程。在 CometAPI 上,你可以保留 Sora 的请求结构,但要使用 CometAPI 的 base URL 和 key。完成后的下载 URL 是临时的,因此如果你需要长期保留,请将已完成的资源复制到你自己的存储中。授权
Bearer token authentication. Use your CometAPI key.
请求体
multipart/form-data
Text prompt that describes the video you want to create.
示例:
"A paper airplane glides across a desk."
Sora model ID. Choose a current model from the Models page.
示例:
"sora-2"
Clip duration in seconds.
可用选项:
4, 8, 12 示例:
"4"
Output resolution formatted as width x height.
可用选项:
720x1280, 1280x720, 1024x1792, 1792x1024 示例:
"1280x720"
Optional reference image uploaded as a file. The image should match the target size you request.