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

# Create video task

> Create an asynchronous text-to-video or image-to-video task. Use JSON when there are no reference images and multipart/form-data when reference images are present.



## OpenAPI

````yaml POST /videos
openapi: 3.1.0
info:
  title: LLM7 API
  description: >-
    Discover models, generate and edit images, and create asynchronous video
    generation tasks through the LLM7 gateway.
  version: 1.0.0
servers:
  - url: https://api.llm7.io/v1
security:
  - bearerAuth: []
paths:
  /videos:
    post:
      summary: Create video task
      description: >-
        Create an asynchronous text-to-video or image-to-video task. Use JSON
        when there are no reference images and multipart/form-data when
        reference images are present.
      operationId: createVideoTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoCreateJsonRequest'
            examples:
              textToVideo:
                summary: Text to video
                value:
                  model: gemini-veo31
                  prompt: Waves crashing on rocks, cinematic slow motion
                  seconds: '6'
                  size: 1280x720
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/VideoCreateMultipartRequest'
            encoding:
              input_reference:
                contentType: image/png, image/jpeg, image/webp
            examples:
              imageToVideo:
                summary: Image to video
                value:
                  model: gemini-veo31
                  prompt: Animate this first frame
                  seconds: '6'
                  size: 1280x720
      responses:
        '200':
          description: Queued video task
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoTaskResponse'
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '402':
          $ref: '#/components/responses/InsufficientBalance'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '429':
          $ref: '#/components/responses/RateLimited'
        '502':
          $ref: '#/components/responses/UpstreamInvalidResponse'
        '503':
          $ref: '#/components/responses/UpstreamUnavailable'
components:
  schemas:
    VideoCreateJsonRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - prompt
        - seconds
        - input_reference
      properties:
        model:
          type: string
          description: Video model ID.
          example: gemini-veo31
        prompt:
          type: string
          description: Text instruction for the video.
          example: Waves crashing on rocks, cinematic slow motion
        seconds:
          type: string
          description: >-
            Requested duration. Must be listed in the selected model's
            capabilities.supported_seconds.
          example: '6'
        size:
          type: string
          description: >-
            Requested output size. Must be listed in the selected model's
            capabilities.supported_sizes when provided.
          example: 1280x720
    VideoCreateMultipartRequest:
      type: object
      additionalProperties: false
      required:
        - model
        - prompt
        - seconds
      properties:
        model:
          type: string
          description: Video model ID.
          example: gemini-veo31
        prompt:
          type: string
          description: Text instruction for the video.
          example: Animate this first frame
        seconds:
          type: string
          description: >-
            Requested duration. Must be listed in the selected model's
            capabilities.supported_seconds.
          example: '6'
        size:
          type: string
          description: >-
            Requested output size. Must be listed in the selected model's
            capabilities.supported_sizes when provided.
          example: 1280x720
        input_reference:
          type: array
          description: >-
            Reference images. Send each file with the repeated field name
            input_reference.
          minItems: 1
          items:
            type: string
            format: binary
    VideoTaskResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          description: Video task ID.
          example: video_task_id
        status:
          type: string
          description: Video task status.
          enum:
            - queued
            - in_progress
            - completed
            - failed
          example: queued
    ErrorResponse:
      type: object
      required:
        - error
      properties:
        error:
          $ref: '#/components/schemas/ErrorObject'
    ErrorObject:
      type: object
      required:
        - message
        - type
        - code
      properties:
        message:
          type: string
        type:
          type: string
        param:
          type:
            - string
            - 'null'
        code:
          type: string
  responses:
    BadRequest:
      description: Invalid gateway request or upstream rejected the request.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    Unauthorized:
      description: Missing or invalid LLM7 token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    InsufficientBalance:
      description: No available balance or allowance.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    PayloadTooLarge:
      description: Request body or reference image is too large.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    RateLimited:
      description: Gateway or upstream rate limit.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UpstreamInvalidResponse:
      description: Upstream success response did not match the endpoint contract.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
    UpstreamUnavailable:
      description: Upstream provider is temporarily unavailable.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````