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

# /v1/videos

> 根据文本提示生成视频内容



## OpenAPI

````yaml POST /v1/videos
openapi: 3.1.0
info:
  title: TokenOps AI API
  description: TokenOps AI API 提供了强大的AI服务能力，包括聊天对话、Gemini模型集成等功能。
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://model-api.skyengine.com.cn
    description: TokenOps AI API 生产环境
security: []
paths:
  /v1/videos:
    post:
      summary: 生成视频
      description: 根据文本提示生成视频内容
      operationId: createVideo
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/CreateVideoFormRequest'
      responses:
        '200':
          description: 视频生成任务创建成功
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationResponse'
        '400':
          description: 客户端错误（包括请求参数错误、API密钥无效等）
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - OpenAIAuth: []
components:
  schemas:
    CreateVideoFormRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: 模型名称，如 sora-2
          example: sora-2
        prompt:
          type: string
          description: 文本提示
          example: 一只可爱的小猫在花园里玩耍
        size:
          type: string
          description: 视频尺寸
          enum:
            - 720x1280
            - 1280x720
          default: 720x1280
          example: 720x1280
        seconds:
          type: string
          description: 视频时长（秒），默认4秒, 可选值（4 / 8 / 12）
          example: '4'
        input_reference:
          type: string
          format: binary
          description: 可选的参考图片文件，作为视频的第一帧
    VideoGenerationResponse:
      type: object
      properties:
        id:
          type: string
          description: 生成任务ID
          example: video_123456789
        object:
          type: string
          enum:
            - video
          description: 对象类型
        created_at:
          type: integer
          format: int64
          description: 创建时间戳
          example: 1741570283
        model:
          type: string
          description: 使用的模型
          example: sora-2
        status:
          type: string
          enum:
            - pending
            - in_progress
            - completed
            - failed
          description: 状态
        progress:
          type: integer
          description: 完成百分比
          minimum: 0
          maximum: 100
        seconds:
          type: string
          description: 视频时长（秒）
        size:
          type: string
          description: 视频分辨率
          enum:
            - 720x1280
            - 1280x720
          example: 720x1280
        error:
          $ref: '#/components/schemas/OpenAIVideoError'
          description: 错误信息
    ErrorResponse:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/Status'
          description: 错误信息
    OpenAIVideoError:
      type: object
      properties:
        code:
          type: string
          description: 错误代码
        message:
          type: string
          description: 错误消息
        type:
          type: string
          description: 错误类型
    Status:
      type: object
      properties:
        code:
          type: integer
          description: 错误代码
        message:
          type: string
          description: 错误消息
        details:
          type: array
          description: 错误详情
          items:
            type: object
            additionalProperties: true
  securitySchemes:
    OpenAIAuth:
      type: http
      scheme: bearer
      description: >-
        OpenAI API密钥认证。在 `Authorization` HTTP Header 中包含您的 API-Key，格式为 `Bearer
        {API_KEY}`

````