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

# Generate video

> Generate video from text, image, or video input. Returns a job that you poll or stream for completion.

This endpoint also handles **lipsync** (provide audio + video/image via `files`), **video editing** (provide a video file), and **video upscaling** (provide a video file with an upscale model).




## OpenAPI

````yaml /openapi.yaml post /video
openapi: 3.1.0
info:
  title: Varg Gateway API
  version: 0.1.0
  description: >-
    Unified REST API for AI generation (video, image, speech, music) at
    api.varg.ai
servers:
  - url: https://api.varg.ai/v1
security:
  - bearerAuth: []
tags:
  - name: Generation
    description: Create AI-generated content
  - name: Jobs
    description: Manage and monitor generation jobs
  - name: Files
    description: Upload files for use in generation
  - name: Reference
    description: Available models and voices
  - name: Media Processing
    description: FFmpeg-powered video utilities (trim, resize, probe, custom commands)
  - name: Account
    description: Account info, balance, and usage
paths:
  /video:
    post:
      tags:
        - Generation
      summary: Generate video
      description: >
        Generate video from text, image, or video input. Returns a job that you
        poll or stream for completion.


        This endpoint also handles **lipsync** (provide audio + video/image via
        `files`), **video editing** (provide a video file), and **video
        upscaling** (provide a video file with an upscale model).
      operationId: createVideo
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - model
                - prompt
              properties:
                model:
                  type: string
                  description: >
                    Video model to use. Also accepts lipsync and video upscale
                    models.


                    **Video generation:** `kling-v3`, `kling-v3-standard`,
                    `seedance-2-preview`, `seedance-2-fast-preview`, `sora-2`,
                    `sora-2-pro`, `wan-2.5`, `wan-2.5-preview`, `minimax`,
                    `ltx-2-19b-distilled`, `grok-imagine`


                    **Video editing:** `grok-imagine-edit`, `sora-2-remix`,
                    `seedance-2-preview`


                    **Motion control:** `kling-v2.6-motion`


                    **Lipsync:** `veed-fabric-1.0`, `sync-v2`, `sync-v2-pro`,
                    `omnihuman-v1.5`


                    **Video upscale:** `seedvr-video`, `topaz-video`,
                    `bytedance-upscaler`, `sima-video-upscaler`


                    **Legacy:** `kling-v2.6`, `kling-v2.5`, `kling-v2.1`,
                    `kling-v2`
                  examples:
                    - kling-v3
                    - seedance-2-preview
                    - seedance-2-fast-preview
                    - sora-2
                    - wan-2.5
                    - minimax
                    - ltx-2-19b-distilled
                    - grok-imagine
                    - veed-fabric-1.0
                    - sync-v2
                    - seedvr-video
                prompt:
                  type: string
                  description: >-
                    Text description of the video to generate. For lipsync and
                    upscale models, can be empty.
                  example: ocean waves crashing on a rocky beach at sunset
                duration:
                  type: number
                  description: >-
                    Duration in seconds. Seedance models only accept 5, 10, or
                    15. Kling V3 accepts integers 3-15.
                  default: 5
                  example: 5
                aspect_ratio:
                  type: string
                  description: Output aspect ratio
                  examples:
                    - '16:9'
                    - '9:16'
                    - '1:1'
                    - '4:3'
                    - '3:4'
                files:
                  type: array
                  description: >
                    Input files for image-to-video, video editing, lipsync, or
                    upscale.


                    - **Image-to-video:** 1 image URL (first frame). Some models
                    support 2 images for first+last keyframe.

                    - **Video editing:** 1 video URL (`.mp4`, `.webm`, `.mov`)

                    - **Lipsync:** 1 video/image URL + 1 audio URL

                    - **Video upscale:** 1 video URL
                  items:
                    type: object
                    required:
                      - url
                    properties:
                      url:
                        type: string
                        format: uri
                        description: URL of the input file
                provider_options:
                  type: object
                  description: Additional options passed directly to the provider
                  additionalProperties: true
            examples:
              kling-v3-text-to-video:
                summary: Kling V3 — text-to-video
                value:
                  model: kling-v3
                  prompt: >-
                    cinematic shot of ocean waves crashing on rocky cliffs at
                    golden hour
                  duration: 5
                  aspect_ratio: '16:9'
              kling-v3-image-to-video:
                summary: Kling V3 — image-to-video
                value:
                  model: kling-v3
                  prompt: slow camera push-in, the subject blinks and smiles
                  duration: 5
                  files:
                    - url: https://example.com/portrait.jpg
              kling-v3-keyframe:
                summary: Kling V3 — first + last frame keyframe
                value:
                  model: kling-v3
                  prompt: smooth transition from day to night
                  duration: 5
                  files:
                    - url: https://example.com/day-scene.jpg
                    - url: https://example.com/night-scene.jpg
              kling-v3-standard:
                summary: Kling V3 Standard — budget text-to-video
                value:
                  model: kling-v3-standard
                  prompt: a paper airplane floating through a sunlit classroom
                  duration: 8
                  aspect_ratio: '16:9'
              seedance-2-text-to-video:
                summary: Seedance 2 — text-to-video
                value:
                  model: seedance-2-preview
                  prompt: >-
                    a golden retriever running through autumn leaves in slow
                    motion
                  duration: 5
                  aspect_ratio: '16:9'
              seedance-2-image-to-video:
                summary: Seedance 2 — image-to-video
                value:
                  model: seedance-2-preview
                  prompt: '@image1 the woman turns to face the camera and smiles'
                  duration: 5
                  files:
                    - url: https://example.com/portrait.jpg
              seedance-2-fast:
                summary: Seedance 2 Fast — quick iteration
                value:
                  model: seedance-2-fast-preview
                  prompt: >-
                    aerial drone shot over a tropical island with turquoise
                    water
                  duration: 10
                  aspect_ratio: '16:9'
              sora-2-text-to-video:
                summary: Sora 2 — text-to-video
                value:
                  model: sora-2
                  prompt: >-
                    a chef preparing sushi in a high-end restaurant, cinematic
                    lighting
                  duration: 5
                  aspect_ratio: '16:9'
              sora-2-image-to-video:
                summary: Sora 2 — image-to-video
                value:
                  model: sora-2
                  prompt: >-
                    the scene slowly comes to life with gentle wind and moving
                    clouds
                  duration: 5
                  files:
                    - url: https://example.com/landscape.jpg
              sora-2-remix:
                summary: Sora 2 Remix — video-to-video
                value:
                  model: sora-2-remix
                  prompt: transform into an anime art style with vibrant colors
                  files:
                    - url: https://example.com/original.mp4
              wan-25:
                summary: Wan 2.5 — text-to-video
                value:
                  model: wan-2.5
                  prompt: >-
                    a dancer performing contemporary dance in an empty
                    warehouse, dramatic shadows
                  duration: 5
                  aspect_ratio: '9:16'
              minimax:
                summary: MiniMax — text-to-video
                value:
                  model: minimax
                  prompt: a cat sitting on a windowsill watching rain fall outside
                  duration: 5
                  aspect_ratio: '16:9'
              ltx:
                summary: LTX — fast text-to-video
                value:
                  model: ltx-2-19b-distilled
                  prompt: abstract colorful particles flowing through space
                  duration: 5
                  aspect_ratio: '16:9'
              grok-imagine-video:
                summary: Grok Imagine — text-to-video
                value:
                  model: grok-imagine
                  prompt: a steam train crossing a stone bridge over a misty valley
                  duration: 5
                  aspect_ratio: '16:9'
              grok-imagine-edit:
                summary: Grok Imagine Edit — video editing
                value:
                  model: grok-imagine-edit
                  prompt: change the background to a tropical beach at sunset
                  files:
                    - url: https://example.com/original.mp4
              lipsync-veed:
                summary: VEED Fabric 1.0 — lipsync
                value:
                  model: veed-fabric-1.0
                  prompt: ''
                  files:
                    - url: https://example.com/talking-head.mp4
                    - url: https://example.com/narration.mp3
              lipsync-sync:
                summary: Sync V2 — lipsync
                value:
                  model: sync-v2
                  prompt: ''
                  files:
                    - url: https://example.com/talking-head.mp4
                    - url: https://example.com/narration.mp3
              lipsync-omnihuman:
                summary: OmniHuman 1.5 — lipsync
                value:
                  model: omnihuman-v1.5
                  prompt: ''
                  files:
                    - url: https://example.com/portrait.jpg
                    - url: https://example.com/speech.mp3
              upscale-seedvr-video:
                summary: SeedVR — video upscale
                value:
                  model: seedvr-video
                  prompt: ''
                  files:
                    - url: https://example.com/low-res-video.mp4
              upscale-topaz-video:
                summary: Topaz — video upscale
                value:
                  model: topaz-video
                  prompt: ''
                  files:
                    - url: https://example.com/low-res-video.mp4
      responses:
        '202':
          description: Job created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/JobResponse'
        '400':
          $ref: '#/components/responses/ValidationError'
        '401':
          $ref: '#/components/responses/AuthError'
        '402':
          $ref: '#/components/responses/InsufficientBalanceError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/InternalError'
        '502':
          $ref: '#/components/responses/ProviderError'
