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

# Kling Omni Generation and Editing

> Image/video references and video editing with Kling 3.0 Omni and O1.

Authenticate with your MixRoute API Key using `Authorization: Bearer $MIXROUTE_API_KEY` and send JSON. The model ID belongs in the URL, not a body `model` field. Do not add `/v1` or wrap the request in `metadata`.

## Supported Models

| Model ID                                                | Resolution        | Standard Generation Duration (s) |
| ------------------------------------------------------- | ----------------- | -------------------------------- |
| [kling-3.0-omni](/en/model-api/kuaishou/kling-3.0-omni) | 720p / 1080p / 4k | 3-15                             |
| [kling-o1](/en/model-api/kuaishou/kling-o1)             | 720p / 1080p      | 3-10                             |

## Contents

| Field                   | Type      | Required | Description                                                                                                                                                              |
| ----------------------- | --------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `contents`              | object\[] | Yes      | Text and multimodal inputs. May contain only a prompt for text generation.                                                                                               |
| `contents[].type`       | string    | Yes      | Required per item: prompt, first\_frame, last\_frame, refer\_image, feature\_video, base\_video or element.                                                              |
| `contents[].text`       | string    | By type  | Required for prompt items. 3.0 Omni: maximum 3072 characters (2500 recommended); O1: maximum 2500. Use @image\_1 or @video\_1 to reference IDs.                          |
| `contents[].url`        | string    | By type  | Required for image/video items. Images accept URLs or Base64; videos use public URLs. feature\_video supplies feature reference; base\_video supplies the video to edit. |
| `contents[].element_id` | string    | By type  | Required for element items and must be accessible to the routed upstream account.                                                                                        |
| `contents[].id`         | string    | By type  | Required for element items; optional for image/video items, but set it to reference them in prompts. Unique within a task.                                               |

## Generation Settings

| Field                   | Type    | Required    | Description                                                                                                                                              |
| ----------------------- | ------- | ----------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `settings.resolution`   | string  | No          | Defaults to 720p. 3.0 Omni: 720p/1080p/4k; O1: 720p/1080p.                                                                                               |
| `settings.duration`     | integer | No          | Defaults to 5. 3.0 Omni: 3-15; O1: 3-10. O1 with only a first frame and no refer\_image/video references supports only 5 or 10 seconds.                  |
| `settings.aspect_ratio` | string  | By scenario | 16:9 (default), 9:16 or 1:1; explicitly provide when there is neither a first frame nor a reference video.                                               |
| `settings.audio`        | string  | No          | Defaults to off. 3.0 Omni: native/original/off; O1: original/off. original preserves reference-video audio; 3.0 Omni cannot use native with video input. |
| `settings.multi_shot`   | boolean | No          | 3.0 Omni only, defaults to true. Must be true with feature\_video; set false for base\_video editing, which does not support multi-shot. Omit for O1.    |

## Input Combinations

* Both models accept at most one video; base\_video editing cannot include first/last frames.
* Use only a first frame or first+last frames, never a last frame alone. O1 first+last mode cannot include reference images or Elements. O1 feature\_video may include a first frame, not a last frame.
* O1 supports multi-image Elements only: at most 7 reference images plus Elements without a video, or 4 with a video.
* 3.0 Omni without a video allows at most 7 reference images plus multi-image Elements. With video-character Elements, use at most 3 video-character Elements and at most 4 reference images plus multi-image Elements.
* 3.0 Omni with a video allows at most 4 reference images/multi-image Elements, or 1 video-character Element; do not combine a video-character Element with images/multi-image Elements in this case. First-frame/first+last-frame generation allows up to 3 Elements.
* 3.0 Omni feature\_video requires audio=off. base\_video uses off or original. Native audio is available only without video input.

## Media Limits

| Input          | Limits                                                                                                                           |
| -------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| Images         | JPG/JPEG/PNG, at most 50 MB; both dimensions at least 300 px, aspect ratio 1:2.5 to 2.5:1.                                       |
| 3.0 Omni video | MP4/MOV, at most 200 MB, 3-15.5 s; each dimension 700-4553 px, total area at most 8294400 pixels; aspect ratio 0.4-2, 24-60 fps. |
| O1 video       | MP4/MOV, at most 200 MB, 3-10 s; each dimension 700-2160 px, 24-60 fps.                                                          |

## Storyboard Prompts

Only 3.0 Omni supports multi-shot generation. With `settings.multi_shot` enabled, use `shot n, m, words;`, separated by semicolons: 1-6 shots, at least one second per shot, durations adding up to `settings.duration`, and at most 512 characters per shot prompt. This mode is unavailable for `base_video` editing; do not send multi-shot parameters to O1. Use unique reference names that do not overlap with each other or unrelated prompt text.

## Image Reference Example

Set the `MIXROUTE_API_KEY` environment variable. Replace `example.com` media URLs with real, publicly accessible files.

```bash theme={null}
curl --request POST "https://api.mixroute.ai/kling/omni-video/kling-3.0-omni" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "contents": [
    {
      "type": "prompt",
      "text": "The mug in @image_1 slowly rotates on a white tabletop. Soft studio lighting."
    },
    {
      "type": "refer_image",
      "url": "https://example.com/reference.png",
      "id": "image_1"
    }
  ],
  "settings": {
    "resolution": "720p",
    "duration": 5,
    "aspect_ratio": "16:9",
    "audio": "native",
    "multi_shot": false
  }
}'
```

## O1 Video Editing Example

```bash theme={null}
curl --request POST "https://api.mixroute.ai/kling/omni-video/kling-o1" \
  --header "Authorization: Bearer $MIXROUTE_API_KEY" \
  --header "Content-Type: application/json" \
  --data '{
  "contents": [
    {
      "type": "prompt",
      "text": "Change the red mug in @video_1 to blue. Preserve the original motion and background."
    },
    {
      "type": "base_video",
      "url": "https://example.com/source.mp4",
      "id": "video_1"
    }
  ],
  "settings": {
    "resolution": "720p",
    "duration": 5,
    "audio": "off"
  }
}'
```

See [Kling Overview](/en/api-reference/endpoint/kling).

## Submission Response

```json theme={null}
{
  "code": 0,
  "message": "",
  "request_id": "REQUEST_ID",
  "data": {
    "id": "task_example",
    "status": "submitted"
  }
}
```

Keep `data.id` and use [Query Kling Task](/en/api-reference/endpoint/kling-tasks) until `succeeded` or `failed`. Successful submission does not mean generation has finished.
