# Text-to-Video

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /openapi/v2/video/text/generate:
    post:
      summary: Text-to-Video
      deprecated: false
      description: Generate a video from a text prompt.
      operationId: video_text_generate
      tags:
        - API /Core Capabilities
        - Core Capabilities
      parameters:
        - name: API-KEY
          in: header
          description: Your PixVerse API key.
          required: true
          example: your-api-key
          schema:
            type: string
        - name: Ai-trace-id
          in: header
          description: A unique UUID for this request.
          required: true
          example: 550e8400-e29b-41d4-a716-446655440000
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              type: object
              anyOf:
                - title: Text-to-Video Request
                  type: object
                  properties:
                    model:
                      type: string
                      enum:
                        - v6-max
                        - c1
                        - v6
                        - v3.5
                        - v4
                        - v4.5
                        - v5
                        - v5-fast
                        - v5.5
                        - v5.6
                      examples:
                        - v6-max
                    prompt:
                      type: string
                      maxLength: 5000
                      examples:
                        - A cinematic scene with natural motion.
                    duration:
                      type: integer
                      minimum: 1
                      maximum: 15
                      examples:
                        - 5
                    quality:
                      type: string
                      enum:
                        - 360p
                        - 540p
                        - 720p
                        - 1080p
                      examples:
                        - 720p
                    seed:
                      type: integer
                      minimum: 0
                      maximum: 2147483647
                      examples:
                        - 12345
                    webhook_id:
                      type: string
                    aspect_ratio:
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '4:3'
                        - '3:4'
                        - '1:1'
                        - '2:3'
                        - '3:2'
                        - '21:9'
                      examples:
                        - '16:9'
                    generate_audio_switch:
                      type: boolean
                      default: false
                    generate_multi_clip_switch:
                      type: boolean
                      default: false
                  required:
                    - model
                    - prompt
                    - duration
                    - quality
                    - aspect_ratio
                  x-apidog-orders:
                    - model
                    - prompt
                    - duration
                    - quality
                    - seed
                    - webhook_id
                    - aspect_ratio
                    - generate_audio_switch
                    - generate_multi_clip_switch
              x-apidog-orders: []
              properties: {}
            examples:
              text_v6_minimum:
                value:
                  model: v6-max
                  prompt: A blue glass marble rolls across a clean white table
                  duration: 1
                  quality: 360p
                  aspect_ratio: '1:1'
                summary: Minimal request (replace resource IDs)
              text_v6_complete:
                value:
                  model: v6-max
                  prompt: >-
                    Shot 1: A blue glass marble rolls across a clean white table
                    in morning light. Shot 2: The camera follows as it reaches
                    the edge and reflects the city skyline; cinematic lighting
                    and realistic motion.
                  duration: 5
                  quality: 720p
                  aspect_ratio: '16:9'
                  seed: 20260804
                  generate_audio_switch: true
                  generate_multi_clip_switch: true
                summary: Complete scenario (replace resource IDs)
              text_c1_complete:
                value:
                  model: c1
                  prompt: >-
                    A cinematic red paper airplane glides through a sunlit glass
                    studio, banks gently around a white sculpture, then lands on
                    a wooden table; smooth tracking camera and natural
                    synchronized ambience.
                  duration: 5
                  quality: 720p
                  aspect_ratio: '16:9'
                  seed: 20260803
                  generate_audio_switch: true
                summary: Complete scenario (replace resource IDs)
      responses:
        '200':
          x-apidog-name: OK
          x-apidog-ordering: 0
          description: >-
            Request processed. ErrCode=0 indicates business success; a nonzero
            ErrCode indicates failure, even with HTTP 200.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ErrCode:
                    type: integer
                    description: >-
                      Business result code. A nonzero code indicates a request
                      error even with HTTP 200.
                  ErrMsg:
                    type: string
                    description: Response message.
                  Resp:
                    type: object
                    properties:
                      video_id:
                        type: integer
                        description: Task ID. Poll GET /openapi/v2/video/result/{video_id}.
                        format: int64
                        minimum: 1
                        examples:
                          - 123456789
                      credits:
                        type: integer
                        description: Credits consumed by the task.
                    required:
                      - video_id
                    x-apidog-orders:
                      - video_id
                      - credits
                    nullable: true
                  Error:
                    type: object
                    description: >-
                      Optional supplemental error details. Existing error
                      handling remains valid when this object is absent.
                    required:
                      - Type
                      - Message
                      - Param
                    additionalProperties: true
                    properties:
                      Type:
                        type: string
                        description: >-
                          A stable error type identifier. Allow unknown type
                          values.
                      Message:
                        type: string
                        description: >-
                          The cause of the error and a suggested action. Do not
                          match the complete message text for program logic.
                      Param:
                        type: object
                        description: >-
                          Details relevant to this error; {} when no reliable
                          details are available. All child fields are optional
                          and additional fields are allowed. Fields vary by
                          error and endpoint.
                        additionalProperties: true
                        properties:
                          Fields:
                            type: array
                            items:
                              type: string
                            description: Request fields related to the error.
                          AllowedValues:
                            type: array
                            items:
                              type: string
                            description: >-
                              Values supported for quality, aspect_ratio or
                              duration by the current rule. Duration values are
                              also strings. Omitted when the full set cannot be
                              determined.
                          RequiredField:
                            type: string
                            description: >-
                              Request field to use instead for template input
                              validation.
                          RequiredCount:
                            type: integer
                            description: >-
                              Number of inputs required by the selected
                              template.
                          Moderation:
                            type: object
                            additionalProperties: true
                            description: >-
                              Supplemental moderation information, when
                              available.
                            properties:
                              LabelName:
                                type: string
                                description: >-
                                  A readable moderation explanation, when
                                  available. Multiple explanations are separated
                                  by newlines; do not match this text for
                                  program logic.
                            x-apidog-orders:
                              - LabelName
                        x-apidog-orders:
                          - Fields
                          - AllowedValues
                          - RequiredField
                          - RequiredCount
                          - Moderation
                    x-apidog-orders:
                      - Type
                      - Message
                      - Param
                required:
                  - ErrCode
                  - ErrMsg
                additionalProperties: true
                x-apidog-orders:
                  - ErrCode
                  - ErrMsg
                  - Resp
                  - Error
              examples:
                '3':
                  summary: FIELD_VALUE_INVALID
                  value:
                    ErrCode: 400017
                    ErrMsg: Invalid parameter
                    Resp: null
                    Error:
                      Type: FIELD_VALUE_INVALID
                      Message: >-
                        Field 'quality' has an unsupported value for
                        text-to-video generation. Allowed values: 360p, 540p,
                        720p, 1080p.
                      Param:
                        Fields:
                          - quality
                        AllowedValues:
                          - 360p
                          - 540p
                          - 720p
                          - 1080p
                accepted:
                  summary: Illustrative accepted task; poll to completion
                  value:
                    ErrCode: 0
                    ErrMsg: Success
                    Resp:
                      video_id: 123456789
                      credits: 10
                failure_multiclip_v56_reject:
                  summary: V5.6 multi-clip request rejected
                  value:
                    ErrCode: 400017
                    ErrMsg: >-
                      generate_multi_clip_switch is supported in model v5.5, v6
                      only.
                    Resp: null
                    Error:
                      Type: FIELD_VALUE_INVALID
                      Message: >-
                        Field 'model' has an unsupported value. Check the
                        allowed values and format for this endpoint.
                      Param:
                        Fields:
                          - model
                        AllowedValues:
                          - v5.5
                          - v6
          headers: {}
      security: []
      x-apidog-folder: API /Core Capabilities
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/772214/apis/api-13016634-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://app-api.pixverse.ai
    description: Prod Env
security: []

```
