MaasUnionMaasUnion
API Reference
AI Model APIImagesKling Omni Image

Create Kling Omni Image Task

API Reference

  • Gateway path: POST /kling/v1/images/omni
  • Upstream capability: Kling OmniImage (/v1/images/omni-image)
  • Official reference: Kling OmniImage API

Overview

The image Omni model can generate images from prompts combined with images, subjects, etc. Reference materials in the prompt using <<<>>>:

  • <<<image_1>>> — the 1st reference image
  • <<<object_1>>> / <<<element_1>>> — the 1st subject

The gateway keeps the request/response format consistent with the official Kling OmniImage API; the request body is forwarded upstream as-is. No need to use images/generations / image2image style calls.

Supported Models

model_nameDescription
kling-image-o1Base image Omni model
kling-v3-omniSupports series and other advanced features

Authentication

HeaderRequiredDescription
AuthorizationYesBearer {your_api_token}, e.g. Bearer sk-xxxxxxxx
Content-TypeRequired for POSTapplication/json

Request Body Parameters

ParameterTypeRequiredDefaultDescription
model_namestringYesModel name: kling-image-o1, kling-v3-omni
promptstringYesText prompt, ≤ 2500 characters. You can reference materials via <<<image_N>>> and <<<element_N>>>
image_listarrayNoReference image list, see below
element_listarrayNoSubject reference list, see below
resolutionstringNo1kResolution: 1k, 2k, 4k
result_typestringNosingleResult type: single (single image) / series (series of images)
nintNo1Number of images [1, 9]. Invalid when result_type=series
series_amountint/stringNo4Series count: 29 or auto. Invalid when result_type=single
aspect_ratiostringNoautoAspect ratio: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9, auto
watermark_infoobjectNoWatermark config, e.g. {"enabled": false}
callback_urlstringNoCallback URL for task status change
external_task_idstringNoCustom task ID (unique on user side)

image_list[]

ParameterTypeRequiredDescription
imagestringYesImage URL or Base64 (supports data:image/...;base64, prefix, auto-normalized by the gateway)

The image_url field is also accepted; the gateway converts it to the official image field.

element_list[]

ParameterTypeRequiredDescription
element_idlongYesSubject ID in the Kling subject library

Request Examples

Multi-image + Subject Reference

curl --request POST \
  --url "https://www.maasunion.com/kling/v1/images/omni" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-image-o1",
    "prompt": "将所有图片中的人物融合到<<<element_1>>>图中",
    "element_list": [
      { "element_id": 829836802793406551 }
    ],
    "image_list": [
      { "image": "https://example.com/a.png" },
      { "image": "https://example.com/b.png" }
    ],
    "resolution": "2k",
    "n": 1,
    "aspect_ratio": "3:2"
  }'

Series (kling-v3-omni)

curl --request POST \
  --url "https://www.maasunion.com/kling/v1/images/omni" \
  --header "Authorization: Bearer sk-xxxxxxxx" \
  --header "Content-Type: application/json" \
  --data '{
    "model_name": "kling-v3-omni",
    "prompt": "Generate a recommended cover for each subject <<<element_1>>> based on the style of <<<image_1>>>",
    "element_list": [
      { "element_id": 160 },
      { "element_id": 161 }
    ],
    "image_list": [
      { "image": "https://example.com/style.png" }
    ],
    "resolution": "2k",
    "result_type": "series",
    "series_amount": 2,
    "aspect_ratio": "auto"
  }'

Response Example (200)

{
  "code": 0,
  "message": "string",
  "request_id": "string",
  "data": {
    "task_id": "string",
    "task_info": {
      "external_task_id": "string"
    },
    "task_status": "submitted",
    "created_at": 1722769557708,
    "updated_at": 1722769557708
  }
}
FieldDescription
codeError code; 0 means success
data.task_idGateway task ID (used for subsequent queries)
data.task_statussubmitted / processing / succeed / failed

Parameter Reference

result_type: single vs series

Parameterresult_type: "single"result_type: "series"
n✅ effective (1–9)❌ invalid
series_amount❌ invalid✅ effective (2–9 or auto)
Response fieldtask_result.images[]task_result.series_images[]

resolution

ValueMeaning
1k1K standard
2k2K HD
4k4K HD

aspect_ratio

ValueRatio
16:9Landscape
9:16Portrait
1:1Square
4:3 / 3:4Traditional landscape/portrait
3:2 / 2:3Wide/narrow portrait
21:9Ultrawide
autoAuto-selected based on input

Capability Matrix

Featurekling-image-o1kling-v3-omni
Image-to-Image
Subject Reference
Single image
Series
1K / 2K / 4K

Differences vs. Legacy Image Endpoints

Comparison/kling/v1/images/omni/kling/v1/images/generations, etc.
ModelOmni image modelTraditional Kling image model
ParametersFull official Omni parametersText-to-image/image-to-image/edit-specific parameters
Series✅ (v3-omni)
Subject element_listPartial support
Request formatConsistent with the official OmniImageGateway-converted format

Error Handling

When code != 0, the request fails and message contains the error description. Common cases:

  • model_name or prompt missing
  • Invalid token or insufficient balance
  • Upstream parameter validation failure
  • Content moderation (see task_status=failed and task_status_msg on query)

How is this guide?