Skip to content

Kling โ€‹

Updated

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 โ€‹

ItemValue
ModelNameKling
ModelVersion4.0 / 4.0-long / 3.0-Omni / 3.0 / O1 / 2.1
DefaultModelVersion=3.0 / AspectRatio=1:1
Guardrail bypass supportNot supported

Version differences โ€‹

Capability4.04.0-long3.0-Omni / 3.0 / O1 / 2.1
UseRegular image generationLong 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 with OutputImageCount.
  • 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; skill is 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 lists result_type only for 4.0, and only the 4.0 examples use Id); the guide does not state them explicitly.

Request parameters โ€‹

ParameterRequiredTypeDescription
SubAppIdYesIntegerVOD application ID
ModelNameYesStringFixed value Kling
ModelVersionYesString4.0 (image generation) / 4.0-long (long image) / 3.0-Omni / 3.0 / O1 / 2.1
PromptConditionalStringGeneration prompt. Required when FileInfos is empty. Use @<Id> to reference an image in FileInfos
FileInfos.NNoArrayReference images, fields below
OutputConfigNoObjectOutput settings, fields below
InputRegionNoStringInput region: Mainland (Chinese mainland) / Oversea (outside the Chinese mainland) / OverseaUSWest (US West)
ExtInfoNoStringExtension parameters. 4.0 / 4.0-long specific options go inside AdditionalParameters, see below

FileInfos โ€‹

FieldDescription
TypeFile (VOD media file) / Url (accessible URL) / Base64
FileIdValid when Type=File
UrlValid when Type=Url
Base64Valid when Type=Base64. All files together must not exceed 7 MB; formats jpeg / jpg / png / webp; no data:image/jpeg;base64, prefix
IdImage identifier, referenced in Prompt as @<Id>
ReferenceTypeImage 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 โ€‹

FieldDescription
StorageModeTemporary (temporary storage) / Permanent (stored in VOD, returns a FileId)
ResolutionResolution. The guide's examples use 2K / 4K
AspectRatioAspect ratio. The guide's examples use auto / 21:9
OutputImageCountNumber of images; Kling accepts 1โ€“9
OutputFormatOutput format jpeg / png; the model default is used when empty
InputComplianceCheckInput content compliance check: Enabled / Disabled
LogoAddLogo watermark: Enabled / Disabled

The guide does not list the full Resolution / AspectRatio values for 4.0 / 4.0-long; the table only shows values that appear in its examples. Test other values before relying on them.

ExtInfo.AdditionalParameters โ€‹

VersionParameterRequiredDescription
4.0result_typeNosingle: independent images; series: related image series
4.0series_amountNoNumber of images in the series (used with result_type=series; the guide's example uses 10)
4.0-longskillYesLong-image skill: ecommerce (e-commerce detail page) / webpage (web page design)
4.0-longlengthNoPage 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:

json
"ExtInfo": "{\"AdditionalParameters\":\"{\\\"result_type\\\":\\\"series\\\",\\\"series_amount\\\":10}\"}"

Calling by version โ€‹

VersionScenarioExample
4.0Text to image4.0 text to image
4.0Reference image (multiple independent images)4.0 reference
4.0Reference image to image series4.0 series
4.0-longWeb page design4.0-long web page
4.0-longE-commerce detail page4.0-long e-commerce
3.0 and other existing versionsText / referenceExisting versions

4.0 / Text to image โ€‹

json
{
  "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.

json
{
  "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).

json
{
  "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).

json
{
  "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).

json
{
  "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.

json
{
  "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 โ€‹

json
{
  "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:

json
{
  "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:

json
{
  "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_amount for a series and OutputConfig.OutputImageCount for independent images โ€” do not mix them.
  • 4.0-long requires skill; length only applies when skill=ecommerce.
  • ReferenceType values style_refer_image / subject_refer_image only apply to 4.0-long; 4.0 only uses refer_image.
  • The guide does not state the range of series_amount, the output size of 4.0-long, or how a series is laid out in Output.FileInfos; rely on the actual response.

Built with VitePress ยท Deployed on Tencent EdgeOne Pages