# Image-to-Video and Video Templates

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /openapi/v2/video/img/generate:
    post:
      summary: Image-to-Video and Video Templates
      deprecated: false
      description: >-
        Generate from an uploaded image, or use template_id for a template-based
        task. Normal image generation requires img_id. For templates, provide
        the image field and count required by that template (img_id or ordered
        img_ids). Template metadata determines supported model, duration, and
        quality; do not assume every template accepts the same combination.
      operationId: video_img_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
              properties:
                model:
                  type: string
                  description: >-
                    Video generation model. Access to v5-fast depends on account
                    permissions.
                  enum:
                    - c1
                    - v6
                    - v5.6
                    - v5.5
                    - v5
                    - v3.5
                    - v4
                    - v4.5
                    - v5-fast
                  examples:
                    - v6
                prompt:
                  type: string
                  description: Generation prompt.
                  maxLength: 2048
                  examples:
                    - A cinematic scene with natural motion.
                duration:
                  type: integer
                  description: >-
                    Duration in seconds. C1/V6: 1-15; V5.5/V5.6: 5, 8, or 10;
                    older models: 5 or 8. Do not use unsupported
                    duration/quality combinations.
                  minimum: 1
                  maximum: 15
                  examples:
                    - 5
                quality:
                  type: string
                  description: Output resolution.
                  enum:
                    - 360p
                    - 540p
                    - 720p
                    - 1080p
                  examples:
                    - 720p
                seed:
                  type: integer
                  description: Random seed.
                  minimum: 0
                  maximum: 2147483647
                  examples:
                    - 12345
                webhook_id:
                  type: string
                  description: >-
                    Optional ID of a Webhook configured in the same account, not
                    a callback URL. Omit it when polling task status.
                  examples:
                    - replace-with-your-webhook-id
                img_id:
                  type: integer
                  description: Uploaded image ID. Required for ordinary image generation.
                  format: int64
                  minimum: 1
                  examples:
                    - 123456789
                img_ids:
                  type: array
                  description: Ordered image IDs for a multi-image template only.
                  items:
                    type: integer
                    description: Uploaded image ID.
                    format: int64
                    minimum: 1
                    examples:
                      - 123456789
                  minItems: 1
                template_id:
                  type: integer
                  description: >-
                    Optional current template ID returned by Get Effect Template
                    List.
                  format: int64
                  minimum: 1
                  examples:
                    - 123456789
                generate_audio_switch:
                  type: boolean
                  description: >-
                    Generate native audio with V5.5, V5.6, V6, or C1. Set to
                    true to enable audio or false for silent output.
                generate_multi_clip_switch:
                  type: boolean
                  description: >-
                    Enable multi-clip generation with V5.5 or V6. Not supported
                    with other models or template_id.
                sound_effect_switch:
                  type: boolean
                  description: >-
                    Legacy sound-effect option; use only with a supporting
                    model/template.
                sound_effect_content:
                  type: string
                  description: Legacy sound description; applicable only when supported.
                lip_sync_switch:
                  type: boolean
                  description: Legacy Lipsync option; applicable only when supported.
                lip_sync_tts_content:
                  type: string
                  description: TTS text for a supporting legacy Lipsync request.
                lip_sync_tts_speaker_id:
                  type: string
                  description: Speaker ID for a supporting legacy Lipsync request.
              required:
                - model
                - prompt
                - duration
                - quality
              anyOf:
                - required:
                    - img_id
                  not:
                    required:
                      - template_id
                  allOf:
                    - anyOf:
                        - properties:
                            model:
                              type: string
                            duration:
                              type: string
                          x-apidog-orders:
                            - model
                            - duration
                          type: object
                        - properties:
                            model:
                              type: string
                            duration:
                              type: string
                          not:
                            properties:
                              duration:
                                enum:
                                  - 10
                              quality:
                                enum:
                                  - 1080p
                            required:
                              - duration
                              - quality
                            x-apidog-orders:
                              - duration
                              - quality
                          x-apidog-orders:
                            - model
                            - duration
                          type: object
                        - properties:
                            model:
                              type: string
                            duration:
                              type: string
                          not:
                            properties:
                              duration:
                                enum:
                                  - 8
                              quality:
                                enum:
                                  - 1080p
                            required:
                              - duration
                              - quality
                            x-apidog-orders:
                              - duration
                              - quality
                          x-apidog-orders:
                            - model
                            - duration
                          type: object
                        - properties:
                            model:
                              type: string
                            duration:
                              type: string
                          x-apidog-orders:
                            - model
                            - duration
                          type: object
                - required:
                    - template_id
                  anyOf:
                    - type: string
                    - type: string
              x-apidog-orders:
                - model
                - prompt
                - duration
                - quality
                - seed
                - webhook_id
                - img_id
                - img_ids
                - template_id
                - generate_audio_switch
                - generate_multi_clip_switch
                - sound_effect_switch
                - sound_effect_content
                - lip_sync_switch
                - lip_sync_tts_content
                - lip_sync_tts_speaker_id
              allOf:
                - anyOf:
                    - properties:
                        generate_multi_clip_switch:
                          enum:
                            - false
                      x-apidog-orders:
                        - generate_multi_clip_switch
                      type: object
                    - properties:
                        model:
                          enum:
                            - v5.5
                            - v6
                      not:
                        required:
                          - template_id
                      x-apidog-orders:
                        - model
                      type: object
            examples:
              image_v6_minimum:
                value:
                  duration: 5
                  img_id: 123456790
                  model: v6
                  prompt: Make the subject walk forward slowly.
                  quality: 720p
                  generate_audio_switch: false
                  seed: 0
                summary: Minimal request (replace resource IDs)
              image_v6_complete:
                value:
                  model: v6
                  img_id: 123456791
                  prompt: >-
                    Make the subject walk forward slowly, natural motion,
                    cinematic lighting.
                  duration: 5
                  quality: 720p
                  seed: 0
                  generate_audio_switch: true
                summary: Complete scenario (replace resource IDs)
              template_minimum_complete:
                value:
                  duration: 13
                  model: v6
                  quality: 720p
                  img_id: 123456791
                  template_id: 123456792
                  prompt: ''
                summary: Complete scenario (replace resource IDs)
      responses:
        '200':
          x-apidog-name: OK
          x-apidog-ordering: 0
          description: Successful response.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ErrCode:
                    type: integer
                  ErrMsg:
                    type: string
                  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
                required:
                  - ErrCode
                  - ErrMsg
                x-apidog-orders:
                  - ErrCode
                  - ErrMsg
                  - Resp
              examples:
                accepted:
                  summary: Illustrative accepted task; poll to completion
                  value:
                    ErrCode: 0
                    ErrMsg: Success
                    Resp:
                      video_id: 123456789
                      credits: 10
          headers: {}
        '400':
          x-apidog-ordering: 1
          description: >-
            Invalid request. Preserve the response and trace ID for
            troubleshooting.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ErrCode:
                    type: integer
                  ErrMsg:
                    type: string
                required:
                  - ErrCode
                  - ErrMsg
                x-apidog-orders:
                  - ErrCode
                  - ErrMsg
          headers: {}
          x-apidog-name: ''
        '401':
          x-apidog-ordering: 2
          description: Authentication failure. Use a key from the global environment.
          content:
            application/json:
              schema:
                type: object
                properties:
                  ErrCode:
                    type: integer
                  ErrMsg:
                    type: string
                required:
                  - ErrCode
                  - ErrMsg
                x-apidog-orders:
                  - ErrCode
                  - ErrMsg
          headers: {}
          x-apidog-name: ''
      security: []
      x-apidog-folder: API /Core Capabilities
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/772214/apis/api-13016633-run
components:
  schemas: {}
  securitySchemes: {}
servers:
  - url: https://app-api.pixverse.ai
    description: Prod Env
security: []

```
