Generate Images with KOLORS Elements
July 18, 2025 (October 1, 2025)
Table of contents
This endpoint generates images using Kling’s KOLORS v2.0 with multiple image elements (up to 4 subject images, plus optional scene and style images) that will appear as elements in the generated image. This allows for more complex compositions with multiple reference images.
https://api.useapi.net/v1/kling/images/kolors-elements
Request Headers
Authorization: Bearer {API token}
Content-Type: application/json
# Alternatively you can use multipart/form-data
# Content-Type: multipart/form-data
API tokenis required, see Setup useapi.net for details.
Request Body
{
"email": "[email protected]",
"prompt": "A digital art gallery with modern paintings and sculptures on display",
"subjectImage1": "https://example.com/painting1.jpg",
"subjectImage2": "https://example.com/sculpture1.jpg",
"subjectImage3": "https://example.com/painting2.jpg",
"subjectImage4": "https://example.com/decoration.jpg",
"sceneImage": "https://example.com/gallery-background.jpg",
"styleImage": "https://example.com/art-style.jpg",
"aspect_ratio": "16:9",
"imageCount": 1,
"replyUrl": "https://your-callback-url.com/webhook",
"replyRef": "your-reference-id"
}
-
emailis optional when only one account configured.
However, if you have multiple accounts configured, this parameter becomes required. -
promptis optional, the text description of the image to generate.
Maximum length: 2500 characters. -
subjectImage1,subjectImage2,subjectImage3andsubjectImage4are optional URLs to subject images that will appear as elements in the generated image.
Images can be uploaded using POST /assets and the returned URLs can be used here. -
sceneImageis optional, URL to a scene/background image.
Image can be uploaded using POST /assets and the returned URLs can be used here. -
styleImageis optional, URL to a style reference image.
Image can be uploaded using POST /assets and the returned URLs can be used here. -
aspect_ratiois optional, the aspect ratio of the generated image.
Supported values:1:1,16:9(default),4:3,3:2,2:3,3:4,9:16,21:9. -
imageCountis optional, the number of images to generate.
Range:1to9. Default:1. -
maxJobsis optional, range from1to50.
Specifies the maximum number of concurrent jobs. -
replyUrlis optional, a callback URL to receive generation progress and result.
See GET /tasks/task_idfor response model. -
replyRefis optional, a reference identifier for the callback.
Note: At least two images must be provided (any combination of subjectImage1-4, sceneImage, or styleImage).
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "mmu_multi_img2img_aiweb", "scene": "NORMAL_CREATION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "mmu_multi_img2img_aiweb", "inputs": [ { "name": "subject_image_0", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/painting1.jpg", "cover": null, "fromWorkId": null }, { "name": "raw_subject_image_0", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/painting1.jpg", "cover": null, "fromWorkId": null }, { "name": "subject_image_1", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/sculpture1.jpg", "cover": null, "fromWorkId": null }, { "name": "scene_image", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://example.com/gallery-background.jpg", "cover": null, "fromWorkId": null } ], "arguments": [ { "name": "prompt", "value": "A digital art gallery with modern paintings and sculptures on display" }, { "name": "aspect_ratio", "value": "16:9" }, { "name": "imageCount", "value": "1" }, { "name": "kolors_version", "value": "2.0" }, { "name": "img_resolution", "value": "2k" }, { "name": "style", "value": "默认" }, { "name": "imageList", "value": "[{\"top\":0,\"left\":0,\"width\":1,\"height\":1},{\"top\":0,\"left\":0,\"width\":1,\"height\":1}]" }, { "name": "biz", "value": "klingai" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "NORMAL_CREATION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1745376611075, "updateTime": 1745376611075 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "limitation": { "type": "mmu_multi_img2img_aiweb", "remaining": 10000, "limit": 10000 }, "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null } -
{ "error": "At least two images must be provided" } -
{ "error": "Unauthorized", "code": 401 } -
Kling was unable to locate one of the referenced assets. Make sure to use POST /assets to upload assets.
{ "error": "Sorry, the requested resource was not found (VALID.ResourceNotFound)", "message": "Not Found" } -
Kling uses a
500response to indicate moderation and other issues with the input. It may be hard to separate actual 500 errors from moderation errors, so use theerrorfield text and your best judgement to tell them apart, since themessagefield most often has very generic and perhaps misleading text.{ "error": "The content you uploaded appears to violate the community guidelines. (CM_EXT.POther)", "message": "Service busy (CM_EXT.POther)" }
When successful, the response includes a task ID which can be used to check the status using GET /tasks/task_id.
Model
{ // TypeScript, all fields are optional
task: {
id: number
userId: number
type: string
scene: string
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
taskInfo: {
type: string
inputs: Array<{
name: string
inputType: string
token: string | null
blobStorage: any | null
url: string
cover: string | null
fromWorkId: number | null
}>
arguments: Array<{
name: string
value: string
}>
extraArgs: Record<string, any>
callbackPayloads: any[]
scene: string
}
favored: boolean
deleted: boolean
viewed: boolean
createTime: number
updateTime: number
viewTime: number
}
works: Array<any>
status: number
status_name: 'submitted' | 'failed' | 'processing' | 'succeed'
status_final: boolean
message: string
error: string
limitation: {
type: string
remaining: number
limit: number
}
userPoints: {
points: Array<{
orderId: string
type: string
amount: number
balance: number
startTime: number
endTime: number
}>
total: number
}
userTickets: {
ticket: Array<{
orderId: string
type: string
packageType: string
amount: number
balance: number
startTime: number
endTime: number
}>
}
editProject: any | null
}
Examples
-
curl -X POST "https://api.useapi.net/v1/kling/images/kolors-elements" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "[email protected]", "prompt": "A digital art gallery with modern paintings and sculptures on display", "subjectImage1": "https://example.com/painting1.jpg", "subjectImage2": "https://example.com/sculpture1.jpg", "sceneImage": "https://example.com/gallery-background.jpg" }' -
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/images/kolors-elements"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, prompt: "A digital art gallery with modern paintings and sculptures on display", subjectImage1: "https://example.com/painting1.jpg", subjectImage2: "https://example.com/sculpture1.jpg", sceneImage: "https://example.com/gallery-background.jpg" }) }); const result = await response.json(); console.log("response", {response, result}); -
import requests token = "API token" email = "Previously configured account email" apiUrl = "https://api.useapi.net/v1/kling/images/kolors-elements" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "prompt": "A digital art gallery with modern paintings and sculptures on display", "subjectImage1": "https://example.com/painting1.jpg", "subjectImage2": "https://example.com/sculpture1.jpg", "sceneImage": "https://example.com/gallery-background.jpg" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())