History

Kling Image 4.0 API : Generate AI Images up to 8K From Text and Reference Images

Try Kling Image 4.0 online right here: write a prompt, add up to 10 reference images, pick the resolution and aspect ratio, and get up to 4 images at once. Then call the same model from your product through the Kling Image 4.0 API, with one key and one balance.

  • Up to 10 reference images
  • Up to 8k
  • Billed per image
  • Open Kling Image 4.0 API

Features

Key Kling Image 4.0 API Capabilities

  • Text to image, guided by references

    Describe the picture in a prompt, or add up to 10 reference images and name each one as @Image1, @Image2 and so on, in the order of image_urls. Leave image_urls out for pure text to image; add them to keep a product, a character or a style in the new picture.

  • 2k, 4k or 8k output

    Choose resolution 2k, 4k or 8k for each task. 8k is the highest tier, for posters, large prints and pictures you plan to crop.

  • 9 aspect ratios, including auto

    1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 and 21:9 cover square posts, stories, slides and wide banners. auto follows your reference images; without them you get 1:1.

  • Up to 4 images per task

    Set num_outputs from 1 to 4 to get several variations of one prompt in a single task. A 2k image takes about a minute and a half.

  • PNG originals and JPEG previews

    Each image comes as a full PNG at outputs[].url and a JPEG preview of up to 1024 pixels on the long side at preview_url, for fast lists and thumbnails. The files are kept for 15 days, so copy the ones you want to keep to your own storage.

  • Pay only for the images you get

    A task reserves the price of the images you ask for and charges only for the ones it returns; a failed task costs nothing. Aspect ratio and the number of reference images don't change the price.

Kling Image 4.0 on NanoAPI, "Up to 8K, from text and references": a hummingbird by a pink orchid with a magnified feather detail and 2K / 4K / 8K labels
Every image on this page was generated with Kling Image 4.0 on NanoAPI.

Overview

What Is Kling Image 4.0?

Model ID
kling-image-4.0
Resolution
2k / 4k / 8k
Aspect ratio
9 options
Reference images
Up to 10
Images per task
1–4
Prompt
Up to 8000 characters
Price
From $0.0936 / image

Kling Image 4.0 is an AI image model from Kuaishou that turns a prompt, optionally with reference images, into pictures at 2k, 4k or 8k. The prompt can point to each reference directly as @Image1, @Image2 and so on, so one request can say which product, character or style goes where.

On NanoAPI, Kling Image 4.0 is the model kling-image-4.0 of the product kling_image. Every task takes a prompt and up to 10 reference images and returns 1 to 4 images, each as a full PNG plus a JPEG preview. You choose the resolution, one of nine aspect ratios and the number of images for every task.

Resolution is where Kling Image 4.0 stands out: it goes up to 8K, so a poster, a print or a large screen gets a picture made at that size, with room to crop.

Use Kling Image 4.0 online in the studio at the top of this page, then call the Kling Image 4.0 API at https://api.nanoapi.ai/v1 from your own app. Both draw on the same prepaid balance at the same price per image, and you only pay for the images you get: an image that isn't generated is refunded, and so is a task that fails.

Pricing

Kling Image 4.0 API Pricing

Priced per image by resolution: you're charged only for the images a task returns, and aspect ratio and reference images don't change the price.

Price2k / image4k / image8k / image
Per image$0.0936$0.1404$0.234

Live prices per image. Cost = price per image × number of images; you're only charged for the images you get, and failed runs are fully refunded.

How it works

How to Use the Kling Image 4.0 API

  1. 1

    Step 1: Get your API key

    Sign in to NanoAPI with Google and create a key on the API Keys page of the console. It authenticates every Kling Image 4.0 API request, so keep it on your server.

  2. 2

    Step 2: Top up your balance

    Add funds on the Top up page of the console. The balance is prepaid in USD, never expires and is shared by every NanoAPI model, image and video alike.

  3. 3

    Step 3: Create a task

    Send POST /v1/tasks with model kling-image-4.0, a prompt, resolution, aspect_ratio and num_outputs, plus image_urls if you need them. The task is queued in under a second, and the price of the requested images is reserved within a few seconds.

  4. 4

    Step 4: Get the images

    Receive the finished task once at your webhook_url, or poll GET /v1/tasks/{task_id} every 15 seconds or more. A 2k image takes about a minute and a half; the PNG files are in outputs[].url and the JPEG previews in preview_url.

Why NanoAPI

