0crUpgrade

Image generation API

Kling Image 4.0

Kling Image 4.0: up to 9 separate pictures in one run, a related set of 2 to 10, or one long picture (an ecommerce product page or a webpage design). 2K, 4K or 8K; long pages 1K or 2K.

Provider: Kuaishou3 models

Available models

Model keyDisplay nameCapabilityAtlas Cloud slug
kling_image_4_t2iKling Image 4.0 Text-to-Imagetext-to-image, referenceskwaivgi/kling-image-v4.0/text-to-image
kling_image_4_setKling Image 4.0 Image-Setimage series, referenceskwaivgi/kling-image-v4.0/image-set
kling_image_4_longKling Image 4.0 Long-Imageproduct page, webpagekwaivgi/kling-image-v4.0/long-image

Endpoint

POST /api/generate

Request body

ParameterTypeRequiredDescription
modelKeystringOne of the model keys listed above
promptstringText description of the image to generate
inputUrlstringInput image URL (for edit/i2i models)
aspectRatiostring"1:1", "16:9", "9:16", etc.
imageQualitystring"Low", "Medium", "High"
styleRefstring | string[]Style reference image URL(s)
charRefstring | string[]Character reference image URL(s)
brandIdstringBrand DNA ID for brand-consistent generation
imageOptions.countnumberPictures to make: 1-9 on Text-to-Image (default 1), 2-10 on Image-Set (default 4). Each picture is billed; any that does not come back is refunded.
imageOptions.skill'ecommerce' | 'webpage'Long-Image only. ecommerce builds a product page from 1-3 product photos (refImageUrls); webpage needs none. Default webpage.
imageOptions.length'short' | 'medium' | 'long'Long-Image product pages only: about 2-5, 6-10 or 11-18 sections. Default medium.

Code example

curl -X POST https://api.oyefilmy.com/api/generate \
  -H "Authorization: Bearer of_live_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "modelKey": "kling_image_4_t2i",
    "prompt": "A brass lantern glowing on a rainy Mumbai balcony at dusk, warm light on wet tiles"
  }'

Response

{
  "success": true,
  "predictionId": "pred_abc123...",
  "status": "processing",
  "model": "kwaivgi/kling-image-v4.0/text-to-image",
  "creditCost": 5
}

resolution is 2K, 4K or 8K (Long-Image: 1K or 2K). aspectRatio takes 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 or 21:9; Long-Image has none. Up to 10 reference pictures (Long-Image 3); each adds a little to the price. A completed run returns every picture in `pictures`, the first being `url`.

Related