Skip to main content
POST
/
kling
/
v1
/
images
/
omni-image
cURL
curl https://api.cometapi.com/kling/v1/images/omni-image \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model_name": "kling-v3-omni",
    "prompt": "Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.",
    "image_list": [
      {
        "image": "https://your-image-host/reference.png"
      }
    ],
    "resolution": "1k",
    "result_type": "single",
    "n": 1,
    "aspect_ratio": "3:2"
  }'
import os
import requests

response = requests.post(
"https://api.cometapi.com/kling/v1/images/omni-image",
headers={"Authorization": "Bearer " + os.environ["COMETAPI_KEY"]},
json={
"model_name": "kling-v3-omni",
"prompt": "Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.",
"image_list": [
{
"image": "https://your-image-host/reference.png",
}
],
"resolution": "1k",
"result_type": "single",
"n": 1,
"aspect_ratio": "3:2",
},
)

result = response.json()
print(result["data"]["task_id"])
const response = await fetch("https://api.cometapi.com/kling/v1/images/omni-image", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.COMETAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
model_name: "kling-v3-omni",
prompt: "Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.",
image_list: [
{
image: "https://your-image-host/reference.png",
},
],
resolution: "1k",
result_type: "single",
n: 1,
aspect_ratio: "3:2",
}),
});

const result = await response.json();
console.log(result.data.task_id);
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.cometapi.com/kling/v1/images/omni-image",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'prompt' => 'Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://api.cometapi.com/kling/v1/images/omni-image"

payload := strings.NewReader("{\n \"prompt\": \"Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://api.cometapi.com/kling/v1/images/omni-image")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"prompt\": \"Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.cometapi.com/kling/v1/images/omni-image")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"prompt\": \"Using <<<image_1>>> as a visual reference, generate a cinematic portrait of a product designer in a sunlit studio.\"\n}"

response = http.request(request)
puts response.read_body
{
  "code": 0,
  "message": "SUCCEED",
  "data": {
    "task_id": "<task_id>",
    "task_info": {
      "external_task_id": null
    },
    "task_status": "submitted",
    "created_at": 1782436687105,
    "updated_at": 1782436687105
  }
}
Use this endpoint to create an asynchronous Kling Omni Image task through CometAPI. The create request returns a task_id; use Get a Kling Omni image task to poll the task until the generated image URLs are available.
For the complete provider parameter reference, see the Kling Image O1 documentation.

Choose the request shape

  • Single-image generation: send prompt, image_list, resolution, result_type: single, n, and aspect_ratio
  • Watermarked output: add watermark_info.enabled: true when you need a watermarked result URL in the query response
  • Model ID: omit model_name to use the route default, or send a tested Omni Image model ID such as kling-image-o1 or kling-v3-omni
Reference images use image_list items with an image field. The prompt can cite them by index, such as <<<image_1>>> for the first item and <<<image_2>>> for the second item.

Task flow

1

Create the task

Submit POST /kling/v1/images/omni-image and store the returned data.task_id.
2

Query the task

Poll GET /kling/v1/images/omni-image/ until data.task_status is succeed or failed.
3

Persist the images

When the task succeeds, copy data.task_result.images[].url into your own storage if you need durable access.
For the full response schema and polling examples, see Get a Kling Omni image task. The following short example polls one task until it reaches a terminal state:
TASK_ID="<task_id>"

while true; do
  STATUS=$(curl -s "https://api.cometapi.com/kling/v1/images/omni-image/$TASK_ID" \
    -H "Authorization: Bearer $COMETAPI_KEY" \
    | python3 -c "import json,sys; print(json.load(sys.stdin)['data']['task_status'])")

  echo "status: $STATUS"
  case "$STATUS" in succeed | failed) break;; esac
  sleep 30
done

Result fields

Successful query responses return generated images under data.task_result.images. Each item can include:
FieldDescription
indexPosition of the generated image in the task result.
urlGenerated image URL.
watermark_urlWatermarked image URL when watermark output is requested.
Generated asset URLs can expire or be cleared by the provider service. Store the finished images in your own storage layer when your workflow needs long retention.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI API key.

Headers

Content-Type
string

Must be application/json.

Body

application/json
prompt
string
required

Text prompt for the generated image. The prompt can reference images with <<<image_1>>>, <<<image_2>>>, and matching indexes from image_list. Maximum length is 2,500 characters.

model_name
string

Optional model ID for this Omni Image request. Omit this field to use the route default.

image_list
object[]

Reference images that the prompt can cite with <<<image_1>>>, <<<image_2>>>, and so on. Keep the total number of reference images within the provider limits for the selected model.

resolution
enum<string>
default:1k

Requested output resolution. Use 1k, 2k, or 4k; omitted requests use 1k.

Available options:
1k,
2k,
4k
result_type
enum<string>
default:single

Use single for a single-image task.

Available options:
single
n
integer
default:1

Number of single-image results to generate. Range: 1 to 9.

Required range: 1 <= x <= 9
aspect_ratio
enum<string>
default:auto

Requested output aspect ratio in width:height format. Use auto to let the provider choose from the prompt and references.

Available options:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9,
auto
watermark_info
object

Watermark options. When enabled is true, the task can return watermarked result URLs in addition to the original result URLs.

callback_url
string<uri>

Webhook URL that receives task status notifications when the task status changes. Omit this field to poll manually.

external_task_id
string

User-defined task ID for your own tracking. It does not replace the system-generated task_id and must be unique per account.

Response

200 - application/json

Task accepted.

code
integer
required

Response code. 0 means the task request was accepted.

message
string
required

Response message.

data
object
required
request_id
string

Request identifier returned by CometAPI when present.