> ## Documentation Index
> Fetch the complete documentation index at: https://docs.anyfast.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# sora-2-创建视频

> 使用 Sora 2 模型创建视频生成任务。支持文生视频和图生视频（通过 input_reference）。工作流程：创建任务 -> 查询状态 -> 下载视频。



## OpenAPI

````yaml zh/api-reference/model-api/openai/openapi/sora-2/openapi.yaml POST /v1/videos
openapi: 3.1.0
info:
  title: Sora 2 创建视频
  description: 通过 Anyfast API 创建 Sora 2 视频生成任务
  version: 1.0.0
servers:
  - url: https://www.anyfast.ai
security:
  - bearerAuth: []
paths:
  /v1/videos:
    post:
      summary: 创建视频生成任务
      description: >-
        使用 Sora 2 模型创建视频生成任务。支持文生视频和图生视频（通过 input_reference）。工作流程：创建任务 -> 查询状态
        -> 下载视频。
      operationId: createSora2Video
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  enum:
                    - sora-2
                  description: 视频生成模型 ID
                  example: sora-2
                prompt:
                  type: string
                  description: 视频内容的自然语言描述。包括镜头类型、主题、动作、场景、光照和所需的相机运动，以减少歧义。保持单一用途以获得最佳效果。
                  example: 一只猫在金色日落时分穿过向日葵田
                seconds:
                  type: string
                  enum:
                    - '4'
                    - '8'
                    - '12'
                  default: '4'
                  description: 视频时长（秒）
                  example: '12'
                size:
                  type: string
                  enum:
                    - 720x1280
                    - 1280x720
                    - 1024x1792
                    - 1792x1024
                  default: 720x1280
                  description: 输出分辨率，格式为宽度 x 高度
                  example: 1280x720
                input_reference:
                  type: string
                  format: binary
                  description: 可选的参考图像，用作第一帧。接受的 MIME 类型：image/jpeg、image/png、image/webp
                remix_video_id:
                  type: string
                  description: 先前完成的视频 ID（例如 video_...），用于重复使用其结构、动作和取景
                  example: video_69b131ea03548190925a6a06febf993b
      responses:
        '200':
          description: 任务已创建
          content:
            application/json:
              schema:
                type: object
                properties:
                  id:
                    type: string
                    description: 视频任务 ID
                    example: video_69b131ea03548190925a6a06febf993b
                  object:
                    type: string
                    example: video
                  model:
                    type: string
                    example: sora-2
                  status:
                    type: string
                    example: queued
                  progress:
                    type: integer
                    example: 0
                  created_at:
                    type: integer
                    example: 1773220330
                  seconds:
                    type: string
                    example: '12'
                  size:
                    type: string
                    example: 1280x720
        '401':
          description: 未授权
        '429':
          description: 超出速率限制
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````