Theme
Image Generation
POST
https://www.kkiai.com/kling/v1/images/generations
Request Parameters
Authorization
Add the Authorization parameter to the Header. Its value is the Token concatenated after Bearer.
Example: Authorization: Bearer ********************
Header Parameters
| Parameter Name | Type | Required | Description | Example |
|---|---|---|---|---|
Content-Type | string | Optional | application/json | |
Authorization | string | Optional | Bearer {{YOUR_API_KEY}} |
Body Parameters (application/json)
| Parameter Name | Type | Required | Description |
|---|---|---|---|
model_name | string | Required | Model name. Enum values: kling-v1, kling-v1-5, kling-v2, kling-v2-new, kling-v2-1, kling-v3 |
prompt | string | Required | Positive text prompt. Cannot exceed 2500 characters |
negative_prompt | string | Optional | Negative text prompt. Cannot exceed 2500 characters |
image | string | Optional | Reference image. Supports Base64 encoded image or image URL (must be accessible) |
image_reference | string | Optional | Image reference type. Enum values: subject (character feature reference), face (facial appearance reference). When using face (facial appearance reference), the uploaded image must contain only 1 face. Required when using kling-v1-5 and image parameter is not empty |
image_fidelity | number | Optional | Reference strength to the user-uploaded image during generation. Range: [0,1]. Larger values indicate stronger reference strength |
human_fidelity | number | Optional | Facial reference strength, i.e., similarity of facial features of the person in the reference image. Only effective when image_reference parameter is subject. Range: [0,1]. Larger values indicate stronger reference strength |
resolution | string | Optional | Clarity of generated image. Enum values: 1k, 2k. 1k: 1K standard definition. 2k: 2K high definition |
n | integer | Required | Number of images to generate. Range: [1,9] |
aspect_ratio | string | Optional | Aspect ratio of generated image (width:height). Enum values: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9 |
callback_url | string | Optional |
Request Example
json
{
"model_name": "kling-v1",
"prompt": "Generate an image of the seaside.",
"negative_prompt": "",
"image": "",
"image_reference": "",
// "image_fidelity": "0.5",
"human_fidelity": 0.45,
"resolution": "1k",
"n": 2,
"aspect_ratio": "16:9",
"callback_url": ""
}cURL Example
bash
curl --location --request POST 'https://www.kkiai.com/kling/v1/images/generations' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
"model_name": "kling-v1",
"prompt": "Generate an image of the seaside.",
"negative_prompt": "",
"image": "",
"image_reference": "",
// "image_fidelity": "0.5",
"human_fidelity": 0.45,
"resolution": "1k",
"n": 2,
"aspect_ratio": "16:9",
"callback_url": ""
}'Response
🟢 200 Success
Response Example
json
{}