openapi: 3.1.0
info:
  title: Kling v3 Omni
  version: '1.0'
  description: Kling 3.0-Omni video generation model. Adds reference-video support (edit_source video editing / asset video reference) on top of Kling v3.
servers:
- url: https://openapi.imini.ai/imini/router
components:
  securitySchemes:
    ApiKeyAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: |
        Pass `Authorization: Bearer <YOUR_API_KEY>` in the request header. Go to the [API Keys management page](https://imini.ai/api-keys) to create and manage API Keys.
security:
- ApiKeyAuth: []
paths:
  /v1/videos/generate:
    post:
      summary: Kling v3 Omni
      operationId: generateKlingV3Omni
      security:
      - ApiKeyAuth: []
      description: |
        Submit an asynchronous video generation task. You will need to poll the query endpoint to retrieve the result.

        > Model ID: `kling/kling-v3-omni` · Underlying: Kling 3.0-Omni

        Compared to `kling/kling-v3`:
        - Additionally supports `reference_videos` (edit_source video editing / asset video reference), up to **1** clip;
        - `extra_params` does not support `camera_control`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
              - model
              properties:
                model:
                  type: string
                  description: Fixed value `kling/kling-v3-omni`.
                prompt:
                  type: string
                  description: |
                    The prompt, which may contain both positive and negative descriptions. Up to **2500** characters.

                    The Omni model supports referencing subjects, images, and videos in the prompt using the `<<<>>>` syntax, e.g. `<<<element_1>>>`, `<<<image_1>>>`, `<<<video_1>>>`.

                    > **Required when**:
                    > - `extra_params.multi_shot=false`, or `extra_params.multi_shot=true` with `extra_params.shot_type=intelligence`.
                    >
                    > When `extra_params.multi_shot=true` and `extra_params.shot_type=customize`, this field is ignored — per-shot prompts are provided via `extra_params.multi_prompt`.
                  example: A slow pan across a misty mountain valley at sunrise, cinematic
                resolution:
                  type: string
                  description: Output resolution. Defaults to `720P`.
                  default: 720P
                  enum:
                  - 720P
                  - 1080P
                aspect_ratio:
                  type: string
                  description: Output aspect ratio. Defaults to `16:9`.
                  default: '16:9'
                  enum:
                  - '16:9'
                  - '9:16'
                  - '1:1'
                duration:
                  type: integer
                  description: |
                    Video duration in seconds. Defaults to `5`. Allowed values: `3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15`.

                    > When using video editing (`reference_videos[].reference_type=edit_source`), this parameter is ignored — the output duration matches the input video and is billed based on the input video duration, rounded to the nearest second.
                  default: 5
                  enum:
                  - 3
                  - 4
                  - 5
                  - 6
                  - 7
                  - 8
                  - 9
                  - 10
                  - 11
                  - 12
                  - 13
                  - 14
                  - 15
                generate_audio:
                  type: boolean
                  description: Whether to generate audio. Defaults to `false`.
                  default: false
                reference_images:
                  type: array
                  description: |+
                    Supports asset images, first_frame and last_frame. Up to 7 asset images without video, or 0-4 asset images with a video. This API does not expose first_frame / last_frame combined with video.

                    **Image requirements**:
                    - Formats: `jpg` / `jpeg` / `png`;
                    - Size ≤ **10 MB**;
                    - Dimensions ≥ **300px**, aspect ratio between `1:2.5` and `2.5:1`.

                  maxItems: 7
                  items:
                    type: object
                    required:
                    - url
                    properties:
                      url:
                        type: string
                        description: |
                          Image address, in one of two forms:
                          **1)** A publicly accessible URL (`http://` or `https://`);
                          **2)** A Data URI base64 encoding (starting with `data:image/`).
                      reference_type:
                        type: string
                        description: |-
                          Reference type:
                          - `asset` — generic asset reference (default)
                          - `first_frame` — first frame
                          - `last_frame` — last frame

                          Omitted, null, empty or unknown strings are treated as asset.
                        default: asset
                        enum:
                        - asset
                        - first_frame
                        - last_frame
                reference_videos:
                  type: array
                  description: |
                    At most 1 video. asset (default) supplies a reference; edit_source edits the original video. Both modes support 0-4 accompanying images with reference_type=asset.

                    keep_original_sound controls the original track of this material; omission follows the model default. generate_audio has no effect when a video is supplied.

                    **Video requirements**:
                    - Formats: `MP4` / `MOV`;
                    - Size ≤ **200 MB**;
                    - Duration ≥ **3s** (upper bound depends on the model version);
                    - Dimensions: **720px – 2160px** inclusive;
                    - Frame rate: `24 – 60 fps` (output is always 24 fps);
                    - Publicly accessible URL only; base64 is not supported.
                  maxItems: 1
                  items:
                    type: object
                    required:
                    - url
                    properties:
                      url:
                        type: string
                        description: Publicly accessible video URL. base64 is not supported.
                      keep_original_sound:
                        type: boolean
                        description: Whether to preserve the original audio track. Leave unset to follow the model default.
                      reference_type:
                        type: string
                        description: |-
                          asset: reference video (default).
                          edit_source: the original video to edit; select this explicitly for editing.
                          Omitted, null, empty or unknown strings are treated as asset.
                        default: asset
                        enum:
                        - asset
                        - edit_source
                extra_params:
                  type: object
                  description: |
                    Kling's official extension parameters. All optional.
                  properties:
                    multi_shot:
                      type: boolean
                      default: false
                      description: |
                        Whether to enable multi-shot mode.
                        - `true`: multi-shot enabled. `prompt` is ignored and first/last-frame generation is not supported;
                        - `false`: multi-shot disabled. `shot_type` and `multi_prompt` are ignored.
                    shot_type:
                      type: string
                      description: |
                        Shot type. Only effective when `multi_shot=true`.
                        - `intelligence` — model splits shots automatically from `prompt`;
                        - `customize` — each shot is explicitly defined via `multi_prompt`.
                      enum:
                      - intelligence
                      - customize
                    multi_prompt:
                      type: array
                      description: |
                        Per-shot definitions. **Required when `multi_shot=true` and `shot_type=customize`.**

                        - Minimum **1**, maximum **6** shots;
                        - Each shot prompt is up to **512** characters;
                        - Each shot duration must be ≥ 1s and ≤ the total `duration`;
                        - The sum of all shot durations must equal the total `duration`.
                      minItems: 1
                      maxItems: 6
                      items:
                        type: object
                        required:
                        - index
                        - prompt
                        - duration
                        properties:
                          index:
                            type: integer
                            description: Shot index, starting from `1`.
                          prompt:
                            type: string
                            description: Prompt for this shot. Up to 512 characters.
                            maxLength: 512
                          duration:
                            type: string
                            description: Shot duration in seconds, passed as a string (e.g. `"5"`). Must be ≥ 1 and ≤ the total `duration`.
                            example: "5"
                  additionalProperties: true
            examples:
              "Text to Video":
                summary: Text to Video
                value:
                  model: kling/kling-v3-omni
                  prompt: A slow pan across a misty mountain valley at sunrise, cinematic
                  resolution: 720P
                  aspect_ratio: 16:9
                  duration: 5
              "Image to Video":
                summary: Image to Video
                value:
                  model: kling/kling-v3-omni
                  prompt: The mountain comes alive as birds fly past
                  reference_images:
                  - url: https://example.com/first.jpg
                    reference_type: first_frame
                  resolution: 1080P
                  aspect_ratio: 16:9
                  duration: 5
              "Video Edit with Image":
                summary: Video Edit with Image (edit_source)
                value:
                  model: kling/kling-v3-omni
                  prompt: Apply the visual style of <<<image_1>>> to <<<video_1>>>, preserving its motion
                  reference_images:
                  - url: https://example.com/style.jpg
                    reference_type: asset
                  reference_videos:
                  - url: https://example.com/source.mp4
                    keep_original_sound: false
                    reference_type: edit_source
                  resolution: 1080P
                  aspect_ratio: 16:9
                  duration: 5
              "Video and Image Reference":
                summary: Video and Image Reference (asset)
                value:
                  model: kling/kling-v3-omni
                  prompt: Animate the subject in <<<image_1>>> using the motion of <<<video_1>>>
                  reference_images:
                  - url: https://example.com/subject.jpg
                    reference_type: asset
                  reference_videos:
                  - url: https://example.com/reference-motion.mp4
                    reference_type: asset
                  resolution: 720P
                  aspect_ratio: 16:9
                  duration: 5
      responses:
        '200':
          description: Submitted successfully (asynchronous mode)
          content:
            application/json:
              schema:
                type: object
                properties:
                  task_id:
                    type: string
                    description: Unique task ID, used for subsequent polling
                    example: task_2042864638838083584
                  model:
                    type: string
                    description: The model ID used for this task
                    example: kling/kling-v3-omni
                  created_at:
                    type: string
                    description: Task creation time (ISO 8601)
                    example: '2026-04-13T07:17:39.146Z'
                  request_id:
                    type: string
                    description: Unique request ID
                    example: 291a4117-9df8-4349-aee1-bdf8ffcacb9a
        '400':
          description: Validation Error (e.g. invalid parameter, invalid prompt)
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      code:
                        type: string
                        description: Error code
                        example: INVALID_PARAMETER
                      message:
                        type: string
                        description: Error message details
                        example: reference_videos only supports at most 1 entry
                      status:
                        type: integer
                        description: HTTP status code
                        example: 400
                      request_id:
                        type: string
                        description: Unique request identifier
                        example: req_abc123
