Enhance Images
October 15, 2026 (November 16, 2026)
Table of contents
This endpoint runs Kling’s Image Enhancing, which enhances the quality of an image and restores its details. It takes any image URL, for example one uploaded via POST /assets.
POST /images/upscale works only on an image Kling generated, identified by its task_id and workId. This endpoint takes any image URL instead.
Enhancing costs 1 Kling credit at 2k and 2 credits at 4k. The output size depends on the input image. For example, an 800×1200 image came back as 1664×2496 with 2k, and a 768×1344 image came back as 1536×2704 with 4k.
https://api.useapi.net/v1/kling/images/enhance
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": "user@example.com",
"image": "https://s21-kling.klingai.com/ai-platform/xxx/xxx.jpg",
"resolution": "2k"
}
-
emailis optional. Leave it out and the job goes to one of your accounts that has a free job slot, picked at random. Each account runs at most itsmaxJobsjobs at once, and GET scheduler/available shows the free slots. If no account has a free slot, the response is429.
Passemailto run the job on that account (429if it is busy). Uploaded files, elements, voices, avatars and earlier tasks belong to one account, so pass theemailof the account they came from.
With more than one account, reading the task with GET tasks/task_idneeds its account’semail. The response’stask.userIdis that account’ssession.userIdin GET accounts, and GET scheduler lists each running task with itsemail. -
imageis required, the URL of the image to enhance.
You can upload an image via POST /assets and use the returned URL. -
resolutionis optional.
Supported values:2k(1 credit),4k(2 credits).
Default:2k. -
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.
Responses
-
{ "task": { "id": 123456789, "userId": 12345, "type": "mmu_image_refiner", "scene": "NORMAL_CREATION", "status": 5, "status_name": "submitted", "status_final": false, "taskInfo": { "type": "mmu_image_refiner", "inputs": [ { "name": "input", "inputType": "URL", "token": null, "blobStorage": null, "url": "https://s21-kling.klingai.com/ai-platform/xxx/xxx.jpg", "cover": null, "fromWorkId": null } ], "arguments": [ { "name": "biz", "value": "klingai" }, { "name": "imageCount", "value": "1" }, { "name": "source", "value": "TOOLBOX" }, { "name": "img_resolution", "value": "2k" } ], "extraArgs": {}, "callbackPayloads": [], "scene": "NORMAL_CREATION" }, "favored": false, "deleted": false, "viewed": false, "createTime": 1760558400000, "updateTime": 1760558400000 }, "works": [], "status": 5, "status_name": "submitted", "status_final": false, "message": "", "userPoints": { "points": [], "total": 0 }, "userTickets": { "ticket": [] }, "editProject": null } -
The parameters are invalid. When Kling refuses the submitted parameters,
errorcarries Kling’s own message.{ "error": "Parameter resolution (8k) valid values: 2k,4k" } -
{ "error": "Unauthorized", "code": 401 } -
The Kling account named in
erroris out of credits, and Kling did not create a task. Add credits or upgrade the plan of that account on kling.ai, or send the job to another account withemail.messagekeeps Kling’s own text.{ "error": "Kling account user@example.com is out of credits: Credit are insufficient, you can upgrade your membership or purchase credit. (TASK.PointNotEnough)", "message": "积分消费失败 (TASK.PointNotEnough)" } -
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. The enhanced image is in the works array once the task succeeds.
Model
The new task, with its task.id and status_name: poll it with GET /tasks/task_id until status_final is true.
The task record, field by field
{ // 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
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/enhance" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer …" \ -d '{ "email": "user@example.com", "image": "https://s21-kling.klingai.com/ai-platform/xxx/xxx.jpg", "resolution": "4k" }' -
const token = "API token"; const email = "Previously configured account email"; const apiUrl = "https://api.useapi.net/v1/kling/images/enhance"; const response = await fetch(apiUrl, { method: "POST", headers: { "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }, body: JSON.stringify({ email: email, image: "https://s21-kling.klingai.com/ai-platform/xxx/xxx.jpg", resolution: "4k" }) }); 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/enhance" headers = { "Content-Type": "application/json", "Authorization" : f"Bearer {token}" } data = { "email": email, "image": "https://s21-kling.klingai.com/ai-platform/xxx/xxx.jpg", "resolution": "4k" } response = requests.post(apiUrl, headers=headers, json=data) print(response, response.json())