Generate images (compatible with OpenAI Dall-E)
OpenAI Dall-E-style image generation API.
POST /v1/images/generations: Create an image generation task
Standard authentication headers:
-
Content-Type: application/json -
model: string: Required, public model name -
prompt: string: Recommended, image generation prompt -
n: number: Optional, number of images to generate -
size: string: Optional, size or resolution specification -
quality: string: Optional, quality level -
response_format: string: Optional, response format
Common compatible extension parameters:
imageimage_urlimage_urlsimage_listsubject_image_listscene_imagestyle_imagenegative_promptaspect_ratioresolutioncallback_urlexternal_task_id
Kling Dedicated extension parameters:
model_nameelement_listresult_typeseries_amounthuman_imagecloth_imageup_expansion_ratiodown_expansion_ratioleft_expansion_ratioright_expansion_ratio
3.1 Nano Banana Series
Public model:
nano-banananano-banana-pronano-banana-pro-2knano-banana-pro-4knano-banana-2nano-banana-2-2knano-banana-2-4k
Capabilities:
nano-banana: Basic text-to-image, also compatible with image editingnano-banana-pro*: Higher-quality versionnano-banana-2*: Newer model family*-2k/*-4k: High-resolution variants
Common parameters:
- Text-to-image:
model + prompt - Image editing:
model + prompt + image, also compatible withimage_urls - Common extensions:
nsizequalityresponse_format
Example:
{
"model": "nano-banana",
"prompt": "a cute cat running in cloud",
"n": 1,
"size": "1024x1792"
}
{
"model": "nano-banana-pro",
"prompt": "把主体改成赛博朋克夜景",
"image": "https://example.com/input.png",
"n": 1
}
3.2 Seedream Series
Public model:
doubao-seedream-3-0-t2i-250415doubao-seedream-4-0-250828doubao-seedream-4-5-251128doubao-seedream-5-0-260128
Capabilities:
- Use the text-to-image call uniformly
- It is recommended to pass the standard parameter first:
prompt + model + size/aspect_ratio
Common parameters:
model + prompt- Optional:
sizeaspect_ration
3.3 Kling Standard Image Main Model
Public base model:
kling-image
Required:
modelmodel_name
Supported model_name:
kling-v1kling-v1-5kling-v2kling-v2-newkling-v2-1kling-v3
Capabilities:
- Text-to-image:
model + model_name + prompt - Image-to-image: add
imageon top of text-to-image - Multi-image generation: pass
subject_image_list, or pass multipleimage_urls/images - Outpainting: pass
imageand the outpainting ratio parameter
Common parameters:
imagesubject_image_listscene_imagestyle_imageaspect_ratioresolutionup_expansion_ratiodown_expansion_ratioleft_expansion_ratioright_expansion_ratio
Example:
{
"model": "kling-image",
"model_name": "kling-v3",
"prompt": "海边日落,电影感人像",
"aspect_ratio": "16:9",
"n": 1
}
3.4 Kling Omni Image Main Model
Public base model:
kling-omni-image
Required:
modelmodel_name
Supported model_name:
kling-image-o1kling-v3-omni
Common parameters:
image_listelement_listresolutionaspect_ratioresult_typeseries_amount
Example:
{
"model": "kling-omni-image",
"model_name": "kling-v3-omni",
"prompt": "生成一张海边跳舞的图片",
"element_list": [
{ "element_id": 835266081714884677 }
]
}
3.5 Kling Virtual Try-On Model
Public model:
kolors-virtual-try-on-v1kolors-virtual-try-on-v1-5
Minimum input parameters:
model + human_image + cloth_image
Description:
- These two models are already complete primary models themselves, so there is no need to pass
model_nameagain.
Example:
{
"model": "kolors-virtual-try-on-v1",
"human_image": "https://example.com/human.jpg",
"cloth_image": "https://example.com/cloth.jpg"
}
Fixed pricing for image generation/editing
The following models are billed per request in POST /v1/images/generations and POST /v1/images/edits:
| Model | Pricing |
|---|---|
kling-image-v3 | 0.05 / request |
doubao-seedream-5-0-260128 | 0.05 / request |
doubao-seedream-4-5-251128 | 0.06 / request |
Authorizations
Use Bearer Token authentication.
Format: Authorization: Bearer sk-xxxxxx
Body
Public image model name.
nano-banana, doubao-seedream-3-0-t2i-250415, kling-image, kling-omni-image, kolors-virtual-try-on-v1, kolors-virtual-try-on-v1-5 "dall-e-3"
Image generation description. This can be omitted for the virtual try-on model.
Number of images to generate.
Size or resolution representation.
1024x1024, 1024x1792, 1792x1024 Quality level.
standard, hd Style
vivid, natural Response format.
url, b64_json User ID
