Skip to main content
POST
  1. After submission, a task_id will be returned. If you provided a callback_url, when the task status becomes finished or failed, a POST request will be sent to the callback_url.
  2. Regardless of whether callback_url is provided, you can retrieve the response result through the unified Query Task Status endpoint.

Available Model

  • kling-o3-image - Prompt-only image generation
  • kling-o3-image-edit - Image editing with reference images

Supported Parameters

  • prompt - Required generation or editing prompt
  • image_urls - Optional reference image URLs, 1-10 images, used for image editing mode
  • elements - Optional array of element descriptors for character/object control. Reference them in prompt as @Element1, @Element2, etc. Recommended structure: frontal_image_url for the main face/object image, and optional reference_image_urls for additional reference views
  • resolution - 1K, 2K, 4K
  • size - For kling-o3-image: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9; for kling-o3-image-edit: auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9
  • output_format - jpeg, png, webp
  • n - Number of output images, 1-9

Elements Notes

  • elements is intended for upstream face/object control
  • Recommended element fields:
    • frontal_image_url: public image URL for the main character/object view
    • reference_image_urls: optional array of additional public image URLs
  • elements is optional and should only be used when you need stronger subject consistency

Billing Notes

Billing is based on the selected resolution and the output count specified by n.
  • Total charge depends on the selected resolution and n

How to Call

Use the unified submit endpoint: POST /api/generate/submit Prompt-only example:
Image editing example:

Authorizations

Authorization
string
header
required

All API endpoints require Bearer Token authentication

Get your API Key:

Visit the API Key Management Page to get your API Key

Add it to the request header:

Body

application/json
model
enum<string>
required

Model identifier.

Available options:
kling-o3-image,
kling-o3-image-edit
input
object
required

Input parameters for image generation or editing

callback_url
string<uri>

Webhook callback URL for result notifications

Example:

"https://your-domain.com/callback"

Response

Task submitted successfully

code
integer
required

HTTP status code

Example:

200

data
object
required