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

# Create video task

> Request format, responses, and capability boundaries.

`POST /v1/videos`

Provide `model` and `prompt`, plus supported `seconds`, `size`, or a reference image. The executing plugin interprets JSON/multipart. Upload files through multipart `input_reference`.

The current host returns HTTP 200 and a public task `id`, not necessarily a completed result. Save the ID and query status; never POST again as part of polling. A retained protocol does not prove upstream availability, particularly for the discontinued OpenAI Sora service.

[Integration guide and runnable example](/en/guides/video-generation)

[简体中文](/zh/api-reference/videos-create)


## OpenAPI

````yaml openapi/relay.json POST /v1/videos
openapi: 3.0.3
info:
  title: API — Core inference API
  version: 0.5.0
  description: >-
    面向接入的精选规范，不是全部管理或供应商接口。 / Curated integration specification, not the entire
    management or provider API.
  license:
    name: AGPL-3.0-or-later
servers:
  - url: https://gateway.example.com
    description: >-
      Example only; replace with your gateway origin and optional path prefix,
      without /v1.
security:
  - BearerAuth: []
paths:
  /v1/videos:
    post:
      summary: 创建视频任务 / Create video task
      description: >-
        常用接入字段；能力取决于模型、渠道与部署。 / Common integration fields; support depends on
        the model, channel, and deployment.
      operationId: POSTVideosCreate
      requestBody:
        required: true
        content:
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoCreateMultipart'
          application/json:
            schema:
              $ref: '#/components/schemas/VideoCreateJSON'
      responses:
        '200':
          description: 接受任务，不代表生成完成 / Task accepted, not necessarily completed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Video'
              example:
                id: task_example
                object: video
                model: YOUR_MODEL_ID
                status: queued
                progress: 0
                created_at: 1700000000
        '400':
          description: 请求参数错误 / Invalid request
        '401':
          description: 身份校验失败 / Authentication failed
        '403':
          description: 访问被拒绝 / Access denied
        '404':
          description: 接口或资源不存在 / Endpoint or resource not found
        '410':
          description: 内容已不可用 / Content no longer available
        '429':
          description: 请求被限流或受配额限制 / Rate or quota restriction
        '500':
          description: 网关或上游错误 / Gateway or upstream error
        '502':
          description: 内容代理或上游失败 / Content proxy or upstream failure
        '503':
          description: 服务暂不可用 / Service unavailable
        default:
          description: 其他网关或上游错误；格式可能不同 / Other gateway or upstream error; shape may vary
components:
  schemas:
    VideoCreateMultipart:
      type: object
      properties:
        model:
          type: string
          description: >-
            当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting
            this endpoint
          example: YOUR_MODEL_ID
        prompt:
          type: string
          description: >-
            任务描述；遵循模型的长度和内容要求 / Task description; follow model length and
            content requirements
        seconds:
          type: string
          description: >-
            请求时长，单位秒；使用插件和模型允许的值，不以宿主安全上限作为模型能力 / Duration in seconds; use
            plugin/model values, not the host safety ceiling
          example: '4'
        size:
          type: string
          description: 模型支持的宽x高 / Model-supported widthxheight
          example: 1280x720
        input_reference:
          type: string
          description: >-
            可选参考图片文件，格式与尺寸需模型支持 / Optional reference image file; format and
            dimensions must be supported
          format: binary
      required:
        - model
        - prompt
    VideoCreateJSON:
      type: object
      properties:
        model:
          type: string
          description: >-
            当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting
            this endpoint
          example: YOUR_MODEL_ID
        prompt:
          type: string
          description: >-
            任务描述；遵循模型的长度和内容要求 / Task description; follow model length and
            content requirements
        seconds:
          type: string
          description: >-
            请求时长，单位秒；使用插件和模型允许的值，不以宿主安全上限作为模型能力 / Duration in seconds; use
            plugin/model values, not the host safety ceiling
          example: '4'
        size:
          type: string
          description: 模型支持的宽x高 / Model-supported widthxheight
          example: 1280x720
        input_reference:
          type: string
          description: >-
            可选图片 URL/data URL，具体形式由插件决定 / Optional image URL/data URL; exact
            form depends on plugin
      required:
        - model
        - prompt
    Video:
      type: object
      properties:
        id:
          type: string
          description: >-
            网关公开任务 ID，后续查询/下载使用此值 / Public gateway task ID; use for
            retrieval/download
          example: task_example
        object:
          type: string
          example: video
        model:
          type: string
          description: >-
            当前密钥可用且支持此接口的模型 ID / Model ID available to the key and supporting
            this endpoint
          example: YOUR_MODEL_ID
        status:
          type: string
          description: >-
            以状态判断完成；unknown 必须单独处理 / Determine completion from status; handle
            unknown separately
          enum:
            - queued
            - in_progress
            - completed
            - failed
            - unknown
        progress:
          type: integer
          description: 进度提示，不等同于完成保证 / Progress hint, not proof of completion
        created_at:
          type: integer
          description: Unix 秒 / Unix seconds
        completed_at:
          type: integer
          description: 完成时间，可省略 / Completion timestamp; may be omitted
        expires_at:
          type: integer
          description: 渠道可能提供的过期时间 / Optional expiry from channel
        seconds:
          type: string
        size:
          type: string
        error:
          type: object
          properties:
            code:
              type: string
            message:
              type: string
        metadata:
          type: object
      required:
        - id
        - object
        - model
        - status
        - progress
        - created_at
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: 模型调用 API Key，不是控制台登录凭据 / Model API key, not console login credentials

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.