curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kwaivgi/kling-image-v4.0/edit",
"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://cdn.vidgo.ai/temp/reference-living-room.png"
],
"resolution": "2K",
"kling_elements": [
{
"element_input_urls": [
"https://cdn.vidgo.ai/temp/character-front.png",
"https://cdn.vidgo.ai/temp/character-side.png",
"https://cdn.vidgo.ai/temp/character-back.png"
]
}
]
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}Kling
Kling Image 4.0 Edit
The Kling Image 4.0 Edit API edits or combines 1–10 reference images and up to 7 multi-angle elements into 2K, 4K or 8K images or a coherent series.
POST
/
api
/
generate
/
submit
curl --request POST \
--url https://api.vidgo.ai/api/generate/submit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kwaivgi/kling-image-v4.0/edit",
"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://cdn.vidgo.ai/temp/reference-living-room.png"
],
"resolution": "2K",
"kling_elements": [
{
"element_input_urls": [
"https://cdn.vidgo.ai/temp/character-front.png",
"https://cdn.vidgo.ai/temp/character-side.png",
"https://cdn.vidgo.ai/temp/character-back.png"
]
}
]
}
}
'{
"code": 200,
"data": {
"task_id": "task-example-001",
"status": "not_started",
"created_time": "2026-11-19T10:30:00"
}
}{
"detail": "prompt is required"
}{
"detail": "prompt is required"
}- 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 result through the unified Query Task Status endpoint.
@Image1, @Image2), add elements — a character or object shown from several angles — to keep a subject consistent, and output up to 8K or a coherent image series.
For prompt-only generation, use Kling Image 4.0 Text to Image.
Models
- kwaivgi/kling-image-v4.0/edit — Image edit with Kling Image 4.0, 1–10 reference images and up to 7 elements.
Features
- Edit one image or combine up to 10 reference images, referenced as
@Image1,@Image2… in the prompt. - Elements (
kling_elements): up to 7 characters or objects, each from 2–4 angles, referenced as@Element1,@Element2… - Native 2K, 4K and 8K output; up to 9 images or a coherent 2–10 image series.
Required parameters
prompt(string): Instructions for the edit. 1–50,000 characters of text. Refer to reference images as@Image1,@Image2, and to elements as@Element1,@Element2.image_urls(string[]): 1–10 reference images. The first URL is@Image1, the second@Image2, and so on. Each image must be a publicly accessible HTTP(S) URL, up to 30 MB, at least 300 pixels wide and high, with an aspect ratio (width / height) between 0.4 and 2.5.
Optional parameters
kling_elements(object[]): Up to 7 elements. Each element is{"element_input_urls": [...]}with 2–4 images of one character or object: the frontal view first, then 1–3 other angles. Images have the same limits asimage_urls.image_urlsplus elements is at most 10.size(string):auto,16:9,9:16,1:1,4:3,3:4,3:2,2:3or21:9. Defaultauto, which picks an aspect ratio from the prompt and reference images.resolution(string):2K,4Kor8K. Default2K.enable_sequential(boolean):truegenerates a coherent series ofnrelated images with consistent subjects and style. Defaultfalse.n(integer): Number of images. 1–9 (default 1) whenenable_sequentialisfalse; 2–10 (default 4) when it istrue.
Resolution
resolution | Example size |
|---|---|
2K | 2048x2048 at 1:1 |
4K | 5440x3072 at 16:9 |
8K | 8192x8192 at 1:1 |
Examples
- Reference image and element: place a character from three angles into a living room photo at
2K. - Combine images: move an object from
@Image2into@Image1. - Series from a reference: four times of day in the same room,
enable_sequential: true,4K.
Notes
- Missing
image_urls, more than 10 images, more than 7 elements, an element with fewer than 2 or more than 4 images, or more than 10 images and elements together returns 400. - Reference images are checked against the image limits (up to 30 MB, at least 300 pixels per side, aspect ratio 0.4–2.5) during generation; a task that stops at this check is refunded in full.
- With
enable_sequential: truethe model decides the final composition of the series; occasionally it returns fewer images thann. - Put
modelandcallback_urlat the request root, next toinput.inputaccepts the fields listed above; other fields return 400. - Credits depend on
resolutionand the number of images (n), plus a charge for each reference image and element that is charged once per task. If a series returns fewer images thann, the missing images are refunded when the task finishes. A failed task is refunded in full. See the pricing page for current rates.
Body
application/json