Skip to main content
POST
OpenAI video generations
用于创建异步视频生成任务。
  • 使用 Authorization: Bearer {API_KEY} 鉴权
  • 典型流程是先创建任务,再轮询 /v1/videos/{video_id},最后下载 /v1/videos/{video_id}/content
  • 首次响应通常只返回任务对象,不会直接返回最终视频文件
  • 长任务轮询更适合放在服务端或任务系统,不建议前端高频直连 provider

授权

Authorization
string
header
必填

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

请求体

multipart/form-data
model
string
必填

Video model name, for example sora-2.

示例:

"sora-2"

prompt
string
必填

Text prompt for the video.

示例:

"一只可爱的小猫在花园里玩耍"

size
enum<string>
默认值:720x1280

Video resolution.

可用选项:
720x1280,
1280x720
seconds
enum<string>

Video duration in seconds.

可用选项:
4,
8,
12
input_reference
file

Optional reference image file used as the first frame.

响应

Successful video task creation response

id
string
必填

Video task ID.

示例:

"video_123456789"

object
enum<string>
必填

Object type.

可用选项:
video
status
enum<string>
必填

Current task status.

可用选项:
pending,
in_progress,
completed,
failed
created_at
integer<int64>

Creation timestamp.

completed_at
integer<int64>

Completion timestamp.

model
string

Model used for generation.

progress
integer

Task progress percentage.

必填范围: 0 <= x <= 100
expires_at
integer<int64>

Expiration timestamp for the generated asset.

seconds
string

Video duration in seconds.

size
enum<string>

Video resolution.

可用选项:
720x1280,
1280x720
remixed_from_video_id
string

Source video ID when the task comes from remix.

error
object