Kling Image 4.0 Image to Image overview
Kling Image 4.0 Image to Image by Kling AI
Kling AI built this endpoint to create images from a text prompt guided by reference images and elements. One request returns either independent images or a related set.
Kling Image 4.0 Image to Image specs
- Model ID
klingai/image-v4-image-to-image- Developer
- Kling AI
- Input
- Image, Text
- Output
- Image
- Endpoint
POST https://api.aimlapi.com/v1/images/generations
Independent images or a series
The result type option decides what one request returns. Single gives separate images with no link between them, which suits comparing several takes on one prompt. Series gives a coherent set of related images, which suits a sequence that must hold together.
The two modes use different count options. Single reads the number of images, from 1 to 9. Series reads the series amount, from 2 to 10. Set only the count that matches the chosen result type.
Resolution and aspect ratio
Resolution accepts 2K, 4K or 8K. A 1:1 image measures 2048, 4096 or 8192 pixels a side. Larger sizes raise the price per image, so start with 2K while you iterate on the prompt and references.
Aspect ratio offers eight fixed shapes, including 16:9, 9:16 and 21:9. Auto lets the model pick the shape from the prompt and the references. Set a fixed ratio when the image must fit a known layout, and leave auto for exploration.
Use cases
Generate a set of 9 variations of a product shot from one prompt and several reference photos.
Produce a coherent series of images for a storyboard or a campaign with a consistent look.
Create large 8K images from reference material for print or detailed crops.
Fit generated images to a banner, a story or a widescreen frame by choosing the aspect ratio.
Kling Image 4.0 Image to Image API pricing
| Usage | Price | Unit |
|---|---|---|
| Image generation | $0.063 | per generation |
The final price depends on request parameters such as resolution or duration.
Prices from the AI/ML API price list, checked on Nov 17, 2026.
Kling Image 4.0 Image to Image vs other image models: prices
AI/ML API rates for 5 models, per generation.
| Model | Per generation |
|---|---|
| $0.063 | |
| $0.028 | |
| $0.06 | |
| $0.075 | |
| $0.075 |
How to use the Kling Image 4.0 Image to Image API
View docsBuild with your agent
Give your agent the model details, code and documentation.
1Get your API key
Create API keyexport AIMLAPI_KEY="8f2b4c7d9a1e6b3f…"2Make your first request
curl 'https://api.aimlapi.com/v1/images/generations' \
-H "Authorization: Bearer $AIMLAPI_KEY" \
-H 'Content-Type: application/json' \
-d '{
"model": "klingai/image-v4-image-to-image",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo.",
"image_urls": [
"https://example.com/input.jpg"
]
}'import os
import requests
headers = {
"Authorization": f"Bearer {os.environ['AIMLAPI_KEY']}",
"Content-Type": "application/json",
}
payload = {
"model": "klingai/image-v4-image-to-image",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo.",
"image_urls": [
"https://example.com/input.jpg"
]
}
response = requests.post("https://api.aimlapi.com/v1/images/generations", headers=headers, json=payload, timeout=120)
response.raise_for_status()
print(response.json())const response = await fetch("https://api.aimlapi.com/v1/images/generations", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.AIMLAPI_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
"model": "klingai/image-v4-image-to-image",
"prompt": "A ginger cat asleep on a stack of exactly three hardcover books in a rainy bookshop window at dusk. Gold lettering on the glass reads OPEN LATE. Warm lamp light inside, raindrops and blurred neon reflections outside, 35mm film photo.",
"image_urls": [
"https://example.com/input.jpg"
]
}),
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
console.log(await response.json());Kling Image 4.0 Image to Image FAQ
How much does Kling Image 4.0 Image to Image cost?
Kling Image 4.0 Image to Image costs $0.063 / gen (variable) on AI/ML API.
How many reference images can I use?
Kling AI describes support for a prompt plus up to 10 reference images and elements. The request options listed for this endpoint cover the output settings only.
What is the difference between single and series?
Single returns independent images, 1 to 9 of them. Series returns a coherent set of related images, 2 to 10 of them.
Which resolutions can I request?
You can request 2K, 4K or 8K. For a 1:1 image that is 2048, 4096 or 8192 pixels a side.
Can the model choose the aspect ratio itself?
Yes. Set aspect ratio to auto and the model picks it from the prompt and the references. Otherwise choose one of the fixed ratios such as 16:9, 9:16 or 3:2.
What is the Kling Image 4.0 Image to Image model ID?
Use klingai/image-v4-image-to-image as the model parameter. Requests go to https://api.aimlapi.com/v1/images/generations with your AI/ML API key.