# Generate video pro

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/video/sora-pro:
    post:
      summary: Generate video pro
      deprecated: false
      description: Submit a text/image-to-video task, deduct credits, and return taskId.
      tags:
        - Sora 2 API/Video
        - Video
      parameters: []
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GenerateVideoRequest'
            examples:
              textToVideo:
                value:
                  model: sora-2
                  prompt: >-
                    A cinematic shot of a futuristic city at sunset, captured in
                    4K.
                  aspectRatio: '9:16'
                summary: Text-to-video
              imageToVideo:
                value:
                  model: sora-2-pro
                  prompt: Turn this image into a dynamic 15s video
                  imageData: data:image/png;base64,iVBORw0KGgoAAA...
                  aspectRatio: '16:9'
                summary: Image-to-video
      responses:
        '200':
          description: Always returns HTTP 200 with code indicating success or failure.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GenerateVideoResponse'
              examples:
                success:
                  summary: Success
                  value:
                    code: 0
                    message: ok
                    data:
                      id: task_1234567890
                unauthorized:
                  summary: Auth failed
                  value:
                    code: 401
                    message: Unauthorized
                invalidModel:
                  summary: Invalid model
                  value:
                    code: -1
                    message: Invalid model parameter...
                invalidImageData:
                  summary: Invalid image data
                  value:
                    code: -1
                    message: Invalid image data format
                insufficientCredits:
                  summary: Insufficient credits
                  value:
                    code: -1
                    message: Insufficient credits
                vipRequired:
                  summary: VIP required
                  value:
                    code: 403
                    message: VIP membership required for remix features
                internalError:
                  summary: Internal error
                  value:
                    code: -1
                    message: Video generation failed
          headers: {}
          x-apifox-name: ''
      security: []
      x-apifox-folder: Sora 2 API/Video
      x-apifox-status: released
      x-run-in-apifox: https://app.apifox.com/web/project/7601215/apis/api-418710829-run
components:
  schemas:
    GenerateVideoRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: sora-2 or sora-2-pro.
          enum:
            - sora-2
            - sora-2-pro
        prompt:
          type: string
          description: Generation prompt.
        imageData:
          type: string
          description: Base64 data URL, prefixed with data:image/*;base64,.
        url:
          type: string
          description: Legacy image URL.
        aspectRatio:
          type: string
          description: Aspect ratio.
          enum:
            - '9:16'
            - '16:9'
        isPublic:
          type: boolean
          description: Whether to display publicly.
          default: true
        remixTargetId:
          type: string
          description: Target video pid for continuation (VIP only).
        characters:
          type: array
          description: Character control array (VIP only).
          items:
            $ref: '#/components/schemas/CharacterItem'
      x-apifox-orders:
        - model
        - prompt
        - imageData
        - url
        - aspectRatio
        - isPublic
        - remixTargetId
        - characters
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    CharacterItem:
      type: object
      properties:
        url:
          type: string
          description: Direct link to character video.
        timestamps:
          type: string
          description: Range string in "start,end" format.
      required:
        - url
        - timestamps
      x-apifox-orders:
        - url
        - timestamps
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
    GenerateVideoResponse:
      type: object
      properties:
        code:
          type: integer
        message:
          type: string
        data:
          type: object
          properties:
            id:
              type: string
              description: Task ID.
          x-apifox-orders:
            - id
          x-apifox-ignore-properties: []
      x-apifox-orders:
        - code
        - message
        - data
      x-apifox-ignore-properties: []
      x-apifox-folder: ''
  securitySchemes:
    bearerAuth:
      type: jwt
      scheme: bearer
      bearerFormat: JWT
servers:
  - url: https://freesoragenerator.com
    description: Prod Env
security: []

```