Why Use the Kling Image 4.0 API on NanoAPI

  • One key for every model

    Kling Image 4.0 shares the POST /v1/tasks endpoint, the task object, the API key and the prepaid balance with every image and video model on NanoAPI.

  • Pay for images, not attempts

    A task reserves the price of the images you ask for and charges only for the ones it returns. An image that isn't generated is refunded while the rest are delivered; a task with no image at all is refunded in full.

  • Webhooks or polling

    Get the finished task pushed once to your webhook_url, signed to the Standard Webhooks spec (verifying is optional), or poll a single task or a batch of task ids.

  • Safe retries

    Send an Idempotency-Key with each new task: a request resent after a timeout returns the task that was already created, so nothing is generated or charged twice.

  • Spend limits and a full history

    Cap each API key's hourly, daily or total spending, and look up every request with its status, inputs, cost and result, your daily usage and every movement of your balance in the console.

  • Try online, then integrate

    The studio on this page runs the same Kling Image 4.0 model at the same prices, so what you test is what your users get. The docs also come as one llms.txt file for AI coding assistants.

Use cases

What You Can Build With the Kling Image 4.0 API

  • A frosted-glass perfume bottle as the reference photo on white, and the same bottle in a campaign photo on a wet black stone among white orchids at dusk

    Product shots and ads

    Send a product photo as @Image1 and place it in a new scene, on a new background or in a seasonal campaign, ready for listings and ads.

  • A huge billboard on a glass building showing a sharp close-up of a snow leopard, labelled 8K, with two people walking below

    Posters and key visuals at print size

    Render campaign key visuals, posters and billboards at 4k or 8k, so they hold up in large prints and on big screens.

  • Three reference cards of a cartoon fox in an orange scarf, and the same fox reading in a library, surfing and roasting marshmallows by a campfire

    Consistent characters and brand sets

    Use up to 10 reference images to keep a character, a mascot or a brand's colors and style the same across a whole series of images.

  • The same lemonade stand scene in four frames labelled 1:1, 9:16, 3:4 and 16:9

    Social posts and stories

    Create 1:1 posts, 9:16 stories, 3:4 feed images and 16:9 covers from a prompt, with up to four variations per task to choose from.

  • A design tool on a monitor with a prompt field, an 8K resolution menu and a Generate button, showing a speckled ceramic teapot in morning light

    Image generation in your app

    Add Kling Image 4.0 text to image to a design tool, a print-on-demand shop or a content pipeline: create tasks in bulk, get the images by webhook and copy the PNGs to your own storage within 15 days.

FAQ

Kling Image 4.0 API FAQ

Can’t find what you need? Write to us.

01

What is the Kling Image 4.0 API, and how do I call it?

The Kling Image 4.0 API lets your app generate images with Kuaishou's Kling Image 4.0 model over HTTP. On NanoAPI you send POST /v1/tasks with model kling-image-4.0, a prompt, resolution, aspect_ratio and num_outputs, optionally with up to 10 reference images in image_urls, and get 1 to 4 images back by webhook or by polling GET /v1/tasks/{task_id}. It uses the same API key and balance as every NanoAPI model.

02

How much does the Kling Image 4.0 API cost?

You pay per image: the price of the resolution × the number of images generated. A task reserves the price of every image in num_outputs, charges only for the images it returns and refunds the rest; a failed task is refunded in full. aspect_ratio and the number of reference images don't change the price. The live prices are in the table above, on the pricing page and in GET /v1/products.

03

Which resolutions and aspect ratios does Kling Image 4.0 support?

resolution is 2k, 4k or 8k. aspect_ratio is auto, 1:1, 16:9, 9:16, 4:3, 3:4, 3:2, 2:3 or 21:9. resolution, aspect_ratio and num_outputs are required on every task.

04

How does aspect_ratio auto work?

auto follows your reference images, so the new picture takes their shape. Without reference images, auto gives 1:1. Pick a fixed ratio when the image has to fit an exact slot.

05

How many reference images can I use, and in which formats?

Up to 10 per task, as public http(s) links in image_urls, named in the prompt as @Image1, @Image2 and so on in that order. Use JPEG, PNG or WebP. HEIC and HEIF don't work, so convert iPhone photos to JPEG first; the studio on this page does it for you.

06

What happens if only some of my images are generated?

The task still succeeds and outputs contains only the images that were made, so it can be shorter than num_outputs; this happens, for example, when moderation blocks one image. You're charged for the images you got and the rest goes back to your balance. Only when no image comes back does the task fail, with a full refund.

07

How long does it take, and how long are the results kept?

About a minute and a half for a 2k image. Each image comes as a PNG at outputs[].url and a JPEG preview of up to 1024 pixels on the long side at preview_url, on public links kept for 15 days, so copy the files you want to keep to your own storage. In production, pass a webhook_url to be notified once when the task finishes instead of polling.

Start Creating With Kling Image 4.0

Try Kling Image 4.0 in the studio above, then use the Kling Image 4.0 API to bring the same model into your product.