跳转到主要内容
POST
/
v1
/
videos
OpenAI video generations
curl --request POST \
  --url http://sandbox.mintlify.com/v1/videos \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: multipart/form-data' \
  --form model=sora-2 \
  --form 'prompt=一只可爱的小猫在花园里玩耍' \
  --form size=720x1280 \
  --form seconds=4 \
  --form input_reference='@example-file'
{
  "id": "video_123456789",
  "object": "video",
  "created_at": 1741570283,
  "model": "sora-2",
  "status": "pending",
  "progress": 50,
  "seconds": "4",
  "size": "720x1280",
  "error": {
    "code": "<string>",
    "message": "<string>",
    "type": "<string>"
  }
}
用于创建异步视频生成任务。
  • 使用 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