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

# sora2 generate video

> create a task to generate video



## OpenAPI

````yaml post /ai/sa/video/generate
openapi: 3.1.0
info:
  title: OpenAPI definition
  version: v0
servers:
  - url: https://ai.pmock.com/api
    description: Generated server url
security: []
tags:
  - name: 开放-百度视频生成
    description: 开放-百度视频生成
  - name: 开放-Grok开放接口
    description: 开放-Grok开放接口
  - name: 开放-Gemini开放接口
    description: 开放-Gemini开放接口
  - name: 开放-AI对话开放接口
    description: 开放-AI对话开放接口
  - name: 开放-Sora2开放接口
    description: 开放-Sora2开放接口
  - name: 开放-模型列表接口
    description: 开放-模型列表接口
  - name: 开放-OpenAi开放接口
    description: 开放-OpenAi开放接口
  - name: 开放-业务相关接口
    description: 开放-业务相关接口
  - name: 开放-任务开放接口
    description: 开放-任务开放接口
paths:
  /ai/sa/video/generate:
    post:
      tags:
        - 开放-Sora2开放接口
      summary: sora2 generate video
      description: create a task to generate video
      operationId: videoGenerate
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Sora2VideoGenerateDTO'
        required: true
      responses:
        '200':
          description: OK
          content:
            '*/*':
              schema:
                $ref: '#/components/schemas/RTaskResultVO'
components:
  schemas:
    Sora2VideoGenerateDTO:
      type: object
      description: sora2 generate video request parameters
      properties:
        model:
          type: string
          description: Video generation model, default is sora-2
          enum:
            - sora-2
            - sora-2-pro
          example: sora-2
          title: sora-2; sora-2-pro
        prompt:
          type: string
          description: The prompt for generating videos, up to 5000 characters
          maxLength: 5000
          minLength: 0
        images:
          type: array
          description: >-
            The images used to generate videos can be URL arrays or empty,
            currently only supporting one image
          items:
            type: string
          maxItems: 1
          maxLength: 1
          minItems: 0
        orientation:
          type: string
          default: landscape
          description: Direction of video generation, default landscape
          enum:
            - landscape
            - portrait
          example: landscape
          title: 'landscape : landscape; portrait : portrait'
        size:
          type: string
          default: small
          description: >-
            Video generation size, default small, only sora-2-pro, size can be
            set large
          enum:
            - small
            - large
          example: small
          title: 'small : small; large : large'
        duration:
          type: string
          format: int32
          default: '10'
          description: >-
            The duration of video generation can only be 10 for sora-2, and 10,
            15, 25 for sora-2-pro, with a default of 10
          enum:
            - 10
            - 15
            - 25
          example: '10'
          title: '10 : 10; 15 : 15; 25 : 25'
        removeWatermark:
          type: boolean
          default: false
          description: Whether to remove watermark, default is false
        styleId:
          type: string
          default: anime
          description: style id for video generation,default is anime
          enum:
            - anime
            - selfie
            - golden
            - handheld
            - festive
            - retro
            - news
            - chaos
            - vintage
            - comic
            - kakalaka
            - sitcom
          example: anime
          title: >-
            anime : anime; selfie : selfie; golden : golden; handheld :
            handheld; festive : festive; retro : retro; news : news; chaos :
            chaos; vintage : vintage; comic : comic; kakalaka : kakalaka; sitcom
            : sitcom
        storyboard:
          type: boolean
          default: false
          description: >-
            whether to enable storyboard mode, if true, the prompt will be
            parsed as storyboard format
      required:
        - model
        - prompt
    RTaskResultVO:
      type: object
      description: Unified return structure for response results
      properties:
        code:
          type: integer
          format: int32
          description: Response status code
          example: 200
        message:
          type: string
          description: Response message
        data:
          $ref: '#/components/schemas/TaskResultVO'
          description: Response result
        traceId:
          type: string
          description: Response traceId
    TaskResultVO:
      type: object
      properties:
        taskId:
          type: string
          description: taskId

````