curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4.0-image",
"input": {
"prompt": "High fashion model wearing a dress made of living moss, standing in an abandoned greenhouse, shafts of light, editorial photography",
"size": "16:9",
"resolution": "4K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1794470400-abcd1234",
"status": "not_started",
"created_time": "2026-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}Kling
Kling Image 4.0
The Kling Image 4.0 API generates images from a prompt or edits up to 10 reference images. It supports elements for consistent subjects, coherent image series, and 2K, 4K, or 8K output.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.poyo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4.0-image",
"input": {
"prompt": "High fashion model wearing a dress made of living moss, standing in an abandoned greenhouse, shafts of light, editorial photography",
"size": "16:9",
"resolution": "4K"
}
}
'{
"code": 200,
"data": {
"task_id": "task-unified-1794470400-abcd1234",
"status": "not_started",
"created_time": "2026-11-12T10:30:00"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}{
"code": 400,
"error": {
"message": "Invalid request parameters",
"type": "invalid_request_error"
}
}- After submission, a
task_idwill be returned. If you provided acallback_url, when the task status becomesfinishedorfailed, a POST request will be sent to thecallback_url. - Regardless of whether
callback_urlis provided, you can retrieve the response result through the unified Query Task Status endpoint.
kling-4.0-image to create photos, posters, product shots, and storyboards from a prompt, or pass reference images to edit and combine them with the same model ID. Kling Image 4.0 is the image model of the Kling 4.0 family from Kuaishou, with output up to 8K.
Models
- kling-4.0-image — Text-to-image when
image_urlsis omitted; image-to-image with 1 to 10 reference images whenimage_urlsis provided
Features
- Text-to-image generation from prompts of up to 50,000 characters.
- Image-to-image editing and multi-reference composition with up to 10 reference images, referenced in the prompt as
@Image1,@Image2, and so on. - Elements: up to 7 characters or objects, each shown from 2 to 4 angles and referenced in the prompt as
@Element1,@Element2, and so on, to keep a subject consistent. - Image series: generate 2 to 10 coherent images with consistent subjects and style in one request, returned in order.
- Up to 9 independent images per request.
2K,4K, or8Koutput in eight aspect ratios, orautoto let the model choose.- PNG output.
Input modes
- Text-to-image — Omit
image_urls. Describe the whole image inprompt. - Image-to-image — Pass 1 to 10 URLs in
image_urls. The first URL is@Image1, the second is@Image2, and so on. In this mode you can also pass up to 7 elements inkling_elements; the first element is@Element1. Use these tags in the prompt to say what to keep, change, or combine.image_urlsandkling_elementstogether hold up to 10 items.
Required parameters
prompt(string): Description of the image or the requested edit, 1–50,000 characters. Must contain non-whitespace text. In image-to-image mode, refer to reference images as@Image1,@Image2, … and to elements as@Element1,@Element2, ….
Optional parameters
image_urls(array of strings): 1 to 10 publicly accessible HTTP(S) reference image URLs. Selects image-to-image mode. Each image can be up to 30 MB, at least 300 pixels wide and high, with an aspect ratio (width / height) between 0.4 and 2.5.kling_elements(array of objects): Up to 7 elements for image-to-image mode, used together withimage_urls. Each element is{"element_input_urls": [...]}with 2 to 4 image URLs of the same character or object: the frontal view first, followed by 1 to 3 views from other angles. The number ofimage_urlsplus the number of elements is at most 10.size(string):auto,16:9,9:16,1:1,4:3,3:4,3:2,2:3, or21:9. Default isauto, which picks an aspect ratio from the prompt and reference images.resolution(string):2K,4K, or8K. Default is2K. See Resolution.enable_sequential(boolean): Default isfalse, which generatesnindependent images.truegenerates a coherent image series ofnimages, returned in order.n(integer): Number of images. Whenenable_sequentialisfalse: 1–9, default 1. Whenenable_sequentialistrue: 2–10, default 4.
Resolution
resolution | Example output | Typical PNG file size |
|---|---|---|
2K | 2048×2048 at 1:1 | about 7.5 MB |
4K | 5440×3072 at 16:9 | about 27 MB |
8K | 8192×8192 at 1:1 | about 100 MB |
Output
- Images are returned in
filesas PNG. An image series is returned in order.
Examples
Text To Image
A 4K 16:9 editorial photo:{
"model": "kling-4.0-image",
"input": {
"prompt": "High fashion model wearing a dress made of living moss, standing in an abandoned greenhouse, shafts of light, editorial photography",
"size": "16:9",
"resolution": "4K"
}
}
Image To Image With Elements
Place a character, described by three views, into the room from a reference image:{
"model": "kling-4.0-image",
"input": {
"prompt": "Place @Element1 sitting on the sofa in @Image1, reading a book in warm evening light. Keep the room layout of @Image1 unchanged.",
"image_urls": ["https://example.com/living-room.png"],
"kling_elements": [
{
"element_input_urls": [
"https://example.com/character-front.png",
"https://example.com/character-side.png",
"https://example.com/character-back.png"
]
}
],
"resolution": "2K"
}
}
Image Series
Four coherent panels that tell one story:{
"model": "kling-4.0-image",
"input": {
"prompt": "A four-panel story of a paper boat drifting from a rainy city gutter to a calm sunny lake, same boat in every panel, watercolor style",
"size": "3:2",
"enable_sequential": true,
"n": 4
}
}
Notes
image_urlsmust be an array, even for one image.- To use
kling_elements, also pass at least one image inimage_urls. - Reference images and elements are numbered by their order in
image_urlsandkling_elements. For best results, give each one a role in the prompt. - Typical time from submission to
finished: one 2K image about 45 seconds, one 4K image a little over 1 minute, and one 8K image about 2.5 minutes. Image-to-image requests take about 1 to 2.5 minutes, a 3-image 2K series about 3.5 minutes, nine 8K images about 10 minutes, and a 10-image 8K series about 30 minutes. For larger requests, usecallback_urlor poll Query Task Status until the task finishes. - For full-length webpage and ecommerce detail-page designs, use Kling Image 4.0 Long Image.
Authorizations
All API endpoints require Bearer Token authentication.
Create an API key: sign in to PoYo, open Dashboard → API Key at poyo.ai/dashboard/api-key, and click to create a key.
Add it to the request header:
Authorization: Bearer YOUR_API_KEY
Body
application/json
Response
Task submitted successfully
Business status code. 200 means success; any other value means the request failed. Always check this field: some validation errors return HTTP 200 with code: 400 in the body.
200: Success400: Invalid request parameters401: Missing or invalid API key402: Insufficient credits403: Permission denied404: Resource not found408: Request timeout429: Rate limit exceeded500: Internal server error502: Upstream service error503: Service unavailable
See Error Codes for details.
Available options:
200, 400, 401, 402, 403, 404, 408, 429, 500, 502, 503 Example:
200