Skip to main content
POST
/
kling
/
v1
/
images
/
generations
curl --request POST \
  --url https://api.cometapi.com/kling/v1/images/generations \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "prompt": "cry"
}
'
{
  "code": 123,
  "data": {
    "created_at": 123,
    "task_id": "<string>",
    "task_info": {
      "external_task_id": null
    },
    "task_result": null,
    "task_status": "<string>",
    "task_status_msg": null,
    "updated_at": 123
  },
  "message": "<string>"
}

Documentation Index

Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt

Use this file to discover all available pages before exploring further.

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 belongs under the Kling API family because it shares Kling task conventions with other media endpoints.

First request

Start with a concise prompt and the minimum required fields shown in the API playground. Add style, aspect ratio, or advanced controls only after the first request returns a usable image.

Read the response

Save the returned task or image fields before starting downstream work. 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

Must be application/json.

Body

application/json
prompt
string
default:Hello
required

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

negative_prompt
string

Elements to exclude from the image. Maximum 200 characters.

image
string

Reference image as a Base64 string (without data: prefix) or public URL. Accepted formats: JPG, JPEG, PNG. Maximum 10 MB, minimum 300×300 px.

image_fidelity
number

How closely the output follows the reference image. Range: 0–1.

n
integer

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

aspect_ratio
string

Output aspect ratio (width:height). Options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.

callback_url
string

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

model_name
string

Kling image model variant to use. See the Models page for current options.

Response

200 - application/json

Successful Response

code
integer
required

Error code; specifically define the error code

data
object
required
message
string
required

error message