Kling Image 4.0 API: cURL, Python, and Node.js Examples
Runnable Kling image API examples for Kuaishou Kling Image 4.0 through PoYo's async image API: text-to-image and multi-reference image editing at 2K, 4K, or native 8K, image sets of up to 10 matching images, and full webpage or ecommerce product pages as one long image.
Answer: To use the Kling Image 4.0 API, send a server-side request to POST https://api.poyo.ai/api/generate/submit with model kling-4.0-image (images and edits) or kling-4.0-long-image (long page designs) and a PoYo API key, then poll GET https://api.poyo.ai/api/generate/status/{task_id} and read the PNG URLs in data.files. The examples in this repository run with Python 3.9+, Node.js 22+, or cURL.
Last verified against the live PoYo schema and pricing on November 19, 2026.
Kling Image 4.0 at a glance
- Model IDs:
kling-4.0-image and kling-4.0-long-image on POST https://api.poyo.ai/api/generate/submit
- Released: November 17, 2026 by Kling AI (Kuaishou); live on PoYo since November 19, 2026
- Output: PNG at
2K, 4K, or 8K (for example 2048×2048, 5440×3072 at 16:9, 8192×8192 at 1:1); long pages 1024 or 2048 pixels wide
- Inputs: a prompt of up to 50,000 characters, plus up to 10 reference images and multi-angle elements (
@Image1, @Element1)
- Aspect ratios: auto, 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3, 21:9
- Images per request: 1–9 independent images, or a coherent image set of 2–10 with
enable_sequential
- Text in images: up to 2,000 characters in seven languages, according to Kling
- Price: from 13 credits ($0.065) per 2K image, 19 ($0.095) at 4K, 32 ($0.16) at 8K; long pages from 47 credits ($0.235); pay-as-you-go with one PoYo API key
- Speed: one 2K image in about 1 minute and one 8K image in about 2.5 minutes, in PoYo testing
Kling Image 4.0 API examples (images)
Real Kling Image 4.0 outputs generated through PoYo. Click a preview with a link to open the full-resolution PNG.
 Edit with @Image1 + @Element1 · 2K · 15 credits The output of payloads/kling-4.0-image-edit-with-element.json |
 Native 8K · 7040×9344 · 32 credits Full frame and a detail crop; the output of payloads/kling-4.0-image-8k.json (PNG about 77 MB) |
 Image set · 3 × 2K · 39 credits The output of payloads/kling-4.0-image-series.json: 1 · 2 · 3 |
 8K image set · 10 × 8192×8192 · 320 credits Panels 1, 4, 7, and 10 of a ten-image story |
 Text-to-image · 4K 16:9 · 19 credits 5440×3072 landscape |
 Product angle set · 3 × 2K 1:1 · 39 credits Used as @Element1 in the edit above: 1 · 2 · 3 |
 Long image · webpage · 1K (1024×5376) · 110 credits Sections of one tall page, shown side by side; the output of payloads/kling-4.0-long-image-webpage.json |
