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

# Create video generation task

> Submit a text-to-video or image-to-video task supporting Kling, Veo, and more

## Available models

Pass any video generation model ID in `model`, for example:

| Model ID            | Notes                                           |
| ------------------- | ----------------------------------------------- |
| `kling-v2-5-turbo`  | Kling latest Turbo — balanced speed and quality |
| `kling-v2-1-master` | Kling flagship Master — highest quality         |
| `veo_3_1`           | Google Veo 3.1 — top-tier video quality         |
| `veo_3_1-fast`      | Google Veo 3.1 Fast — lower cost                |

## Call flow

1. `POST /v1/video/generations` — submit task, get `task_id`
2. `GET /v1/video/generations/{task_id}` — poll until `status=completed`
3. Read the `url` field from the response to download the video

## Image-to-video

Set the `image` field (URL or Base64) to trigger image-to-video mode.
The model will animate the content of the provided image.

## Extended parameters

For some models, `metadata` accepts model-specific fields such as
`negative_prompt`, `style`, or `quality_level`. Supported fields vary
by model — refer to the model's own documentation.


## OpenAPI

````yaml /openapi/videos.en.yaml post /v1/video/generations
openapi: 3.1.0
info:
  title: InfinityBlue API — Videos
  version: 1.0.0
  summary: Unified AI video generation endpoints
  description: >
    Video generation endpoints using an **async task model**:

    submit a task → poll for status → retrieve the result.


    InfinityBlue provides two video endpoint families:


    - **Generic video endpoints** (`/v1/video/generations`): multi-vendor
    support
      for Kling, Veo, and others. Request style is close to the OpenAI Images API,
      making it suitable for cross-model scenarios.
    - **Seedance 2.0 endpoints** (`/v1/videos`): optimised for ByteDance
    Seedance 2.0.
      Exposes richer Seedance-specific parameters (`seconds`, `resolution`, `ratio`,
      `generate_audio`, `camera_fixed`, etc.) and supports advanced multimodal inputs
      such as first/last frame references, video references, and audio references.

    ## Typical flow


    1. `POST /v1/video/generations` or `POST /v1/videos` — submit the task,
    receive `task_id`

    2. `GET /v1/video/generations/{task_id}` or `GET /v1/videos/{task_id}` —
       poll until `status` is `completed` or `failed`
    3. Read the video URL from `url` / `metadata.url`, or download via
       `GET /v1/videos/{task_id}/content`

    ## Authentication


    Every request must include your API key in the header:

    ```

    Authorization: Bearer YOUR_API_KEY

    ```
  contact:
    name: InfinityBlue
    url: https://getinfinityblue.com
servers:
  - url: https://api.getinfinityblue.com
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Videos
    description: >
      Generic video generation endpoints supporting Kling, Veo, and other
      vendors,

      using a submit → poll → retrieve async task model.
  - name: Seedance 2.0
    description: |
      ByteDance Seedance 2.0 dedicated video endpoints with richer parameters,
      including first/last frame, video reference, and audio reference support.
paths:
  /v1/video/generations:
    post:
      tags:
        - Videos
      summary: Create video generation task
      description: >
        Submit a video generation task supporting text-to-video and
        image-to-video.

        Returns a `task_id` you use to poll progress via

        `GET /v1/video/generations/{task_id}`.
      operationId: createVideoGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VideoGenerationRequest'
            examples:
              text_to_video_kling:
                summary: Text-to-video (Kling)
                value:
                  model: kling-v2-5-turbo
                  prompt: >-
                    An astronaut walking on the Moon, Earth slowly rising in the
                    background, cinematic shot, 4K
                  duration: 5
                  width: 1280
                  height: 720
              text_to_video_veo:
                summary: Text-to-video (Veo)
                value:
                  model: veo_3_1
                  prompt: >-
                    A futuristic city at night, neon lights reflected on
                    rain-wet streets, low-angle long take, stable shot
                  duration: 8
                  width: 1920
                  height: 1080
              image_to_video:
                summary: Image-to-video
                value:
                  model: kling-v2-1-master
                  prompt: >-
                    Make the person in the image slowly turn their head, keep
                    the background unchanged, camera gently pushes in
                  image: https://example.com/portrait.jpg
                  duration: 5
                  width: 1280
                  height: 720
      responses:
        '200':
          description: Video generation task created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VideoGenerationTask'
              example:
                task_id: abcd1234efgh
                status: queued
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: Rate limit exceeded
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    VideoGenerationRequest:
      type: object
      description: Generic video generation request body.
      required:
        - model
        - prompt
      properties:
        model:
          type: string
          description: >
            Model ID. Supports multi-vendor video models such as Kling and Veo.

            Examples: `kling-v2-5-turbo`, `kling-v2-1-master`, `veo_3_1`,
            `veo_3_1-fast`.
          examples:
            - kling-v2-5-turbo
        prompt:
          type: string
          description: >-
            Text prompt describing the video content, scene, camera work, and
            style.
          examples:
            - >-
              An astronaut walking on the Moon, Earth rising in the background,
              cinematic shot
        image:
          type: string
          description: |
            Reference image — URL or Base64 data URI. When set, triggers
            image-to-video mode and the model animates the image content.
          examples:
            - https://example.com/image.jpg
        duration:
          type: number
          description: Video duration in seconds.
          examples:
            - 5
        width:
          type: integer
          description: Video width in pixels.
          examples:
            - 1280
        height:
          type: integer
          description: Video height in pixels.
          examples:
            - 720
        fps:
          type: integer
          description: Video frame rate (fps).
          examples:
            - 30
        seed:
          type: integer
          description: >-
            Random seed. Using the same seed and parameters tends to produce
            similar results.
          examples:
            - 20231234
        'n':
          type: integer
          description: >-
            Number of videos to generate. Recommended to keep at 1 for async
            tasks.
          examples:
            - 1
        response_format:
          type: string
          description: Response format. Use `url`.
          examples:
            - url
        user:
          type: string
          description: >-
            End-user identifier for auditing and abuse monitoring; not used in
            generation.
          examples:
            - user-1234
        metadata:
          type: object
          description: |
            Extended parameters for model-specific fields such as
            `negative_prompt`, `style`, or `quality_level`.
            Supported fields vary by model.
          additionalProperties: true
    VideoGenerationTask:
      type: object
      description: Response from the generic video generation create endpoint.
      properties:
        task_id:
          type: string
          description: Task ID — use this to poll for status.
          examples:
            - abcd1234efgh
        status:
          type: string
          description: Initial task status, typically `queued`.
          examples:
            - queued
    ErrorResponse:
      type: object
      description: Standard error response.
      properties:
        error:
          type: object
          properties:
            message:
              type: string
              description: Error message.
              examples:
                - Invalid duration. Supported range is 4 to 15 seconds.
            type:
              type: string
              description: Error type.
              examples:
                - invalid_request_error
            param:
              type:
                - string
                - 'null'
              description: The parameter related to the error.
              examples:
                - seconds
            code:
              type:
                - string
                - 'null'
              description: Error code.
              examples:
                - invalid_duration
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >
        Bearer token authentication, format: `Authorization: Bearer sk-xxxxxx`.

        Get your API key in the
        [console](https://api.getinfinityblue.com/console).

````