> ## 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 Text to Image

> The Kling Image 4.0 Text to Image API generates 1–9 images or a coherent 2–10 image series from a prompt, at 2K, 4K or native 8K resolution.

> [!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 Text to Image turns a prompt into high-resolution images, from 2K up to native 8K. Generate up to 9 independent images per request, or a coherent series of 2–10 images that keep the same subject and style, for storyboards, product sets and step-by-step visuals.

To edit or combine reference images, use [Kling Image 4.0 Edit](https://docs.vidgo.ai/api-manual/image-series/kwaivgi-kling-image-v4-0-edit.md). For full-length webpage or product detail page designs, use [Kling Image 4.0 Long Image](https://docs.vidgo.ai/api-manual/image-series/kwaivgi-kling-image-v4-0-long-image.md).

## Models

* **kwaivgi/kling-image-v4.0/text-to-image** — Text-to-image with Kling Image 4.0, 1–9 images or a 2–10 image series per request.

## Features

* Native 2K, 4K and 8K output.
* Up to 9 independent images per request.
* Coherent image series (`enable_sequential`): 2–10 images with a consistent subject and style, returned in order.
* Nine aspect ratios, or `auto` to let the model choose.

## Required parameters

* `prompt` (string): Description of the image. 1–50,000 characters of text.

## Optional parameters

* `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.
* `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

* **One 4K image**: an editorial fashion shot at `16:9`, `4K`.
* **Several independent images**: three variations of a product shot with `n: 3`.
* **Coherent image series**: a four-panel watercolor story with `enable_sequential: true` and `n: 4`.

## Notes

* `n` takes 1–9 (2–10 with `enable_sequential: true`) and `resolution` takes `2K`, `4K` or `8K`; other values return 400. For reference images, use [Kling Image 4.0 Edit](https://docs.vidgo.ai/api-manual/image-series/kwaivgi-kling-image-v4-0-edit.md).
* 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`). 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-text-to-image.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: Vidgo API - Kling Image 4.0 Text to Image
  description: >-
    The Kling Image 4.0 Text to Image API generates 1–9 images or a coherent
    2–10 image series from a prompt, at 2K, 4K or native 8K resolution.
  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 Text to Image
      summary: Submit Kling Image 4.0 Text to Image Task
      operationId: submitKlingImage40TextToImageTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              single-4k:
                summary: One 4K image
                value:
                  model: kwaivgi/kling-image-v4.0/text-to-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
              multiple-images:
                summary: Several independent images
                value:
                  model: kwaivgi/kling-image-v4.0/text-to-image
                  input:
                    prompt: >-
                      Minimalist ceramic coffee mug on a stone counter, morning
                      light, product photography
                    size: '1:1'
                    'n': 3
              image-series:
                summary: Coherent image series
                value:
                  model: kwaivgi/kling-image-v4.0/text-to-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
      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/text-to-image
        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
          additionalProperties: false
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 50000
              description: |-
                Description of the image to generate.

                Include at least one non-whitespace character.
            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.
            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.