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

# Create a video generation

> Submit a video generation request and return a pending result.




## OpenAPI

````yaml /openapi.yaml post /v2/videos/generations
openapi: 3.1.0
info:
  title: getimg.ai API
  version: 2.0.0
  description: |
    The getimg.ai API for image and video generation.

    Authenticate with a bearer token in the format `sk_<secret>`.
servers:
  - url: https://api.getimg.ai
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Images
    description: Endpoints for image generation.
  - name: Models
    description: Endpoints for listing available developer models.
  - name: Videos
    description: Endpoints for video generation.
paths:
  /v2/videos/generations:
    post:
      tags:
        - Videos
      summary: Create a video generation
      description: |
        Submit a video generation request and return a pending result.
      operationId: createVideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              basic:
                summary: Basic video generation
                value:
                  model: seedance-v1-pro
                  prompt: A drone shot over a futuristic city skyline at sunset
                  aspect_ratio: '16:9'
                  resolution: 1080p
                  duration: 5
                  sound: false
              with_first_and_last_frames:
                summary: Video generation with first/last frame and reference image
                value:
                  model: seedance-v1-5-pro
                  prompt: Transition from sunrise to dusk over mountain landscape
                  images:
                    - url: https://assets.example.com/first-frame.png
                      role: first_frame
                    - url: https://assets.example.com/last-frame.png
                      role: last_frame
                  aspect_ratio: '16:9'
                  resolution: 1080p
                  duration: 10
                  sound: true
      responses:
        '202':
          description: Video generation request accepted.
          headers:
            X-RateLimit-Limit:
              $ref: '#/components/headers/X-RateLimit-Limit'
            X-RateLimit-Remaining:
              $ref: '#/components/headers/X-RateLimit-Remaining'
            X-RateLimit-Reset:
              $ref: '#/components/headers/X-RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationSubmitResponse'
              examples:
                accepted:
                  value:
                    id: req-01HXYZVIDEO1234
                    status: pending
        '400':
          $ref: '#/components/responses/BadRequestError'
        '401':
          $ref: '#/components/responses/UnauthorizedError'
        '402':
          $ref: '#/components/responses/QuotaExceededError'
        '422':
          $ref: '#/components/responses/ContentPolicyViolationError'
        '429':
          $ref: '#/components/responses/RateLimitError'
        '500':
          $ref: '#/components/responses/ServerError'
      x-codeSamples:
        - lang: javascript
          label: Node.js
          source: |
            import GetimgAI from "getimg-ai";

            const client = new GetimgAI();

            const { id } = await client.videos.generations.create({
              model: "seedance-v1-pro",
              prompt: "A drone shot over a futuristic city skyline at sunset",
              aspect_ratio: "16:9",
              resolution: "1080p",
              duration: 5,
              sound: false,
            });
        - lang: python
          label: Python
          source: |
            from getimg import GetimgAI

            client = GetimgAI()

            submission = client.videos.generations.create(
                model="seedance-v1-pro",
                prompt="A drone shot over a futuristic city skyline at sunset",
                aspect_ratio="16:9",
                resolution="1080p",
                duration=5,
                sound=False,
            )
