Felo API PlatformFelo API Platform
Back to models

Kling Image 4.0 Long Image API

Kling Image4.0 Long Image creates polished, single long vertical visuals for ecommerce pages, websites, campaigns, and design concepts.

Kling Image4.0 Long Image is a professional design tool for generating product detail pages and website designs as a single long vertical image. It combines product images, key visuals, text layouts, and page structure in one composition, making it useful for ecommerce presentation, brand website visuals, social media carousel posts, storyboards, posters, packaging mockups, and early concepts before CGI production.

The ecommerce skill accepts1 to3 product photos and a page length selection. The webpage skill accepts up to1 style reference image and1 subject reference image. The model can render up to2,000 characters of text inside images, supports more than70 commercially licensed preset fonts, and works with English, Simplified Chinese, Traditional Chinese, Japanese, Korean, Spanish, and Portuguese. Long Image mode supports1K and2K output, but not8K; CGI may be better for final deliverables requiring precise accuracy, as details such as seams, screws, or reflections may be generated incorrectly.

Updated:

MODEL ID

kling-4.0/long-image-generation
Input
Text / Image
Output
Image

Highlights

  • Single long vertical image
  • Ecommerce and webpage skills
  • Up to2,000 characters
  • More than70 preset fonts
  • Multilingual text rendering
  • Supports1K and2K output

Providers

Best price
1 providers

Compare API prices across providers. Select a provider to view all charges and conditions.

Provider · Pricing details
Uptime

Benchmarks

  • Image Generation Leaderboard

    Ranked15th overall.

    #15
  • Text-to-Image Generation

    Ranked7th for text-to-image generation.

    #7
  • UI/UX Design

    Ranked4th for UI/UX design; Kling Image3.0 Omni was outside the top80.

    #4

Scores as published by the model provider.

Quick Start

Submit an image task, poll its status, then save the images. These examples use curl and Python 3 (standard library only).

POST https://openapi.felo.ai/api/v1/images/generations

1Get your API key

Create a key from your Felo API Platform account and set it as an environment variable.

export FELO_API_KEY="YOUR_API_KEY"

2Make your first request

Optional values vary by model. This example leaves them unset; confirm supported values in Playground before adding them. Request fields sit alongside model and prompt, without an input wrapper.

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "A studio product photo of a ceramic coffee cup on warm linen, soft morning light",
  "model": "kling-4.0/long-image-generation"
}'

3Poll the task

Submission returns task_id. Poll every 3 seconds while queued or running; stop on succeeded, failed or interrupted. This example stops waiting after 30 minutes. Keep created.json to resume querying the same task instead of submitting again.

python3 - <<'PY'
import json, os, time
from pathlib import Path
from urllib.parse import quote
from urllib.request import Request, urlopen

task = json.loads(Path("created.json").read_text())
task_id = task["task_id"]
url = "https://openapi.felo.ai/api/v1/images/generations/" + quote(task_id, safe="")
headers = {"Authorization": "Bearer " + os.environ["FELO_API_KEY"]}
deadline = time.monotonic() + 1800

while task["status"] in ("queued", "running"):
    if time.monotonic() >= deadline:
        raise TimeoutError(f"Keep task_id={task_id} to resume polling")
    time.sleep(3)
    with urlopen(Request(url, headers=headers), timeout=60) as response:
        task = json.load(response)
    if task.get("task_id") != task_id or task.get("kind") != "image":
        raise ValueError("Unexpected task response")
    print(task["status"])

if task["status"] != "succeeded":
    raise RuntimeError(task.get("error") or task["status"])
if not task.get("outputs"):
    raise ValueError("Task succeeded without image outputs")
Path("task.json").write_text(json.dumps(task))
print("Saved task.json")
PY

4Download the output

After success, save outputs from task.json. Results may be HTTPS URLs, URL objects or b64_json. Download signed URLs promptly; media downloads do not use your API key.

python3 - <<'PY'
import base64, json
from pathlib import Path
from urllib.request import urlopen

task = json.loads(Path("task.json").read_text())
if task.get("status") != "succeeded" or not task.get("outputs"):
    raise ValueError("No completed image outputs")
extensions = {"image/png": ".png", "image/jpeg": ".jpg", "image/webp": ".webp", "image/gif": ".gif", "image/avif": ".avif"}

for index, output in enumerate(task["outputs"], 1):
    item = output if isinstance(output, dict) else {}
    url = output if isinstance(output, str) else item.get("url") or item.get("unsigned_url")
    mime = item.get("media_type") or "image/png"
    if url and url.startswith("https://"):
        with urlopen(url, timeout=60) as response:
            data = response.read()
            mime = response.headers.get_content_type()
    elif url and url.startswith("data:image/") and ";base64," in url:
        header, encoded = url.split(",", 1)
        mime = header[5:].split(";", 1)[0]
        data = base64.b64decode(encoded, validate=True)
    elif item.get("b64_json"):
        data = base64.b64decode(item["b64_json"], validate=True)
    else:
        raise ValueError("Unrecognized image output")
    path = Path(f"image-{index}" + extensions.get(mime, ".bin"))
    path.write_bytes(data)
    print(path)
PY
input_references

For image editing, replace the example URL with your HTTPS image URL or a base64 image data URL. Submit once, then use the same polling and saving steps.

curl --fail-with-body --max-time 60 "https://openapi.felo.ai/api/v1/images/generations" \
  -H "Authorization: Bearer $FELO_API_KEY" \
  -H "Content-Type: application/json" \
  -o created.json \
  -d '{
  "prompt": "Keep the product and framing. Replace the background with a sunlit marble countertop.",
  "model": "kling-4.0/long-image-generation",
  "input_references": [
    {
      "type": "image_url",
      "image_url": {
        "url": "https://example.com/product.png"
      }
    }
  ]
}'

Supported parameters

  • skill
  • length
  • prompt
  • resolution
  • input_references

Prefer the full reference?

API reference →

Frequently asked questions

What is Kling Image 4.0 Long Image?

Kling Image4.0 Long Image is a professional design tool for generating product detail pages and website designs as a single long vertical image. It combines product images, key visuals, text layouts, and page structure in one composition, making it useful for ecommerce presentation, brand website visuals, social media carousel posts, storyboards, posters, packaging mockups, and early concepts before CGI production. The ecommerce skill accepts1 to3 product photos and a page length selection. The webpage skill accepts up to1 style reference image and1 subject reference image. The model can render up to2,000 characters of text inside images, supports more than70 commercially licensed preset fonts, and works with English, Simplified Chinese, Traditional Chinese, Japanese, Korean, Spanish, and Portuguese. Long Image mode supports1K and2K output, but not8K; CGI may be better for final deliverables requiring precise accuracy, as details such as seams, screws, or reflections may be generated incorrectly.

How is usage billed?

Your bill depends on the provider you use, its prices and your usage. Longer inputs or other conditions may have different prices.

What inputs does Kling Image4.0 Long Image support?

It supports text input, product photo input, style reference image input, and subject reference image input.

How many reference images can the skills use?

The ecommerce skill accepts1 to3 product photos. The webpage skill accepts up to1 style reference image and1 subject reference image.

How much text can it render inside images?

It can render up to2,000 characters of text inside images.

What output sizes does Long Image mode support?

Long Image mode supports1K and2K output. It does not support8K.

What tasks is it suitable for?

It is suitable for product detail pages, website visuals, social media carousel posts, storyboards, posters, packaging mockups, and concepts before CGI production.

How does it differ from Kling Image4.0?

Kling Image4.0 supports2K,4K, and8K regular image generation, while Long Image mode is focused on single long vertical images and supports1K and2K output.

Related models