components:
  schemas:
    JobResponse:
      type: object
      required:
        - job_id
        - status
        - model
        - created_at
      properties:
        job_id:
          type: string
          description: Unique job identifier
          example: job_a1b2c3d4
        status:
          type: string
          enum:
            - queued
            - processing
            - completed
            - failed
            - cancelled
          description: Current job status
          example: completed
        model:
          type: string
          description: Resolved model identifier (provider:model format)
          example: fal:kling-v2.5
        created_at:
          type: string
          format: date-time
          description: When the job was created
          example: '2026-02-13T10:00:00Z'
        completed_at:
          type: string
          format: date-time
          description: When the job finished (completed, failed, or cancelled)
          example: '2026-02-13T10:02:30Z'
        output:
          type: object
          description: Job output, present when status is completed
          properties:
            url:
              type: string
              format: uri
              description: URL of the generated file on s3.varg.ai
              example: https://s3.varg.ai/o/job_a1b2c3d4.mp4
            media_type:
              type: string
              description: MIME type of the output
              example: video/mp4
        cache:
          type: object
          description: Cache metadata
          properties:
            hit:
              type: boolean
              description: Whether this result was served from cache
              example: false
            key:
              type: string
              description: Cache key for this request
              example: sha256:abc123...
        error:
          type: string
          description: Error message, present when status is failed
          example: Provider returned an error
    ErrorResponse:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          description: Error code
          example: ValidationError
        message:
          type: string
          description: Human-readable error description
          example: prompt is required
        field:
          type: string
          description: The field that caused the error, if applicable
          example: prompt
        provider:
          type: string
          description: The upstream provider that returned the error, if applicable
          example: fal
        statusCode:
          type: number
          description: HTTP status code
          example: 400
  responses:
    ValidationError:
      description: Invalid request body
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: ValidationError
            message: prompt is required
            field: prompt
            statusCode: 400
    AuthError:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: AuthError
            message: Invalid API key
            statusCode: 401
    InsufficientBalanceError:
      description: Account balance too low
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: InsufficientBalanceError
            message: Insufficient balance. Add credits at varg.ai/dashboard.
            statusCode: 402
    RateLimitError:
      description: Too many requests
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: RateLimitError
            message: Rate limit exceeded. Retry after 60 seconds.
            statusCode: 429
    InternalError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: InternalError
            message: An unexpected error occurred
            statusCode: 500
    ProviderError:
      description: Upstream provider returned an error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            error: ProviderError
            message: Provider returned an error
            provider: fal
            statusCode: 502
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: varg_xxx
      description: |
        API key from [varg.ai/dashboard](https://varg.ai/dashboard).

        Pass as `Authorization: Bearer varg_xxx`.

````