# Kling 4.0 / 3.0 omni

## OpenAPI Specification

```yaml
openapi: 3.0.1
info:
  title: ''
  description: ''
  version: 1.0.0
paths:
  /api/v1/task:
    post:
      summary: Kling 4.0 / 3.0 omni
      deprecated: false
      description: >
        This is the api for Kling's Omni video generation API, covering **Kling
        4.0 Omni** and **Kling 3.0 Omni** (the successor of Kling o1). Generate
        video from a prompt plus reference images, videos and audio. Choose the
        model with `version`:


        - `4.0` — 720p or 1080p, 3 – 30 seconds; up to 10 images, 5 reference
        videos and 3 reference audios

        - `4.0-flash` — 720p only, 3 – 20 seconds; images and reference videos

        - `3.0` — 720p or 1080p, 3 – 15 seconds; images, one reference video and
        multi-shots


        **Pricing** (USD per second of output video)

        | Version | 720p | 1080p |

        | --- | --- | --- |

        | 4.0             | 0.1667 | 0.25 |

        | 4.0-flash       | 0.10   | N/A  |

        | 3.0, no audio   | 0.10   | 0.15 |

        | 3.0, with audio | 0.15   | 0.20 |


        **4.0 / 4.0-flash with a reference video** are billed per billable
        second instead: billable seconds = output duration + max(total reference
        video duration, output duration).

        | Version | 720p | 1080p |

        | --- | --- | --- |

        | 4.0       | 0.10   | 0.15 |

        | 4.0-flash | 0.0667 | N/A  |


        For 4.0 / 4.0-flash, image and audio references and audio settings do
        not change the price. Reference durations are measured from the files
        themselves and not rounded per clip; the task total is rounded to the
        nearest cent once.


        Price examples

        - 3.0, 720p, 10s, no audio: 10 \* \$0.10 \= \$1.00

        - 3.0, multi-shots (shot1 2s + shot2 3s), 720p with audio: \(2 \+ 3\) \*
        \$0.15 \= \$0.75

        - 4.0, 720p, 10s, images only: \$1.67

        - 4.0, 720p, 5s output + one 6.667s reference video: \(5 \+ 6.667\) \*
        \$0.10 → \$1.17

        - 4.0-flash, 720p, same inputs: \$0.77


        **Feature support**

        | | 4.0 | 4.0-flash | 3.0 |

        | --- | --- | --- | --- |

        | Duration (seconds) | 3 – 30 | 3 – 20 | 3 – 15 |

        | 1080p | ✓ | – | ✓ |

        | `images` | up to 10 | up to 10 | ✓ (up to 4 with `video`) |

        | Reference video | `video`, or `videos` up to 5 | `video`, or `videos`
        up to 5 | `video` (one) |

        | `audio_urls` | up to 3 | – | – |

        | `multi_shots` | – | – | ✓ |

        | `aspect_ratio: "21:9"` / `"auto"` | ✓ | ✓ | – |

        | `enable_audio` default | true | true | false |

        | Cancel task | – | – | ✓ |


        **Referencing inputs in the prompt**

        - `@image_1`, `@image_2` … refer to entries of `images` by position,
        starting at 1. An image can be used multiple times, e.g. use @image_1 as
        start frame, a woman @image_2 is introducing herself, and use @image_1
        as end frame

        - Reference video: 3.0 uses `@video`; 4.0 / 4.0-flash use `@video_1`,
        `@video_2` … by position

        - Reference audio (4.0): `audio_1`, `audio_2` … by position


        **Notes**

        - 4.0 / 4.0-flash: `prompt` (up to 2,500 characters) and `duration`
        (integer) are required

        - 4.0 / 4.0-flash references: send either `video` or `videos`, not both;
        at most 15 images, videos and audios in total; all must be HTTP(S) URLs

        - Reference video (4.0 / 4.0-flash): regular MP4 with square pixels,
        aspect ratio 2:5 – 5:2, at most 300 MiB, 3 – 30s each (4.0-flash 3 –
        20s), combined at most 30s (4.0-flash 20s). Fragmented MP4 is not
        supported

        - Reference audio (4.0): MP3, WAV or FLAC, 5 – 30s, at most 50 MiB

        - `aspect_ratio: "auto"` (4.0 / 4.0-flash) requires image or video
        references and is the default when they are given; otherwise the default
        is 16:9

        - `keep_original_audio: true` keeps the reference video's original audio
        in the output. For 4.0 / 4.0-flash it requires a reference video and
        `enable_audio: false`

        - 3.0: when `video` is provided, `multi_shots` cannot be used. If multi
        shots are used, `prompt` and `duration` are ignored; maximum 6 shots,
        total duration should not exceed 15 seconds

        - 4.0 / 4.0-flash accept only the fields marked for them; unlisted
        fields and `multi_shots` are rejected with `error.code: 10003`. They
        require `config.service_mode: "public"`

        - 4.0 / 4.0-flash tasks cannot be cancelled; keep polling [Get
        Task](https://piapi.ai/docs/kling-api/omni-get-task) for the final
        result
      operationId: kling/o3
      tags:
        - Endpoints/Kling omni
      parameters:
        - name: x-api-key
          in: header
          description: you api key
          required: true
          example: ''
          schema:
            type: string
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                model:
                  type: string
                  default: kling
                  enum:
                    - kling
                  x-apidog-enum:
                    - value: kling
                      name: ''
                      description: ''
                task_type:
                  type: string
                  default: omni_video_generation
                  enum:
                    - omni_video_generation
                  x-apidog-enum:
                    - value: omni_video_generation
                      name: ''
                      description: ''
                input:
                  type: object
                  description: |
                    the input param of the task
                  x-apidog-orders:
                    - prompt
                    - version
                    - resolution
                    - duration
                    - aspect_ratio
                    - enable_audio
                    - multi_shots
                    - video
                    - images
                    - videos
                    - audio_urls
                    - keep_original_audio
                  properties:
                    prompt:
                      type: string
                      description: text prompt used to generate video
                    duration:
                      type: integer
                      description: >-
                        duration of the generated video in seconds. 3.0: 3–15;
                        4.0: 3–30 (required); 4.0-flash: 3–20 (required)
                      default: 5
                      minimum: 3
                      maximum: 30
                    aspect_ratio:
                      type: string
                      enum:
                        - '16:9'
                        - '9:16'
                        - '1:1'
                        - '21:9'
                        - auto
                      x-apidog-enum:
                        - value: '16:9'
                          name: ''
                          description: ''
                        - value: '9:16'
                          name: ''
                          description: ''
                        - value: '1:1'
                          name: ''
                          description: ''
                        - value: '21:9'
                          name: ''
                          description: ''
                        - value: auto
                          name: ''
                          description: ''
                      default: '16:9'
                      description: >-
                        aspect ratio of the generated video. 21:9 and auto are
                        4.0 / 4.0-flash only; auto requires image/video
                        references
                    version:
                      type: string
                      enum:
                        - '3.0'
                        - '4.0'
                        - 4.0-flash
                      x-apidog-enum:
                        - value: '3.0'
                          name: ''
                          description: ''
                        - value: '4.0'
                          name: ''
                          description: ''
                        - value: 4.0-flash
                          name: ''
                          description: ''
                    resolution:
                      type: string
                      enum:
                        - 720p
                        - 1080p
                      x-apidog-enum:
                        - value: 720p
                          name: ''
                          description: ''
                        - value: 1080p
                          name: ''
                          description: ''
                      default: 720p
                      description: 1080p is not available for 4.0-flash
                    enable_audio:
                      type: boolean
                      default: false
                      description: >-
                        generate native audio. Default false for 3.0, true for
                        4.0 / 4.0-flash
                    multi_shots:
                      type: array
                      items:
                        $ref: '#/components/schemas/Kling%20omni%20multi%20shot'
                      description: >-
                        describe multi shots. prompt and duration will be
                        ignored if used. 3.0 only
                    images:
                      type: array
                      items:
                        type: string
                        description: valid image url for reference
                      description: >-
                        must use @image_i in prompt to reference, i starts at 1.
                        At most 10 for 4.0
                    video:
                      type: string
                      description: >-
                        valid video url for reference. Use @video in prompt to
                        reference it. Cannot be used with multi_shots. For 4.0
                        you can use videos instead (do not send both)
                    videos:
                      type: array
                      items:
                        type: string
                      description: >-
                        4.0 / 4.0-flash only. Up to 5 reference video urls; use
                        @video_1, @video_2 … in prompt. MP4, 3–30s each (Flash
                        3–20s), combined at most 30s (Flash 20s), at most 300
                        MiB each
                    audio_urls:
                      type: array
                      items:
                        type: string
                      description: >-
                        4.0 only. Up to 3 reference audio urls (MP3/WAV/FLAC,
                        5–30s, at most 50 MiB); use audio_1, audio_2 … in prompt
                    keep_original_audio:
                      type: boolean
                      default: false
                      description: >-
                        keep the original audio of the reference video. For 4.0
                        it requires enable_audio: false
                  x--orders:
                    - prompt
                    - duration
                    - aspect_ratio
                    - version
                    - resolution
                    - enable_audio
                    - multi_shots
                    - images
                    - video
                    - videos
                    - audio_urls
                    - keep_original_audio
                  x--ignore-properties: []
              x-apidog-orders:
                - model
                - task_type
                - input
                - 01JZ4Z64RY9PZ6Z3P8K0BWV7TN
              required:
                - model
                - task_type
                - input
              x-apidog-refs:
                01JZ4Z64RY9PZ6Z3P8K0BWV7TN:
                  $ref: '#/components/schemas/config'
              x--orders:
                - model
                - task_type
                - input
              x--ignore-properties: []
            examples:
              '1':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    prompt: >-
                      Close-up, static camera, a woman in swim suit near the sea
                      is introducing herself.
                    version: '3.0'
                    resolution: 720p
                    duration: 3
                    aspect_ratio: '16:9'
                    enable_audio: false
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                summary: text to video
              '2':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    multi_shots:
                      - prompt: a dog stands near sea
                        duration: 2
                      - prompt: the dog turns around and walks on beach
                        duration: 3
                    version: '3.0'
                    resolution: 720p
                    aspect_ratio: '16:9'
                    enable_audio: true
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                summary: multi shots
              '3':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    prompt: >-
                      A woman and a child are doing interview at New York
                      street. Use @image_1 as first frame
                    images:
                      - https://piapi.ai/workspace/qwen/txt_output_example.png
                    version: '3.0'
                    resolution: 720p
                    duration: 3
                    aspect_ratio: '16:9'
                    enable_audio: false
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                summary: image to video
              '4':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    prompt: Transform @video into anime style
                    video: https://example.com/sample-video.mp4
                    version: '3.0'
                    resolution: 720p
                    aspect_ratio: '16:9'
                    keep_original_audio: false
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: ''
                      secret: ''
                summary: video reference
              '5':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    prompt: >-
                      Use @video_1 as the movement reference and @image_1 as the
                      scene
                    version: '4.0'
                    resolution: 1080p
                    duration: 10
                    images:
                      - https://example.com/scene.png
                    videos:
                      - https://example.com/reference.mp4
                    enable_audio: false
                    keep_original_audio: true
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                summary: kling 4.0 video reference
              '6':
                value:
                  model: kling
                  task_type: omni_video_generation
                  input:
                    prompt: The woman in @image_1 sings along to audio_1
                    version: '4.0'
                    resolution: 720p
                    duration: 10
                    images:
                      - https://example.com/singer.png
                    audio_urls:
                      - https://example.com/song.mp3
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                summary: kling 4.0 audio reference
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties: {}
                x--orders: []
                x--ignore-properties: []
              example:
                code: 200
                data:
                  task_id: 5a9b4d8f-6f1c-460d-b295-ab1d663f9b90
                  model: kling
                  task_type: omni_video_generation
                  status: pending
                  config:
                    service_mode: public
                    webhook_config:
                      endpoint: >-
                        https://webhook.site/5468eca8-1cad-4dd3-9799-b6fbd9770fda
                      secret: ''
                  input:
                    aspect_ratio: '16:9'
                    enable_audio: true
                    multi_shots:
                      - duration: 2
                        prompt: a dog stands near sea
                      - duration: 3
                        prompt: the dog turns around and walks on beach
                    resolution: 720p
                    version: '3.0'
                  output:
                    video: ''
                  meta:
                    created_at: '2026-02-07T02:31:17.998381738Z'
                    started_at: '0001-01-01T00:00:00Z'
                    ended_at: '0001-01-01T00:00:00Z'
                    usage:
                      type: point
                      frozen: 10000000
                      consume: 0
                    is_using_private_pool: false
                  detail: null
                  logs: null
                  error:
                    code: 0
                    raw_message: ''
                    message: ''
                    detail: null
                message: success
          headers: {}
          x-apidog-name: Success
      security: []
      x-apidog-folder: Endpoints/Kling omni
      x-apidog-status: released
      x-run-in-apidog: https://app.apidog.com/web/project/675356/apis/api-27719117-run
components:
  schemas:
    Kling omni multi shot:
      type: object
      properties:
        prompt:
          type: string
          description: prompt of the shot
        duration:
          type: integer
          default: 3
          minimum: 1
          maximum: 14
          description: >-
            duraton of the shot, total duration of all shots should not exceed
            15
      x-apidog-orders:
        - prompt
        - duration
      required:
        - prompt
      x--orders:
        - prompt
        - duration
      x--ignore-properties: []
      x-apidog-folder: ''
    config:
      type: object
      properties:
        config:
          type: object
          properties:
            webhook_config:
              type: object
              properties:
                endpoint:
                  type: string
                secret:
                  type: string
              description: >-
                Webhook provides timely task notifications. Check [PiAPI
                webhook](/docs/unified-webhook) for detail.
              x-apidog-orders:
                - endpoint
                - secret
              x--orders:
                - endpoint
                - secret
              x--ignore-properties: []
            service_mode:
              type: string
              description: >
                This allows users to choose whether this specific task will get
                processed under PAYG or HYA mode. If unspecified, then this task
                will get processed under whatever mode (PAYG or HYA)
                 the user chose on the workspace setting of your account.
                - `public` means this task will be processed under PAYG mode.

                - `private` means this task will be processed under HYA mode.
              enum:
                - public
                - private
          x-apidog-orders:
            - webhook_config
            - service_mode
          x--orders:
            - webhook_config
            - service_mode
          x--ignore-properties: []
      x-apidog-orders:
        - config
      x--orders:
        - config
      x--ignore-properties: []
      x-apidog-folder: ''
  securitySchemes: {}
servers:
  - url: https://api.piapi.ai
    description: Develop Env
security: []

```
