Skip to main content
POST
/
kling
/
v1
/
images
/
generations
cURL
curl https://api.deerapi.com/kling/v1/images/generations \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer $DEERAPI_KEY" \
  -d '{
    "model_name": "kling-v2",
    "prompt": "cute cat",
    "subject_image_list": [
      {
        "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
      },
      {
        "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
      },
      {
        "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
      },
      {
        "subject_image": "https://filesystem.site/cdn/20250814/goDW44JIf6eSuxAS7TNringhWjO9kW.png"
      }
    ]
  }'
{
  "code": 123,
  "message": "<string>",
  "request_id": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "created_at": 123,
    "updated_at": 123
  }
}

Overview

Use this endpoint to call the Kling Generate With References workflow through DeerAPI. The API reference on this page shows the request schema, response schema, authentication requirements, and runnable examples for the configured endpoint.

Before you start

Use the DeerAPI base URL and pass your API Key in the Authorization header:
https://api.deerapi.com
Authorization: Bearer $DEERAPI_KEY

Model selection

Choose a current model ID from the live pricing page. Model availability changes over time, so avoid copying a model ID from an old project without checking the live list first.

Implementation notes

  • Use the OpenAPI playground for the exact request fields accepted by this endpoint.
  • Keep API Keys on the server side when you build production applications.
  • Log the request ID from failed calls so support can investigate the request.
  • Retry 429, 500, and 503 responses with exponential backoff.

Authorizations

Authorization
string
header
required

Use a DeerAPI API Key as a Bearer token.

Headers

Content-Type
string

Content type of the request body.

Body

application/json

Kling Image Generation API request body definition

subject_image_list
object[]
required

List of subject reference images. Minimum 2, maximum 4.

model_name
enum<string>
default:kling-v2

Model to use for multi-image generation.

Available options:
kling-v2
prompt
string

Text prompt describing the desired output. Max 2500 characters.

scence_image
string

Optional scene reference image. Same format and size constraints as subject images.

style_image
string

Optional style reference image. Same format and size constraints as subject images.

n
integer
default:1

Number of images to generate.

aspect_ratio
enum<string>
default:16:9

Aspect ratio of the generated image (width:height).

Available options:
16:9,
9:16,
1:1,
4:3,
3:4,
3:2,
2:3,
21:9
callback_url
string

Webhook URL for task status notifications. The server sends a callback when the task status changes.

external_task_id
string

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

Response

200 - application/json

Successful Response

code
integer

Error code; specifically define the error code

message
string

error message

request_id
string

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object