Prompt: barista pours from the kettle (edit, 2K)
@Image1 woman now holds @Element1 kettle by its walnut handle and pours a thin stream of hot water from its gooseneck spout into the glass coffee dripper on the counter. Keep her face, curly hair, outfit, pose and the kitchen of @Image1 unchanged. Keep the kettle's sage green ceramic body, round walnut lid knob, brass ring and walnut handle exactly as in @Element1. Natural window light, editorial photography.
@Image1 is the barista portrait from payloads/kling-4.0-image-text-to-image.json; @Element1 is the three-view kettle set.
Prompt: dewdrop macro (8K)
Macro photo of a dewdrop on a green leaf reflecting a tiny garden, ultra detailed
Prompt: paper boat story (image set, 3 × 2K)
A three-panel story of a paper boat drifting from a rainy city gutter to a calm sunny lake, same boat in every panel, watercolor style
Prompt: lighthouse keeper (8K image set, 10 images)
A ten-panel visual story of a lighthouse keeper's day from dawn to night, same lighthouse and keeper in every panel, detailed illustration
Settings: resolution: "8K", enable_sequential: true, n: 10.
Prompt: mountain lake (4K, 16:9)
A misty mountain lake at sunrise with a wooden canoe, cinematic landscape photography
Prompt: kettle views (image set, 3 × 2K)
Product photography set of the same minimalist ceramic pour-over coffee kettle in matte sage green with a curved walnut wood handle and a slim gooseneck spout: front view, side profile view, and three-quarter top view, each on a clean white seamless studio background with soft shadows. The exact same kettle in every image.
Prompt: Ember & Oak webpage (long image, 1K)
A landing page for a specialty coffee roastery called Ember & Oak: hero with coffee beans, story section, three featured blends with prices, brewing guide, customer reviews and footer. Warm earthy palette.
What is Kling Image 4.0?
Kling Image 4.0 is the Kling 4.0 image model from Kling AI, the creative platform from Kuaishou, released on November 17, 2026. Kling describes its output as native 8K. Typical uses are 8K campaign visuals, storyboards and product angle sets built as image sets, product placement with multi-angle elements, website mockups, and ecommerce product detail pages.
kling-4.0-image vs kling-4.0-long-image
On PoYo, Kling Image 4.0 is available as two model IDs that share one endpoint, one API key, and one request format:
|
kling-4.0-image |
kling-4.0-long-image |
| Creates |
Photos, posters, product shots, storyboards |
One tall image for a full webpage mockup or ecommerce product detail page |
| Inputs |
Prompt, plus up to 10 reference images and up to 7 elements |
Prompt, plus 1–3 product images (ecommerce) or a style and subject reference (webpage) |
| Resolution |
2K (default), 4K, 8K |
1K (1024 px wide, default), 2K (2048 px wide) |
| Images per request |
1–9, or an image set of 2–10 |
1 |
| Price |
13 / 19 / 32 credits per image |
47–173 credits per page |
Kling Image 4.0 vs Kling O3 Image and Kling O1 Image
Compared with the earlier Kling image models on PoYo:
|
Kling Image 4.0 |
Kling O3 Image |
Kling O1 Image Edit |
| Model IDs |
kling-4.0-image, kling-4.0-long-image |
kling-o3-image, kling-o3-image-edit |
kling-o1-image-edit |
| Maximum resolution |
8K |
4K |
2K |
| References |
Up to 10 images and 7 elements, 10 items in total |
Up to 10 images, plus elements |
Up to 10 images, plus elements |
| Images per request |
1–9, or a coherent set of 2–10 |
1–9 |
1–9 |
| Long page designs |
Webpage and ecommerce pages |
Standard images |
Standard images |
| Prompt length |
Up to 50,000 characters |
Up to 2,000 characters |
Up to 2,000 characters |
| Price on PoYo |
13 / 19 / 32 credits at 2K / 4K / 8K |
3.5 credits at 1K or 2K, 7 at 4K |
3.5 credits at 1K or 2K |
Choose Kling Image 4.0 for 8K stills, image sets, and long page designs. For high-volume drafts at 1K–2K, Kling O3 Image costs fewer credits per image.
How to use the Kling Image 4.0 API
- Create a key in the PoYo dashboard.
- Copy
.env.example to .env and replace the placeholder.
- Run one of the examples. Each submits the task, polls until
finished or failed, and prints the image URLs.
POYO_API_KEY=YOUR_POYO_API_KEY_HERE
POYO_BASE_URL=https://api.poyo.ai
Python
The smallest Kling Image 4.0 API call in Python submits one request and prints the task ID:
import json
import os
import urllib.request
body = {
"model": "kling-4.0-image",
"input": {"prompt": "A misty mountain lake at sunrise with a wooden canoe", "size": "16:9", "resolution": "4K"},
}
request = urllib.request.Request(
"https://api.poyo.ai/api/generate/submit",
data=json.dumps(body).encode("utf-8"),
headers={
"Authorization": f"Bearer {os.environ['POYO_API_KEY']}",
"Content-Type": "application/json",
"User-Agent": "kling-image-4-example/1.0",
},
)
print(json.load(urllib.request.urlopen(request))["data"]["task_id"])
python/generate.py adds polling and prints the image URLs, using only the Python standard library:
python python/generate.py
python python/generate.py payloads/kling-4.0-image-edit-with-element.json
Node.js
node node/index.mjs
node node/index.mjs payloads/kling-4.0-long-image-webpage.json
cURL
curl -X POST "https://api.poyo.ai/api/generate/submit" \
-H "Authorization: Bearer $POYO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-4.0-image",
"input": {
"prompt": "A misty mountain lake at sunrise with a wooden canoe, cinematic landscape photography",
"size": "16:9",
"resolution": "4K"
}
}'
Status polling and the other modes are in curl/generate.md.
Example requests
Every file in payloads/ is a complete request body with public input images, so it runs as-is.
| File |
Model and mode |
Settings |
Credits |