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

# Kling Omni Reference Video kling-4.0

> Submit a Kling 4.0 omni reference video task via `/kling/omni-video`; the model is specified by `model_name`. Supports images and videos as reference materials, and accepts a base video for video editing. Query task status with `GET /kling/tasks`. Note: The platform does not yet integrate elements (`element`) or voices (`voice`); the related parameters are not supported yet.



## OpenAPI

````yaml api-reference/en/zmodelVideo/kling/kling-4.0-omni-video.json POST /kling/omni-video
openapi: 3.0.1
info:
  title: Kling 4.0 Omni Reference Video Task - Submit Task
  version: 1.0.0
  description: >-
    Submit a Kling 4.0 omni reference video task via `/kling/omni-video`,
    supporting images and videos as references, as well as video editing. Query
    task status with `GET /kling/tasks`. Note: The platform does not yet
    integrate elements (`element`) or voices (`voice`); the related parameters
    are not supported yet.
servers:
  - url: https://api.powertokens.ai
    description: ''
security: []
tags:
  - name: Kling
    description: Kling native async task endpoints
paths:
  /kling/omni-video:
    post:
      tags:
        - Kling
      summary: Kling 4.0 Omni Reference Video Task
      description: >-
        Submit a Kling 4.0 omni reference video task via `/kling/omni-video`;
        the model is specified by `model_name`. Supports images and videos as
        reference materials, and accepts a base video for video editing. Query
        task status with `GET /kling/tasks`. Note: The platform does not yet
        integrate elements (`element`) or voices (`voice`); the related
        parameters are not supported yet.
      operationId: createKlingOmniVideo4
      parameters:
        - name: Content-Type
          in: header
          required: true
          schema:
            type: string
            default: application/json
          description: Data exchange format
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/Kling4OmniRequest'
            examples:
              reference_video_and_image:
                summary: Feature reference video + reference images
                value:
                  model_name: kling-4.0
                  contents:
                    - type: prompt
                      text: >-
                        Follow the camera movement and pacing of @video_1,
                        replace the subject with the car in @image_1, and the
                        background with @image_2.
                    - type: feature_video
                      url: >-
                        https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release-note/ch12_3_camera_motion_source.mp4
                      id: video_1
                    - type: refer_image
                      url: >-
                        https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release-note/ch12_3_race_car_ref.png
                      id: image_1
                    - type: refer_image
                      url: >-
                        https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release-note/ch12_3_neon_arena_ref.png
                      id: image_2
                  settings:
                    resolution: 1080p
                    aspect_ratio: adaptive
              video_edit:
                summary: Video editing
                value:
                  model_name: kling-4.0
                  contents:
                    - type: prompt
                      text: >-
                        Edit @video_1 to remove the person in the foreground;
                        keep everything else unchanged.
                    - type: base_video
                      url: >-
                        https://p2-kling.klingai.com/kcdn/cdn-kcdn112452/kling-tob-release-note/ch12_5_guitar_foreground_source.mp4
                      id: video_1
                  settings:
                    resolution: 1080p
                    aspect_ratio: adaptive
      responses:
        '200':
          description: Task accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
              examples:
                response:
                  summary: Response example
                  value:
                    code: 0
                    message: string
                    request_id: string
                    data:
                      id: string
                      status: submitted
                      create_time: 1781080778802
                      update_time: 1781080794151
                      external_id: string
      security:
        - bearerAuth: []
