Skip to main content
POST
生成视频

Authorizations

Authorization
string
header
required

OpenAI API密钥认证。在 Authorization HTTP Header 中包含您的 API-Key,格式为 Bearer {API_KEY}

Body

multipart/form-data
model
string
required

模型名称,如 sora-2

Example:

"sora-2"

prompt
string
required

文本提示

Example:

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

size
enum<string>
default:720x1280

视频尺寸

Available options:
720x1280,
1280x720
Example:

"720x1280"

seconds
string

视频时长(秒),默认4秒, 可选值(4 / 8 / 12)

Example:

"4"

input_reference
file

可选的参考图片文件,作为视频的第一帧

Response

视频生成任务创建成功

id
string

生成任务ID

Example:

"video_123456789"

object
enum<string>

对象类型

Available options:
video
created_at
integer<int64>

创建时间戳

Example:

1741570283

model
string

使用的模型

Example:

"sora-2"

status
enum<string>

状态

Available options:
pending,
in_progress,
completed,
failed
progress
integer

完成百分比

Required range: 0 <= x <= 100
seconds
string

视频时长(秒)

size
enum<string>

视频分辨率

Available options:
720x1280,
1280x720
Example:

"720x1280"

error
object

错误信息