Skip to content
Guides
Guides

Kling 4.0 images

Generate standard images, ordered series, and ecommerce or webpage long images.

Create with POST /api/v1/kling/text_to_image and query with GET /api/v1/kling/text_to_image/:id. Use callback_url for completion notifications. Both models return images, an ordered array of objects with a url. Series stay in a single task and preserve the returned order. Outputs are usually PNG at 2k and 4k; 8k output is JPEG. Do not assume a fixed file extension.

Standard and series images

Use model: "kling-v4-image" with a required prompt of at most 20,000 characters. mode defaults to default; output_count defaults to 1 and accepts 1–9. For mode: "series", explicitly supply output_count between 2 and 10. output_resolution accepts 2k, 4k, or 8k and defaults to 2k. aspect_ratio defaults to auto and accepts 9:16, 2:3, 3:4, 1:1, 4:3, 3:2, 16:9, and 21:9.

source_image_urls are ordered references addressed as @image_1, @image_2, and so on. Optional elements contain name, image_urls, description, and tag. Each element needs 2–4 image URLs and a unique, case-insensitive name of 1–20 Chinese characters, letters, digits, or underscores. Names matching image_N or object_N are reserved. Descriptions allow up to 100 characters. Tags accept character, animal, prop, costume, scene, effect, or others. Source images and elements together cannot exceed 10 references. Address an element as @name.

Long images

Use model: "kling-v4-long-image" and explicitly supply skill. Skills are case-insensitive. The prompt limit is 20,000 characters and output_resolution accepts 1k or 2k, defaulting to 2k. A task returns one image. Long images do not accept mode, output_count, elements, or aspect_ratio.

Skill Input images Length Output resolution ecommerce 1–3 source_image_urls short 1k, 2k ecommerce 1–3 source_image_urls medium, the default 1k, 2k ecommerce 1–3 source_image_urls long 1k, 2k webpage Optional style_image_url and subject_image_url Not accepted 1k, 2k

Ecommerce requests do not accept style_image_url or subject_image_url. Product images of at least 300 pixels and aspect ratios between 2:5 and 5:2 are recommended for generation quality. Webpage requests do not accept source_image_urls or length. Reference supplied webpage images with @style and @subject.

All input images must be publicly readable HTTP or HTTPS JPG, JPEG, or PNG files, at most 20 MB each. References must name supplied images or elements. Long-image prompts interpret @ followed by letters, digits, underscores, or Chinese characters as a reference, including email addresses and handles. Use a full-width @ or a space after @ for literal text. Undeclared references return HTTP 422.

Pricing

JSON
{
  "model": "kling-v4-image",
  "prompt": "Show @image_1 and @Hero in two scenes",
  "mode": "series",
  "output_count": 2,
  "output_resolution": "2k",
  "source_image_urls": ["https://cdn.runapi.ai/public/samples/image.jpg"],
  "elements": [{
    "name": "Hero",
    "image_urls": ["https://cdn.runapi.ai/public/samples/portrait.jpg", "https://cdn.runapi.ai/public/samples/image-to-video.jpg"],
    "description": "The same character in both scenes",
    "tag": "character"
  }]
}