components:
  schemas:
    Kling4OmniRequest:
      type: object
      required:
        - model_name
        - contents
      properties:
        model_name:
          type: string
          enum:
            - kling-4.0
          description: Model name
          example: kling-4.0
        contents:
          type: array
          description: >-
            Materials for generation, such as prompts, images, videos, elements,
            and voices. Must include a `type=prompt` item.

            - Up to 10 images

            - Images + videos + elements + voices must not exceed 15 in total

            - Up to 7 elements, of which at most 3 video character elements

            - Up to 5 reference videos; with video character elements, the total
            of elements and reference videos must not exceed 5; at most 1
            `base_video`

            - Up to 3 voices

            - When `first_frame`, `last_frame`, and `refer_image` coexist, keep
            `first_frame` first and `last_frame` last


            Note: Elements (`element`) and voices (`voice`) are not yet
            integrated and cannot be used.
          minItems: 1
          items:
            $ref: '#/components/schemas/Kling4OmniContent'
        settings:
          $ref: '#/components/schemas/Kling4OmniSettings'
        options:
          $ref: '#/components/schemas/Kling4OmniOptions'
    SubmitResponse:
      type: object
      properties:
        code:
          type: integer
          description: Error code; see the error code documentation.
        message:
          type: string
          description: Error message.
        request_id:
          type: string
          description: Request ID generated by the system for tracking and troubleshooting.
        data:
          type: object
          properties:
            id:
              type: string
              description: System-generated task ID.
            status:
              type: string
              enum:
                - submitted
                - processing
                - succeeded
                - failed
              description: 'Task status: submitted, processing, succeeded, or failed.'
            create_time:
              type: integer
              format: int64
              description: Task creation time as a Unix timestamp in milliseconds.
            update_time:
              type: integer
              format: int64
              description: Task update time as a Unix timestamp in milliseconds.
            external_id:
              type: string
              description: Custom task ID of this task, if any.
    Kling4OmniContent:
      type: object
      required:
        - type
      properties:
        type:
          type: string
          enum:
            - prompt
            - first_frame
            - middle_frame
            - last_frame
            - refer_image
            - feature_video
            - base_video
            - element
            - voice
          description: >-
            Material type: prompt (`prompt`), keyframe image (`first_frame` /
            `middle_frame` / `last_frame`), reference image (`refer_image`),
            feature reference video (`feature_video`), base video to edit
            (`base_video`), element (`element`), or voice (`voice`). Elements
            (`element`) and voices (`voice`) are not yet integrated and cannot
            be used.
        text:
          type: string
          description: >-
            Prompt text, required when `type=prompt`.

            - Up to 26,000 characters for pure English, 11,000 for pure
            non-English

            - Mixed input must satisfy: English characters/26000 + non-English
            characters/11000 ≤ 1

            - Organize the prompt as material usage, overall setup,
            scene-by-scene events, and audio requirements, and reference
            materials with `@id`
          x-valid-when:
            type:
              - prompt
        url:
          type: string
          description: >-
            Image or video URL, required for image and video materials.


            Images (`first_frame` / `middle_frame` / `last_frame` /
            `refer_image`):

            - Accepts URL or Base64, formats .jpg / .jpeg / .png, up to 30 MB
            each

            - At least 300 px in width and height, aspect ratio 2:5–5:2


            Videos (`feature_video` / `base_video`):

            - URL only, formats .mp4 / .mov, up to 300 MB

            - Each video and the total video duration must be between 3 and 30
            seconds

            - Dimensions between 700 and 4553 px, total pixels at most 8294400,
            aspect ratio 2:5–5:2

            - Supports 24–60 fps input; output frame rate is 24 fps
          x-valid-when:
            type:
              - first_frame
              - middle_frame
              - last_frame
              - refer_image
              - feature_video
              - base_video
        element_id:
          type: string
          description: >-
            Element ID generated by the system, required when `type=element`.
            Elements are either video character elements or multi-image
            elements, with different applicable scopes. Note: Elements are not
            yet integrated; this parameter is not supported yet.
          x-valid-when:
            type:
              - element
        voice_id:
          type: string
          description: >-
            Voice ID generated by the system, required when `type=voice`. Up to
            3 voices are supported. Note: Voices are not yet integrated; this
            parameter is not supported yet.
          x-valid-when:
            type:
              - voice
        id:
          type: string
          description: >-
            Material index ID used to reference the material in the prompt via
            `@<id>`. Must be unique within the same task. Required when there
            are multiple middle frames or reference images.
    Kling4OmniSettings:
      type: object
      properties:
        audio:
          type: string
          enum:
            - native
            - original
          default: native
          description: >-
            How the generated video handles audio.

            - `native`: generate audio matching the visuals

            - `original`: keep the original audio of the input video. Cannot be
            combined with voice references; at least one `base_video` or
            `feature_video` is required


            Note: Voice references are not yet integrated.
        resolution:
          type: string
          enum:
            - 720p
            - 1080p
            - 4k
          default: 1080p
          description: |-
            Video resolution.
            - `720p`: 720P output
            - `1080p`: 1080P output
            - `4k`: 4K output
        aspect_ratio:
          type: string
          enum:
            - '21:9'
            - '16:9'
            - '9:16'
            - '1:1'
            - '4:3'
            - '3:4'
            - adaptive
          default: adaptive
          description: >-
            Aspect ratio (width:height) of the generated video. Any valid ratio
            other than `adaptive` takes precedence over the prompt; with
            `adaptive`, the ratio recognized from the prompt is used first, then
            the base video, keyframe images, and feature video in order,
            defaulting to 16:9 when none applies.
        duration:
          type: integer
          minimum: 3
          maximum: 30
          description: >-
            Target video duration in seconds; supports integers from 3 to 30.

            - When set, this value takes precedence over any duration in the
            prompt

            - When omitted, the explicit duration recognized from the prompt is
            used

            - When omitted and no explicit duration is found in the prompt, uses
            the rounded duration of `base_video` if provided, otherwise 10
            seconds


            The final target duration is used for billing and is available as
            `usage.output_duration` in the task query response.
    Kling4OmniOptions:
      type: object
      properties:
        callback_url:
          type: string
          description: >-
            Callback URL for task results. When configured, the server notifies
            you whenever the task status changes.
        external_task_id:
          type: string
          description: >-
            Custom task ID.

            - It does not override the system-generated task ID, but can be used
            to query the task

            - Must be unique per user
        watermark_info:
          type: object
          description: >-
            Whether to also generate a watermarked result. Configured with
            `enabled`; custom watermarks are not supported.
          properties:
            enabled:
              type: boolean
              default: false
              description: '`true` generates a watermarked result, `false` does not.'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'Pass `Authorization: Bearer <token>` in the request header.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.