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

# Kling 4.0 Omni

> Kling 4.0 Omni: multimodal reference-to-video and video editing with up to 10 images, 5 video clips and 3 audio clips as references.

`kling-4.0-omni` brings Kling 4.0's Omni Reference to the API: images, videos and audio are combined in one generation to keep characters, scenes and voices consistent. Besides the prompt it takes up to 10 images, 5 video clips and 3 audio clips as references and produces a 3–30 second video with synchronised audio in one generation; it can also edit an existing video. A reference video is used either as a feature reference (`feature`) or as the video to edit (`base`), and its original sound can be kept. For plain text-to-video, first-frame or first-and-last-frame generation, use [Kling 4.0](https://docs.dreamto.ai/en/video/models/kling-4-0.md).

* **Multimodal references**: up to 10 images, 5 video clips (3–30 seconds each, 30 seconds in total) and 3 audio clips, in any combination.
* **Video editing**: use the reference video as the video to edit (`base`) and change it with the prompt.
* **Feature reference**: use the reference video as a feature reference (`feature`) for a new video.
* **Original sound**: `keep_original_sound` keeps or drops the sound of the reference video.
* **Specs**: 3–30 seconds, native 720P / 1080P, upscaled 2K / 4K, aspect ratios 16:9, 9:16, 1:1, 21:9.

## Capabilities

| Mode | Parameters | Notes |
| - | - | - |
| Reference images | `prompt` + `reference_image_urls` | Up to 10 images |
| Feature reference video | `prompt` + `reference_video_urls`, `reference_video_type` set to `feature` | Up to 5 clips, 3–30 seconds each, 30 seconds in total |
| Video editing | `prompt` + `reference_video_urls`, `reference_video_type` set to `base` | `keep_original_sound` keeps the original sound |
| Reference audio | Add `reference_audio_urls` to any request above | Up to 3 mp3 clips |

## Endpoints

The API is asynchronous: create a task, poll it, and download the video from `video_url` when it completes. Set `model` to `kling-4.0-omni` and put every generation parameter inside `input`.

| Endpoint | Purpose |
| - | - |
| [`POST /v1/videos`](https://docs.dreamto.ai/en/api-reference/kling-4-0-omni/create-task) | Create a video task |
| [`GET /v1/videos/{task_id}`](https://docs.dreamto.ai/en/api-reference/kling-4-0-omni/query-task) | Query a video task |

## Quick start

Create a task to get a `task_id`, poll every 10–15 seconds, and download `video_url` once `status` is `completed`. `$DREAMTO_API_KEY` is your API Key.

```bash cURL theme={null}
# 1. Create the task
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4.0-omni",
    "input": {
      "prompt": "The girl from the first image and the fox from the second image walk together through a snowy forest, cinematic",
      "reference_image_urls": [
        "https://your-cdn.example.com/girl.png",
        "https://your-cdn.example.com/fox.png"
      ],
      "resolution": "1080P",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'

# 2. Query the task
curl "https://api.dreamto.ai/v1/videos/job_02b88886c4fda5be35baff61" \
  -H "Authorization: Bearer $DREAMTO_API_KEY"
```

```python Python theme={null}
import os
import time

import requests

BASE_URL = "https://api.dreamto.ai"
HEADERS = {"Authorization": f"Bearer {os.environ['DREAMTO_API_KEY']}"}

payload = {
    "model": "kling-4.0-omni",
    "input": {
        "prompt": "The girl from the first image and the fox from the second image walk together through a snowy forest, cinematic",
        "reference_image_urls": [
            "https://your-cdn.example.com/girl.png",
            "https://your-cdn.example.com/fox.png"
        ],
        "resolution": "1080P",
        "duration": 5,
        "aspect_ratio": "16:9"
    }
}

task = requests.post(f"{BASE_URL}/v1/videos", headers=HEADERS, json=payload, timeout=60).json()
task_id = task["task_id"]
while task["status"] not in ("completed", "failed"):
    time.sleep(10)
    task = requests.get(f"{BASE_URL}/v1/videos/{task_id}", headers=HEADERS, timeout=60).json()
print(task["status"], task.get("video_url"), task.get("error"))
```

## Generation modes

### Reference images

Send several reference images and say in the prompt what each one is for.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4.0-omni",
    "input": {
      "prompt": "The girl from the first image and the fox from the second image walk together through a snowy forest, cinematic",
      "reference_image_urls": [
        "https://your-cdn.example.com/girl.png",
        "https://your-cdn.example.com/fox.png"
      ],
      "resolution": "1080P",
      "duration": 5,
      "aspect_ratio": "16:9"
    }
  }'
```

### Reference image and audio

A reference image plus reference audio, with 21:9 ultra-wide output.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4.0-omni",
    "input": {
      "prompt": "The girl from the reference image speaks to the camera with the voice of the reference audio, on a beach at dusk",
      "reference_image_urls": [
        "https://your-cdn.example.com/girl.png"
      ],
      "reference_audio_urls": [
        "https://your-cdn.example.com/voice.mp3"
      ],
      "resolution": "720P",
      "duration": 5,
      "aspect_ratio": "21:9"
    }
  }'
```

### Feature reference video

`reference_video_type` set to `feature`: the video is a feature reference for a new video. Requests with a reference video are billed at the with-reference-video price.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4.0-omni",
    "input": {
      "prompt": "Follow the camera movement of the reference video to film a red sports car driving along a desert road",
      "reference_video_urls": [
        "https://your-cdn.example.com/reference.mp4"
      ],
      "reference_video_type": "feature",
      "resolution": "720P",
      "duration": 5
    }
  }'
