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

# Kling Image 4.0 Long Image

> The Kling Image 4.0 Long Image API designs a full-length webpage or ecommerce product detail page as one tall image from a prompt, with optional product, style, and subject reference images.

> [!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 response result through the unified [Query Task Status](https://docs.poyo.ai/api-manual/task-management/status.md) endpoint.

Use `kling-4.0-long-image` to design a complete website page or an ecommerce product detail page as one tall image, from the first section to the footer. It suits landing page mockups, site redesign concepts, and product detail pages for online stores. Kling Image 4.0 Long Image is part of the Kling Image 4.0 family from Kuaishou.

## Models

* **kling-4.0-long-image** — Long-image design for webpages and ecommerce product detail pages

## Features

* Webpage designs: a full site layout, such as hero, product showcase, story, and footer sections, in one tall image.
* Ecommerce product detail pages built around 1 to 3 product images, in short, medium, or long page lengths.
* Style reference (`@StyleImage`) and subject reference (`@SubjectImage`) for webpage designs.
* `1K` (1024 pixels wide) or `2K` (2048 pixels wide) output. The height follows the content.
* PNG output.

## Input modes

* **Webpage** (`skill`: `webpage`, default) — Describe the site and its sections in `prompt`. Optionally pass `style_image_url` so the design follows its visual and layout style (`@StyleImage`), and `subject_image_url` so the design is built around the subject it shows (`@SubjectImage`).
* **Ecommerce** (`skill`: `ecommerce`) — Pass 1 to 3 product images in `image_urls` (`@Image1`, `@Image2`, `@Image3`) and describe the detail page in `prompt`. Choose the page length with `length`.

## Required parameters

* `prompt` (string): Description of the page and its sections, 1–50,000 characters. Must contain non-whitespace text. Refer to product images as `@Image1`, `@Image2`, `@Image3`, to the style reference as `@StyleImage`, and to the subject reference as `@SubjectImage`.

## Optional parameters

* `skill` (string): `webpage` or `ecommerce`. Default is `webpage`.
* `image_urls` (array of strings): 1 to 3 publicly accessible HTTP(S) product image URLs for `ecommerce`, required in that 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.
* `style_image_url` (string): Style reference image URL for `webpage`. The design follows its visual and layout style.
* `subject_image_url` (string): Subject reference image URL for `webpage`. The design is built around the subject it shows.
* `length` (string): Page length for `ecommerce`: `short` (about 2–5 sections), `medium` (about 6–10 sections), or `long` (about 11–18 sections). Default is `medium`.
* `resolution` (string): `1K` or `2K`. Default is `1K`.

## Output

* One tall PNG image is returned in `files`. The width is 1024 pixels at `1K` and 2048 pixels at `2K`; the height depends on the content and page length.
* Examples: a `webpage` design at `1K` is about 1024×5848; an `ecommerce` `long` page at `2K` can reach 2048×54941 (about 87 MB).

## Examples

### Webpage

A coffee brand website that follows the style of a reference image:

```json theme={"dark"}
{
  "model": "kling-4.0-long-image",
  "input": {
    "prompt": "Design a long image for a specialty coffee brand's official website, including the hero section, product showcase, roasting philosophy, store information, and footer. Follow the visual style of @StyleImage.",
    "skill": "webpage",
    "style_image_url": "https://example.com/style-reference.png",
    "resolution": "2K"
  }
}
```

### Ecommerce Detail Page

A medium-length product detail page built from one product image:

```json theme={"dark"}
{
  "model": "kling-4.0-long-image",
  "input": {
    "prompt": "Design a product detail page for the insulated water bottle in @Image1: hero shot, key features, capacity and size, materials, and lifestyle scenes.",
    "skill": "ecommerce",
    "image_urls": ["https://example.com/water-bottle.png"],
    "length": "medium",
    "resolution": "1K"
  }
}
```

## Notes

* `image_urls` and `length` are used with `skill` `ecommerce`; `style_image_url` and `subject_image_url` are used with `skill` `webpage`.
* `image_urls` must be an array, even for one image.
* Each request generates one image.
* A long image usually takes about 2 to 12 minutes: webpage designs and `1K` ecommerce pages about 2 to 4 minutes, and `long` ecommerce pages at `2K` up to about 12 minutes. Use `callback_url` or poll [Query Task Status](https://docs.poyo.ai/api-manual/task-management/status.md) until the task finishes.
* For regular images, image editing, and image series, use [Kling Image 4.0](https://docs.poyo.ai/api-manual/image-series/kling-4-0-image.md).


## OpenAPI

````yaml api-manual/image-series/kling-4-0-long-image.json POST /api/generate/submit
openapi: 3.0.0
info:
  title: PoYo AI - Kling Image 4.0 Long Image API
  description: >-
    The Kling Image 4.0 Long Image API designs a full-length webpage or
    ecommerce product detail page as one tall image from a prompt, with optional
    product, style, and subject reference images.
  version: 1.0.0
servers:
  - url: https://api.poyo.ai
    description: Production server
security:
  - BearerAuth: []
paths:
  /api/generate/submit:
    post:
      tags:
        - Kling Image 4.0 Long Image
      summary: Submit Kling Image 4.0 Long Image Task
      description: >-
        Kling Image 4.0 long-image design for webpages and ecommerce product
        detail pages.
      operationId: submitKlingImage40LongImageTask
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SubmitRequest'
            examples:
              webpage:
                summary: Webpage
                value:
                  model: kling-4.0-long-image
                  input:
                    prompt: >-
                      Design a long image for a specialty coffee brand's
                      official website, including the hero section, product
                      showcase, roasting philosophy, store information, and
                      footer. Follow the visual style of @StyleImage.
                    skill: webpage
                    style_image_url: https://example.com/style-reference.png
                    resolution: 2K
              ecommerce:
                summary: Ecommerce Detail Page
                value:
                  model: kling-4.0-long-image
                  input:
                    prompt: >-
                      Design a product detail page for the insulated water
                      bottle in @Image1: hero shot, key features, capacity and
                      size, materials, and lifestyle scenes.
                    skill: ecommerce
                    image_urls:
                      - https://example.com/water-bottle.png
                    length: medium
                    resolution: 1K
      responses:
        '200':
          description: Task submitted successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubmitResponse'
        '400':
          description: Invalid request parameters
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    SubmitRequest:
      type: object
      required:
        - model
        - input
      additionalProperties: false
      properties:
        model:
          type: string
          enum:
            - kling-4.0-long-image
          description: Kling Image 4.0 Long Image model identifier.
        callback_url:
          type: string
          format: uri
          description: Optional webhook URL for task completion or failure.
        input:
          type: object
          additionalProperties: false
          required:
            - prompt
          description: >-
            Generate one tall image: a webpage design (skill webpage) or an
            ecommerce product detail page built from 1–3 product images (skill
            ecommerce).
          properties:
            prompt:
              type: string
              minLength: 1
              maxLength: 50000
              description: >-
                Prompt describing the page and its sections. Must contain
                non-whitespace text. Refer to product images as @Image1,
                @Image2, and @Image3, to the style reference as @StyleImage, and
                to the subject reference as @SubjectImage.
            skill:
              type: string
              enum:
                - webpage
                - ecommerce
              default: webpage
              description: >-
                Design type. webpage designs a website page; ecommerce designs a
                product detail page from 1–3 product images in image_urls.
            image_urls:
              type: array
              minItems: 1
              maxItems: 3
              items:
                type: string
                format: uri
              description: >-
                Product image URLs for skill ecommerce, 1–3 images (required in
                that mode). Must be an array, even for one image. Images are
                numbered by their order: @Image1, @Image2, @Image3. Each URL
                must be a publicly accessible HTTP or HTTPS URL pointing to an
                image of up to 30 MB, at least 300 pixels wide and high, with an
                aspect ratio (width / height) between 0.4 and 2.5.
              example:
                - https://example.com/water-bottle.png
            style_image_url:
              type: string
              format: uri
              description: >-
                Optional style reference for skill webpage, referenced as
                @StyleImage. The design follows its visual and layout style.
                Publicly accessible HTTP or HTTPS image URL with the same limits
                as image_urls.
            subject_image_url:
              type: string
              format: uri
              description: >-
                Optional subject reference for skill webpage, referenced as
                @SubjectImage. The design is built around the subject it shows.
                Publicly accessible HTTP or HTTPS image URL with the same limits
                as image_urls.
            length:
              type: string
              enum:
                - short
                - medium
                - long
              default: medium
              description: >-
                Page length for skill ecommerce: short (about 2–5 sections),
                medium (about 6–10 sections), or long (about 11–18 sections).
            resolution:
              type: string
              enum:
                - 1K
                - 2K
              default: 1K
              description: >-
                Output width: 1K is 1024 pixels wide, 2K is 2048 pixels wide.
                The height follows the content.
    SubmitResponse:
      type: object
      required:
        - code
        - data
      properties:
        code:
          type: integer
          example: 200
          description: >-
            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`: Success

            - `400`: Invalid request parameters

            - `401`: Missing or invalid API key

            - `402`: Insufficient credits

            - `403`: Permission denied

            - `404`: Resource not found

            - `408`: Request timeout

            - `429`: Rate limit exceeded

            - `500`: Internal server error

            - `502`: Upstream service error

            - `503`: Service unavailable


            See [Error Codes](/api-manual/error-codes) for details.
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
        data:
          type: object
          required:
            - task_id
            - status
            - created_time
          properties:
            task_id:
              type: string
              example: task-unified-1794470400-abcd1234
              description: Unique task identifier for status tracking
            status:
              type: string
              enum:
                - not_started
                - running
                - finished
                - failed
              example: not_started
              description: >-
                Task status. Always `not_started` right after submission. Use
                [Query Task Status](/api-manual/task-management/status) or
                `callback_url` to get later states.


                - `not_started`: Queued, waiting to be processed

                - `running`: Being generated

                - `finished`: Completed; results are in `files` or `output`

                - `failed`: Failed; details are in `error_message`
            created_time:
              type: string
              format: date-time
              example: '2026-11-12T10:30:00'
              description: ISO 8601 timestamp when the task was created
    ErrorResponse:
      type: object
      required:
        - code
        - error
      properties:
        code:
          type: integer
          example: 400
          enum:
            - 200
            - 400
            - 401
            - 402
            - 403
            - 404
            - 408
            - 429
            - 500
            - 502
            - 503
          description: >-
            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`: Success

            - `400`: Invalid request parameters

            - `401`: Missing or invalid API key

            - `402`: Insufficient credits

            - `403`: Permission denied

            - `404`: Resource not found

            - `408`: Request timeout

            - `429`: Rate limit exceeded

            - `500`: Internal server error

            - `502`: Upstream service error

            - `503`: Service unavailable


            See [Error Codes](/api-manual/error-codes) for details.
        error:
          type: object
          required:
            - message
            - type
          properties:
            message:
              type: string
              example: Invalid request parameters
            type:
              type: string
              example: invalid_request_error
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        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](https://poyo.ai/dashboard/api-key), and
        click to create a key.


        Add it to the request header:


        ```

        Authorization: Bearer YOUR_API_KEY

        ```

````

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