> ## Documentation Index
> Fetch the complete documentation index at: https://docs.vidgo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# 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.

> [!TIP]
>
> 1. After submission, a `task_id` will be returned. If you provided a `callback_url`, when the task status becomes `finished` or `failed`, a POST request will be sent to the `callback_url`.
> 2. Regardless of whether `callback_url` is provided, you can retrieve the result through the unified [Query Task Status](https://docs.vidgo.ai/api-manual/task-management/status.md) endpoint.

Kling Image 4.0 Edit changes or combines reference images from text instructions. Refer to images by position (`@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](https://docs.vidgo.ai/api-manual/image-series/kwaivgi-kling-image-v4-0-text-to-image.md).

## 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 as `image_urls`. `image_urls` plus elements is at most 10.
* `size` (string): `auto`, `16:9`, `9:16`, `1:1`, `4:3`, `3:4`, `3:2`, `2:3` or `21:9`. Default `auto`, which picks an aspect ratio from the prompt and reference images.
* `resolution` (string): `2K`, `4K` or `8K`. Default `2K`.
* `enable_sequential` (boolean): `true` generates a coherent series of `n` related images with consistent subjects and style. Default `false`.
* `n` (integer): Number of images. 1–9 (default 1) when `enable_sequential` is `false`; 2–10 (default 4) when it is `true`.

## Resolution

| `resolution` | Example size |
| - | - |
| `2K` | 2048x2048 at `1:1` |
| `4K` | 5440x3072 at `16:9` |
| `8K` | 8192x8192 at `1:1` |

Output images are PNG files. An 8K image can be larger than 100 MB, and 4K images are about 25–30 MB, so allow for longer downloads.

## Examples

* **Reference image and element**: place a character from three angles into a living room photo at `2K`.
* **Combine images**: move an object from `@Image2` into `@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: true` the model decides the final composition of the series; occasionally it returns fewer images than `n`.
* Put `model` and `callback_url` at the request root, next to `input`. `input` accepts the fields listed above; other fields return 400.
* Credits depend on `resolution` and 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 than `n`, the missing images are refunded when the task finishes. A failed task is refunded in full. See the [pricing page](https://vidgo.ai/apis/api-pricing) for current rates.


## OpenAPI

````yaml api-manual/image-series/kwaivgi-kling-image-v4-0-edit.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Kling Image 4.0 Edit
  description: >-
    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.
  version: 1.0.0
servers:
  - url: https://api.vidgo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Kling Image 4.0 Edit
      summary: Submit Kling Image 4.0 Edit Task
      operationId: submitKlingImage40EditTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              edit-with-element:
                summary: Edit with a reference image and an element
                value:
                  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
              combine-images:
                summary: Combine two reference images
                value:
                  model: kwaivgi/kling-image-v4.0/edit
                  input:
                    prompt: >-
                      Put the lamp from @Image2 on the side table in @Image1 and
                      turn it on.
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-living-room.png
                      - https://cdn.vidgo.ai/temp/reference-lamp.png
                    size: auto
              edit-series:
                summary: Coherent series from a reference image
                value:
                  model: kwaivgi/kling-image-v4.0/edit
                  input:
                    prompt: >-
                      Show the living room in @Image1 at four times of day:
                      dawn, noon, sunset and night.
                    image_urls:
                      - https://cdn.vidgo.ai/temp/reference-living-room.png
                    enable_sequential: true
                    'n': 4
                    resolution: 4K
      responses:
        '200':
          description: >-
            Task submission result. A task ID identifies asynchronous work;
            generation may still be running.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          example: kwaivgi/kling-image-v4.0/edit
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for completion or failure notifications.
          example: https://your-domain.com/callback
        input:
          type: object
          required:
            - prompt
            - image_urls
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 50000
              description: >-
                Instructions for the edit. Refer to reference images as @Image1,
                @Image2, and so on, and to elements as @Element1, @Element2, and
                so on.


                Include at least one non-whitespace character.
            image_urls:
              type: array
              minItems: 1
              maxItems: 10
              items:
                type: string
                format: uri
                description: Use a publicly accessible HTTP(S) download URL.
              description: >-
                Required reference images, numbered by order: the first URL is
                @Image1, the second is @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.
            kling_elements:
              type: array
              minItems: 1
              maxItems: 7
              items:
                type: object
                required:
                  - element_input_urls
                additionalProperties: false
                properties:
                  element_input_urls:
                    type: array
                    minItems: 2
                    maxItems: 4
                    items:
                      type: string
                      format: uri
                    description: >-
                      2–4 publicly accessible HTTP(S) images of this element:
                      the frontal view first, followed by 1–3 views from other
                      angles. Each image has the same limits as image_urls.
                description: 'One element: a character or object.'
              description: >-
                Optional elements, up to 7. Each element is one character or
                object shown from several angles, referenced in the prompt by
                position as @Element1, @Element2, and so on. The number of
                image_urls plus the number of elements is at most 10.
            size:
              type: string
              enum:
                - auto
                - '16:9'
                - '9:16'
                - '1:1'
                - '4:3'
                - '3:4'
                - '3:2'
                - '2:3'
                - '21:9'
              default: auto
              description: >-
                Output aspect ratio. `auto` picks an aspect ratio from the
                prompt and reference images.
            resolution:
              type: string
              enum:
                - 2K
                - 4K
                - 8K
              default: 2K
              description: >-
                Output resolution. For example, 2K is 2048x2048 at 1:1, 4K is
                5440x3072 at 16:9, and 8K is 8192x8192 at 1:1.
            enable_sequential:
              type: boolean
              default: false
              description: >-
                When true, generate a coherent image series: `n` related images
                with consistent subjects and style, returned in order. When
                false, generate `n` independent images.
            'n':
              type: integer
              minimum: 1
              maximum: 10
              description: >-
                Number of images. With `enable_sequential` false: 1–9, default
                1. With `enable_sequential` true: 2–10, default 4.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-example-001
            status:
              type: string
              example: not_started
            created_time:
              type: string
              format: date-time
              example: '2026-11-19T10:30:00'
    ErrorResponse:
      type: object
      required:
        - detail
      properties:
        detail:
          type: string
          description: Error message. See [Error Codes](/api-manual/error-codes).
          example: prompt is required
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: 'Use `Authorization: Bearer VIDGO_API_KEY`.'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.