```

### Video editing

`reference_video_type` set to `base`: the video is edited as the prompt says; `keep_original_sound: true` keeps its sound.

```bash cURL theme={null}
curl -X POST "https://api.dreamto.ai/v1/videos" \
  -H "Authorization: Bearer $DREAMTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kling-4.0-omni",
    "input": {
      "prompt": "Change the season in the video from summer to a snowy winter; keep the people and their motion unchanged",
      "reference_video_urls": [
        "https://your-cdn.example.com/reference.mp4"
      ],
      "reference_video_type": "base",
      "keep_original_sound": true,
      "resolution": "720P",
      "duration": 5
    }
  }'
```

## Parameters

All parameters below go inside `input` in the request body.

| Parameter | Type | Required | Default | Values | Description |
| - | - | - | - | - | - |
| `prompt` | string | Yes | — | — | The prompt (required): describes the video and says how each reference is used. |
| `reference_image_urls` | string\[] | No | — | Up to 10 items | Public URLs of the reference images, up to 10. jpeg / jpg / png, up to 10MB each. |
| `reference_video_urls` | string\[] | No | — | Up to 5 items | Public URLs of the reference videos, up to 5 clips. mp4 / mov, 3–30 seconds each and 30 seconds in total. With a reference video the request is billed at the with-reference-video price; the billable duration is the reference video duration plus the output duration (when the reference video is longer than the output) or twice the output duration. |
| `reference_video_type` | string | No | — | `feature` / `base` | How the reference video is used. Only applies when `reference_video_urls` is sent. |
| `keep_original_sound` | boolean | No | — | `true` / `false` | Whether to keep the original sound of the reference video. Only applies when `reference_video_urls` is sent. |
| `reference_audio_urls` | string\[] | No | — | Up to 3 items | Public URLs of the reference audio clips, up to 3. mp3. |
| `resolution` | string | No | `720P` | `720P` / `1080P` / `2K` / `4K` | Output resolution. Defaults to `720P`. |
| `duration` | integer | No | `5` | `3`–`30` | Output duration in seconds, an integer from `3` to `30`. Defaults to `5`. |
| `aspect_ratio` | string | No | — | `16:9` / `9:16` / `1:1` / `21:9` | Output aspect ratio. |

See [Create a video task](https://docs.dreamto.ai/en/api-reference/kling-4-0-omni/create-task.md) for the full request and response definitions.

## Response and task status

Creating a task returns `task_id`, `status`, `model`, `created_at` and `request_id`. Querying it additionally returns `completed_at` (once finished), `video_url` (on success) and `error` (on failure).

| `status` | Meaning |
| - | - |
| `queued` | Waiting in the queue. |
| `in_progress` | Being generated. |
| `completed` | Finished; download the video from `video_url`. |
| `failed` | Failed; see `error` for the reason. Not charged. |

Query response of a completed task:

```json theme={null}
{
  "task_id": "job_02b88886c4fda5be35baff61",
  "status": "completed",
  "model": "kling-4.0-omni",
  "created_at": 1794846663,
  "completed_at": 1794847019,
  "request_id": "req_6a9a539502118ba1c33f1bfc",
  "video_url": "https://cdn.example.com/videos/02b88886c4fda5be35baff61.mp4"
}
```

Query response of a failed task:

```json theme={null}
{
  "task_id": "job_02b88886c4fda5be35baff61",
  "status": "failed",
  "model": "kling-4.0-omni",
  "created_at": 1794846663,
  "completed_at": 1794847019,
  "request_id": "req_6a9a539502118ba1c33f1bfc",
  "error": {
    "type": "api_error",
    "message": "InvalidParameterValue: Please input the ImageURL that can be retrieved from the external network."
  }
}
```

## Pricing

Billed per billable second at the price of the chosen resolution. Without a reference video the billable duration is the output duration. With a reference video the "with reference video" price applies and the billable duration is the reference video duration plus the output duration when the reference video is longer than the output, otherwise twice the output duration.

| Resolution | Without a reference video (per second) | With a reference video (per second) |
| - | - | - |
| 720P | \$0.157 / ¥1.0 | \$0.0942 / ¥0.6 |
| 1080P | \$0.2355 / ¥1.5 | \$0.1413 / ¥0.9 |
| 2K | \$0.2826 / ¥1.8 | \$0.16956 / ¥1.08 |
| 4K | \$0.471 / ¥3.0 | \$0.471 / ¥3.0 |

These are list prices; the model price shown in the console is authoritative. Failed tasks and invalid requests are not charged.

## Limits and notes

* `video_url` is valid for 7 days after the task completes; download the video and keep it in your own storage.
* Input media must be publicly downloadable URLs; media hosted outside mainland China works as well.
* Every generated video includes audio; this model has no parameter to turn it off.
* Reference videos are mp4 / mov, 3–30 seconds each and 30 seconds in total; reference audio is mp3.
* `reference_video_type` and `keep_original_sound` only apply when `reference_video_urls` is sent.
* 2K and 4K are upscaled output and are billed at the price of that resolution.
* A failed task returns `status: "failed"` with the reason in `error.message` (for example `InvalidParameterValue: Please input the ImageURL that can be retrieved from the external network.`) and is not charged.
* When a task is created, the estimated price of the request is reserved from the balance and settled to the actual usage when the task completes: resolution price × duration without a reference video, and the with-reference-video price × (output duration + 30 seconds) with one. With an insufficient balance the create request returns HTTP 402 (`insufficient_balance`) and no task is created.
* An invalid request returns HTTP 400; no task is created and nothing is charged. When the duration or a media count is out of range, the message names the field and the allowed range (in the form `input.duration must be a number between <min> and <max>`). When an enum parameter such as `resolution` or `aspect_ratio` has a value outside its allowed list, the message is generic and does not name the field, so check the request against the parameter table. Media formats and content are checked by the model: a violation ends the task as `failed`, also without a charge.
* A video takes several minutes; poll the task every 10–15 seconds, not faster.


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