v1

latestOpenAPI 3.1.02026-07-267724480.0 KB

Generate images with Kling

post/kling/v1/images/generations

Headers

Content-Typestring

Must be application/json.

Request body

model_name'kling-v1' | 'kling-v1-5' | 'kling-v2' | 'kling-v2-1' | 'kling-v3'

Kling image model variant. Use kling-v3 for new requests. Omitting model_name uses the legacy CometAPI route default.

promptstring required

Text prompt describing the image to generate. Maximum 2500 characters.

negative_promptstring

Elements to exclude from the image. Maximum 2500 characters. Not supported when image is provided.

imagestring

Reference image as a raw Base64 string without a data: prefix, or a public URL. Accepted formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300x300 px, aspect ratio between 1:2.5 and 2.5:1.

image_reference'subject' | 'face'

Reference mode for legacy image-to-image requests when image is provided.

image_fidelitynumber

How closely the output follows the reference image. Range: 0-1. Used by legacy image-reference models.

human_fidelitynumber

Human-subject fidelity control. Range: 0-1. Used only by legacy subject-reference requests.

resolution'1k' | '2k'

Output resolution. Defaults to 1k.

ninteger

Number of images to generate. Range: 1-9.

aspect_ratio'16:9' | '9:16' | '1:1' | '4:3' | '3:4' | '3:2' | '2:3' | '21:9'

Output aspect ratio (width:height).

callback_urlstring

Webhook URL to receive task status updates when the task completes.

external_task_idstring

Optional user-defined task ID for your own tracking. Must be unique per account.

Response

Task request accepted or an error response returned by the API.

messagestring required

Response message.

request_idstring

Request identifier returned when present.