components:
  schemas:
    VideoGenerationRequest:
      type: object
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >
            AI model ID. See [supported
            models](https://getimg.ai/app/developer/models).
        prompt:
          type: string
          minLength: 1
          maxLength: 4096
          description: |
            Description of the video to generate.
        images:
          type: array
          maxItems: 8
          items:
            $ref: '#/components/schemas/VideoReference'
          description: >
            Optional reference images. See [supported values by
            model](https://getimg.ai/app/developer/models).
        aspect_ratio:
          type: string
          description: >
            Optional output aspect ratio.

            See [supported values by
            model](https://getimg.ai/app/developer/models).
        resolution:
          type: string
          description: >
            Optional output resolution.

            See [supported values by
            model](https://getimg.ai/app/developer/models).
        duration:
          type: integer
          description: >
            Optional duration in seconds.

            See [supported values by
            model](https://getimg.ai/app/developer/models).
        sound:
          type: boolean
          description: |
            Set to `true` to generate audio when supported by the model.
    VideoGenerationSubmitResponse:
      type: object
      required:
        - id
        - status
      properties:
        id:
          type: string
          description: The ID of the generation request.
        status:
          description: The status of the generation request.
          type: string
          const: pending
    VideoReference:
      type: object
      required:
        - url
        - role
      properties:
        url:
          type: string
          description: |
            Publicly accessible reference image URL.
          minLength: 1
        role:
          type: string
          enum:
            - reference_image
            - first_frame
            - last_frame
          description: The role of the reference image.
    PublicApiError:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - message
            - type
            - param
            - code
          properties:
            message:
              type: string
            type:
              type: string
              const: invalid_request_error
            param:
              anyOf:
                - type: string
                - type: 'null'
            code:
              type: string
              enum:
                - invalid_api_key
                - parameter_missing
                - invalid_parameter
                - quota_exceeded
                - rate_limit
                - content_policy_violation
                - not_found
                - server_error
            doc_url:
              type: string
              format: uri
  headers:
    X-RateLimit-Limit:
      description: Maximum requests allowed in the current rate-limit window.
      schema:
        type: string
        pattern: ^[0-9]+$
      example: '60'
    X-RateLimit-Remaining:
      description: Remaining requests in the current rate-limit window.
      schema:
        type: string
        pattern: ^[0-9]+$
      example: '59'
    X-RateLimit-Reset:
      description: Unix timestamp (seconds) when the current rate-limit window resets.
      schema:
        type: string
        pattern: ^[0-9]+$
      example: '1760000042'
    Retry-After:
      description: Number of seconds to wait before retrying.
      schema:
        type: string
        pattern: ^[0-9]+$
      example: '42'
  responses:
    BadRequestError:
      description: The request payload or parameters are invalid.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            invalid_parameter:
              value:
                error:
                  message: Unsupported resolution '4K' for model 'seedream-5-lite'.
                  type: invalid_request_error
                  param: resolution
                  code: invalid_parameter
            parameter_missing:
              value:
                error:
                  message: Required parameter 'prompt' is missing.
                  type: invalid_request_error
                  param: prompt
                  code: parameter_missing
    UnauthorizedError:
      description: Authentication failed due to a missing or invalid API key.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            invalid_api_key:
              value:
                error:
                  message: >-
                    Incorrect API key provided. You can manage your API keys at
                    https:/getimg.ai/developer/api-keys
                  type: invalid_request_error
                  param: null
                  code: invalid_api_key
                  doc_url: https://docs.getimg.ai/#topic-authentication
    QuotaExceededError:
      description: Your account or project quota is insufficient for this request.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            quota_exceeded:
              value:
                error:
                  message: Quota exceeded.
                  type: invalid_request_error
                  param: null
                  code: quota_exceeded
    ContentPolicyViolationError:
      description: The prompt or input images failed content policy checks.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            moderated:
              value:
                error:
                  message: Image or text contains sensitive content.
                  type: invalid_request_error
                  param: null
                  code: content_policy_violation
    RateLimitError:
      description: A rate or concurrency limit was exceeded.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
        Retry-After:
          $ref: '#/components/headers/Retry-After'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            rate_limited:
              value:
                error:
                  message: Too many requests hit the API too quickly.
                  type: invalid_request_error
                  param: null
                  code: rate_limit
    ServerError:
      description: An unexpected server error occurred.
      headers:
        X-RateLimit-Limit:
          $ref: '#/components/headers/X-RateLimit-Limit'
        X-RateLimit-Remaining:
          $ref: '#/components/headers/X-RateLimit-Remaining'
        X-RateLimit-Reset:
          $ref: '#/components/headers/X-RateLimit-Reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/PublicApiError'
          examples:
            server_error:
              value:
                error:
                  message: Something went wrong on our end.
                  type: invalid_request_error
                  param: null
                  code: server_error
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Send your API key as a bearer token:
        `Authorization: Bearer sk_<secret>`.

````