Skip to main content
POST
/
kling
/
v1
/
images
/
generations
cURL
curl https://api.cometapi.com/kling/v1/images/generations \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "model_name": "kling-v3",
  "prompt": "A paper boat floating on calm water at sunrise",
  "n": 1,
  "aspect_ratio": "1:1"
}'
{
  "code": 123,
  "message": "<string>",
  "data": {
    "task_id": "<string>",
    "created_at": 123,
    "updated_at": 123,
    "task_status_msg": "<string>",
    "task_info": {
      "external_task_id": "<string>"
    },
    "task_result": {}
  },
  "request_id": "<string>"
}

Image generation

For the complete parameter reference, see the official Kling documentation.
Use this endpoint to create still images through Kling’s image generation API. It supports text-only requests and image-reference requests through the same async task flow.

First request

Start with model_name: kling-v3, prompt, n, and aspect_ratio. Add reference images, fidelity controls, or advanced fields only after the first request returns a usable task. Omitting model_name uses a legacy compatibility default, so send kling-v3 explicitly for new integrations.

Read the response

Save the returned task_id, then poll the matching Kling image query route until task_status reaches a terminal state. If your workflow needs durable storage, copy the final asset into your own storage layer after generation completes.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Headers

Content-Type
string
default:application/json

Must be application/json.

Body

application/json
prompt
string
required

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

model_name
enum<string>
default:kling-v1

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

Available options:
kling-v1,
kling-v1-5,
kling-v2,
kling-v2-1,
kling-v3
negative_prompt
string

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

image
string

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
enum<string>

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

Available options:
subject,
face
image_fidelity
number
default:0.5

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

Required range: 0 <= x <= 1
human_fidelity
number
default:0.45

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

Required range: 0 <= x <= 1
element_list
object[]

Optional Kling element references. The total count of element references and input images must not exceed 10.

resolution
enum<string>
default:1k

Output resolution. Defaults to 1k.

Available options:
1k,
2k
n
integer
default:1

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

Required range: 1 <= x <= 9
aspect_ratio
enum<string>
default:16:9

Output aspect ratio (width:height).

Available options:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9
watermark_info
object

Watermark options.

callback_url
string

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

external_task_id
string

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

Response

200 - application/json

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

code
required

Response code. 0 means the task request was accepted.

message
string
required

Response message.

data
object
required
request_id
string

Request identifier returned when present.