Skip to main content
POST
Kling 4.0 Image Edit
Poll the returned task URL to retrieve the images. See Query Task Result.

Authorizations

Authorization
string
header
required

API Key authentication. Format: Bearer YOUR_API_KEY.

Body

application/json
images
(string<uri> | object)[]
required

Each image can be a URL string or an object with image_url. Use public HTTP(S) URLs without credentials, query strings, or fragments. If you include reference_type, use refer_image.

Minimum array length: 1
prompt
string

Instructions for the edit. Provide non-blank text when you include this field.

Pattern: \S
resolution
enum<string>

Output resolution.

Available options:
2k,
4k
aspect_ratio
string

Use auto or a supported width-to-height ratio such as 1:1 or 16:9.

Pattern: ^(auto|[1-9][0-9]*:[1-9][0-9]*)$
n
integer

Number of images to generate.

Required range: 1 <= x <= 9

Response

Task submitted successfully

code
integer
required

Response code, 0 indicates success

Example:

0

message
string
required

Response message

Example:

"success"

data
object
required

Detailed data about the submitted asynchronous task.