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 key | Display name | Capability | Atlas Cloud slug |
|---|---|---|---|
kling_image_4_t2i | Kling Image 4.0 Text-to-Image | text-to-image, references | kwaivgi/kling-image-v4.0/text-to-image |
kling_image_4_set | Kling Image 4.0 Image-Set | image series, references | kwaivgi/kling-image-v4.0/image-set |
kling_image_4_long | Kling Image 4.0 Long-Image | product page, webpage | kwaivgi/kling-image-v4.0/long-image |
Endpoint
POST /api/generateRequest body
| Parameter | Type | Required | Description |
|---|---|---|---|
modelKey | string | One of the model keys listed above | |
prompt | string | Text description of the image to generate | |
inputUrl | string | Input image URL (for edit/i2i models) | |
aspectRatio | string | "1:1", "16:9", "9:16", etc. | |
imageQuality | string | "Low", "Medium", "High" | |
styleRef | string | string[] | Style reference image URL(s) | |
charRef | string | string[] | Character reference image URL(s) | |
brandId | string | Brand DNA ID for brand-consistent generation | |
imageOptions.count | number | Pictures 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`.

