Kling โ
Endpoint: POST https://vod.intl.tencentcloudapi.comAction: CreateAigcImageTask
Kling Image is an image generation model that supports text-to-image and reference-image generation. Kling Image 4.0, launched on 2026-11-18, comes in two versions: 4.0 for regular image generation (multiple independent images or a related image series), and 4.0-long for long-image generation (e-commerce detail pages, web page designs). The existing 3.0-Omni / 3.0 / O1 / 2.1 remain available.
See Version differences to pick a version and Calling by version for request examples.
Basic information โ
| Item | Value |
|---|---|
| ModelName | Kling |
| ModelVersion | 4.0 / 4.0-long / 3.0-Omni / 3.0 / O1 / 2.1 |
| Default | ModelVersion=3.0 / AspectRatio=1:1 |
| Guardrail bypass support | Not supported |
Version differences โ
| Capability | 4.0 | 4.0-long | 3.0-Omni / 3.0 / O1 / 2.1 |
|---|---|---|---|
| Use | Regular image generation | Long images (e-commerce detail page / web page design) | Regular image generation |
| Text to image | โ | โ | โ |
| Reference image to image | โ
(ReferenceType=refer_image) | โ (reference / style reference / subject reference) | โ |
| Multiple independent images | โ
(OutputImageCount 1โ9) | โ | โ
(OutputImageCount 1โ9) |
| Related image series | โ
(result_type=series + series_amount) | โ | โ |
| Long-image skill | โ | skill: ecommerce / webpage (required) | โ |
| Reference images in Prompt | โ
(@<Id>, e.g. @id1) | โ | โ |
How to choose:
- Regular images / several different results at once โ
4.0, set the count withOutputImageCount. - A consistent, related set of images (e.g. one product from several angles) โ
4.0+result_type=series. - Tall images such as e-commerce detail pages or web page designs โ
4.0-long;skillis required.
Upstream docs: Image generation ยท Long image generation
"No multiple images / series on
4.0-long" and "no@<Id>references on existing versions" are compiled from the guide's parameter descriptions (it listsresult_typeonly for4.0, and only the 4.0 examples useId); the guide does not state them explicitly.
Request parameters โ
| Parameter | Required | Type | Description |
|---|---|---|---|
SubAppId | Yes | Integer | VOD application ID |
ModelName | Yes | String | Fixed value Kling |
ModelVersion | Yes | String | 4.0 (image generation) / 4.0-long (long image) / 3.0-Omni / 3.0 / O1 / 2.1 |
Prompt | Conditional | String | Generation prompt. Required when FileInfos is empty. Use @<Id> to reference an image in FileInfos |
FileInfos.N | No | Array | Reference images, fields below |
OutputConfig | No | Object | Output settings, fields below |
InputRegion | No | String | Input region: Mainland (Chinese mainland) / Oversea (outside the Chinese mainland) / OverseaUSWest (US West) |
ExtInfo | No | String | Extension parameters. 4.0 / 4.0-long specific options go inside AdditionalParameters, see below |
FileInfos โ
| Field | Description |
|---|---|
Type | File (VOD media file) / Url (accessible URL) / Base64 |
FileId | Valid when Type=File |
Url | Valid when Type=Url |
Base64 | Valid when Type=Base64. All files together must not exceed 7 MB; formats jpeg / jpg / png / webp; no data:image/jpeg;base64, prefix |
Id | Image identifier, referenced in Prompt as @<Id> |
ReferenceType | Image type. 4.0: refer_image (reference image). 4.0-long: refer_image (reference image) / style_refer_image (style reference) / subject_refer_image (subject reference) |
OutputConfig โ
| Field | Description |
|---|---|
StorageMode | Temporary (temporary storage) / Permanent (stored in VOD, returns a FileId) |
Resolution | Resolution. The guide's examples use 2K / 4K |
AspectRatio | Aspect ratio. The guide's examples use auto / 21:9 |
OutputImageCount | Number of images; Kling accepts 1โ9 |
OutputFormat | Output format jpeg / png; the model default is used when empty |
InputComplianceCheck | Input content compliance check: Enabled / Disabled |
LogoAdd | Logo watermark: Enabled / Disabled |
The guide does not list the full
Resolution/AspectRatiovalues for4.0/4.0-long; the table only shows values that appear in its examples. Test other values before relying on them.
ExtInfo.AdditionalParameters โ
| Version | Parameter | Required | Description |
|---|---|---|---|
4.0 | result_type | No | single: independent images; series: related image series |
4.0 | series_amount | No | Number of images in the series (used with result_type=series; the guide's example uses 10) |
4.0-long | skill | Yes | Long-image skill: ecommerce (e-commerce detail page) / webpage (web page design) |
4.0-long | length | No | Page length, only for skill=ecommerce: short (about 2โ5 sections) / medium (about 6โ10) / long (about 11โ18) |
ExtInfo is a JSON string, and AdditionalParameters inside it is another JSON string, so the inner quotes must be written as \\\", for example:
"ExtInfo": "{\"AdditionalParameters\":\"{\\\"result_type\\\":\\\"series\\\",\\\"series_amount\\\":10}\"}"Calling by version โ
| Version | Scenario | Example |
|---|---|---|
4.0 | Text to image | 4.0 text to image |
4.0 | Reference image (multiple independent images) | 4.0 reference |
4.0 | Reference image to image series | 4.0 series |
4.0-long | Web page design | 4.0-long web page |
4.0-long | E-commerce detail page | 4.0-long e-commerce |
3.0 and other existing versions | Text / reference | Existing versions |
4.0 / Text to image โ
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "4.0",
"Prompt": "generate a car"
}4.0 / Reference image (multiple independent images) โ
Generates 3 independent images; the count is set by OutputConfig.OutputImageCount. The Prompt references the image as @id1.
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "4.0",
"FileInfos": [
{
"Type": "Url",
"Url": "https://<host>/reference.png",
"Id": "id1"
}
],
"Prompt": "generate a car in the top of @id1",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "2K",
"OutputImageCount": 3,
"AspectRatio": "auto"
}
}4.0 / Reference image to image series โ
Generates a related series of 10 images; the count is set by AdditionalParameters.series_amount (not OutputImageCount).
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "4.0",
"FileInfos": [
{
"Type": "Url",
"Url": "https://<host>/reference.png",
"Id": "id1"
}
],
"Prompt": "generate a car in the top of @id1",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "4K",
"AspectRatio": "21:9"
},
"ExtInfo": "{\"AdditionalParameters\":\"{\\\"result_type\\\":\\\"series\\\",\\\"series_amount\\\":10}\"}"
}4.0-long / Web page design โ
ModelVersion=4.0-long, skill=webpage. The example passes the image as a style reference (ReferenceType=style_refer_image).
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "4.0-long",
"FileInfos": [
{
"Type": "Url",
"Url": "https://<host>/style.png",
"ReferenceType": "style_refer_image",
"Id": "id1"
}
],
"Prompt": "generate a webpage design",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "2K"
},
"ExtInfo": "{\"AdditionalParameters\":\"{\\\"skill\\\":\\\"webpage\\\"}\"}"
}4.0-long / E-commerce detail page โ
skill=ecommerce, length=short (about 2โ5 sections).
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "4.0-long",
"FileInfos": [
{
"Type": "Url",
"Url": "https://<host>/product.png",
"Id": "id1"
}
],
"Prompt": "generate a short ecommerce detail page",
"OutputConfig": {
"StorageMode": "Temporary",
"Resolution": "4K"
},
"ExtInfo": "{\"AdditionalParameters\":\"{\\\"skill\\\":\\\"ecommerce\\\",\\\"length\\\":\\\"short\\\"}\"}"
}Two things that break if you copy the guide's examples as-is
In the integration guide, the series and long-image examples write AppId instead of SubAppId, and have a trailing comma after the ExtInfo line (invalid JSON). The examples on this page are corrected โ use them instead.
Existing versions / Text to image โ
The existing 3.0-Omni / 3.0 / O1 / 2.1 support ratios 1:1 / 16:9 / 9:16 / 4:3 / 3:4 and OutputImageCount 1โ9. 3.0-Omni / O1 suit scenarios that blend multiple references.
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "3.0",
"Prompt": "a serene japanese garden, soft morning light",
"OutputConfig": {
"AspectRatio": "1:1",
"OutputImageCount": 1,
"StorageMode": "Temporary"
},
"SessionContext": "job-001"
}Existing versions / Reference image request โ
{
"SubAppId": 123456789,
"ModelName": "Kling",
"ModelVersion": "3.0",
"Prompt": "Change the background to a quiet garden; preserve the subject.",
"OutputConfig": {
"AspectRatio": "1:1",
"OutputImageCount": 1,
"StorageMode": "Temporary"
},
"SessionContext": "job-001",
"FileInfos": [
{
"Type": "Url",
"Category": "Image",
"Url": "https://<host>/reference.jpg"
}
]
}Response example โ
Creating a task returns a TaskId:
{
"Response": {
"RequestId": "<request-id>",
"TaskId": "<sub-app-id>-AigcImageTask-<task-hash>"
}
}Query that TaskId with DescribeTaskDetail; when AigcImageTask.Status=FINISH and ErrCode=0, read the result from Output.FileInfos:
{
"AigcImageTask": {
"Status": "FINISH",
"ErrCode": 0,
"Progress": 100,
"Output": {
"FileInfos": [
{
"FileUrl": "http://<host>.vod2.myqcloud.com/.../aigcImageGenFile.png",
"ExpireTime": "2026-08-01T10:29:48Z",
"MetaData": {
"Width": 1024,
"Height": 1024,
"Container": "png"
}
}
]
}
}
}Special settings โ
- Use
AdditionalParameters.series_amountfor a series andOutputConfig.OutputImageCountfor independent images โ do not mix them. 4.0-longrequiresskill;lengthonly applies whenskill=ecommerce.ReferenceTypevaluesstyle_refer_image/subject_refer_imageonly apply to4.0-long;4.0only usesrefer_image.- The guide does not state the range of
series_amount, the output size of4.0-long, or how a series is laid out inOutput.FileInfos; rely on the actual response.