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

# 生成视频

> 根据图像与描述词生成四个视频，该接口与midjourney生成图像接口交互方式一致，为**异步任务**

<Note>
  单次生成视频长度，与延续视频长度目前固定为5s。
</Note>


## OpenAPI

````yaml openapi/cn/sora.json POST /midjourney/video/submit
openapi: 3.1.0
info:
  title: Sora API DOCS
  version: 1.0.0
  description: TTAPI Sora API 接口服务，目前集成了市场上最为领先的视频大模型sora2。
servers:
  - url: https://api.ttapi.io
security: []
paths:
  /midjourney/video/submit:
    post:
      description: 根据图像与描述词生成四个视频，该接口与midjourney生成图像接口交互方式一致，为**异步任务**
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/videosubmitRequest'
      responses:
        '200':
          $ref: '#/components/responses/SuccessResponse'
        '400':
          $ref: '#/components/responses/400Response'
        '401':
          $ref: '#/components/responses/401Response'
      security:
        - CustomApiKey: []
components:
  schemas:
    videosubmitRequest:
      type: object
      properties:
        prompt:
          type: string
          description: 用于生成视频的提示词
        imageUrl:
          type: string
          description: 视频起始帧图片地址，必须是可以**网络访问的图片地址**
        endingUrl:
          type: string
          description: 视频结束帧图片地址，必须是可以**网络访问的图片地址**
        model:
          type: string
          example: fast
          description: 生成视频的速率模式,**目前只支持fast模式，** 可选值范围：fast
        manual:
          type: string
          description: 视频时长,可选值 low 低运动 high高运动
          default: low
        resolution:
          type: string
          description: 视频分辨率 <br/> **不同分辨率消耗quota不同**
          enum:
            - hd
            - sd
          default: sd
        bs:
          type: int
          enum:
            - '1'
            - '2'
            - '4'
          default: '4'
          description: 批量生成视频数量
        hookUrl:
          type: string
          description: >-
            回调通知地址，任务完成或失败将通过请地址进行通知，<a href="fetch"
            target="_self">通知数据结构</a>与fetch结构一致。如果未设置，则需要请求<a href="fetch"
            target="_self">fetch接口</a>进行查询
      required:
        - prompt
        - imageUrl
  responses:
    SuccessResponse:
      description: 请求成功
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: SUCCESS
              message:
                type: string
                example: success
              data:
                type: object
                example:
                  jobId: jobId
            required:
              - status
              - message
              - data
    400Response:
      description: 参数错误
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: '"prompt" cannot be empty.'
              data:
                type: object
            required:
              - status
              - message
    401Response:
      description: 授权失败
      content:
        application/json:
          schema:
            type: object
            properties:
              status:
                type: string
                example: FAILED
              message:
                type: string
                example: Wrong TT-API-KEY or email is not activated.
            required:
              - status
              - message
  securitySchemes:
    CustomApiKey:
      type: apiKey
      in: header
      name: TT-API-KEY
      description: >-
        请前往 <a href='https://dashboard.ttapi.io' target='_blank'>TTAPI 控制台</a>
        获取 API 密钥。

````