Nexus
All models
Kling Image Available

Kling 4.0 Long Image

Generate one complete long image with Kling Image 4.0. Each task produces exactly one long image; the number of images cannot be set.

Text to Image

From 60 credits (≈ ₹60.00) per request.

Parameters

ParameterTypeDescription
promptRequired string Required. Text prompt, max 20000 characters. - `ecommerce`: reference product images as `@image_1`, `@image_2` … in the order of `image_urls`. - `webpage`: reference `style_image` as `@style` and `subject_image` as `@subject`. Any `@` immediately followed by a letter, digit, underscore or Chinese character is treated as a reference and there is no escaping, so emails and @handles fail validation — use a full-width `@` or put a space after `@`. Referencing material that was not provided returns 4
max length 20000
image_urls array<string> Product reference images, **required for `ecommerce`** (1–3 publicly accessible URLs), referenced as `@image_1` onward in order. Sending this with `webpage` returns 422. Do not use the field name `images`. Supported formats: jpg, jpeg, png; max 20MB per image. Recommended: width and height ≥ 300px, aspect ratio between 2:5 and 5:2. This is not checked when the task is created; images outside the range make the task fail during generation.
skillRequired string Required. Generation mode (case-insensitive). - `ecommerce`: product detail page; requires `image_urls`, supports `length`. - `webpage`: web page design; supports `style_image` and `subject_image`.
one of: "ecommerce", "webpage" · default "ecommerce"
style_image string Style reference image, **`webpage` only**, optional. Reference it in the prompt as `@style` to borrow its visual style and layout. Supported formats: jpg, jpeg, png; max 20MB per image. Sending this with `ecommerce` returns 422.
format: uri
subject_image string Subject reference image, **`webpage` only**, optional. Reference it in the prompt as `@subject`; the subject in the image is preserved in the output. Supported formats: jpg, jpeg, png; max 20MB per image. Sending this with `ecommerce` returns 422.
format: uri
length string Page length, **`ecommerce` only**. Defaults to `medium`. - `short`: about 2–5 sections - `medium`: about 6–10 sections - `long`: about 11–18 sections A section is a content block within the single long image, not a separate image. Sending this with `webpage` returns 422.
one of: "short", "medium", "long" · default "medium"
resolution string Output resolution, available for both skills. Defaults to `2k`. Pricing depends only on resolution, not on `skill` or `length`.
one of: "1k", "2k" · default "2k"

What you get back

Files arrive in output.files[] as private links that expire, with their type and size.

Use it from your code

# 1. Create the task
curl https://nexus.promptscenes.in/api/v1/tasks \
  -H "Authorization: Bearer $NEXUS_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "model": "kling-4.0-long-image",
    "input": {
        "prompt": "A cinematic shot of a lighthouse at dawn",
        "skill": "ecommerce",
        "length": "medium",
        "resolution": "2k"
    },
    "callback_url": "https://your-app.com/webhooks/nexus"
}'

# 2. Poll for the result
curl https://nexus.promptscenes.in/api/v1/tasks/TASK_ID \
  -H "Authorization: Bearer $NEXUS_API_KEY"
import os, time, uuid, requests

API = "https://nexus.promptscenes.in/api/v1"
HEADERS = {"Authorization": f"Bearer {os.environ['NEXUS_API_KEY']}"}

task = requests.post(
    f"{API}/tasks",
    headers={**HEADERS, "Idempotency-Key": str(uuid.uuid4())},
    json={
        "model": "kling-4.0-long-image",
        "input": {
            "prompt": "A cinematic shot of a lighthouse at dawn",
            "skill": "ecommerce",
            "length": "medium",
            "resolution": "2k",
        },
        "callback_url": "https://your-app.com/webhooks/nexus",
    },
).json()

while task["status"] not in ("succeeded", "failed", "cancelled"):
    time.sleep(3)
    task = requests.get(f"{API}/tasks/{task['id']}", headers=HEADERS).json()

print(task["status"], task.get("output"))
const API = "https://nexus.promptscenes.in/api/v1";
const headers = {
  Authorization: `Bearer ${process.env.NEXUS_API_KEY}`,
  "Content-Type": "application/json",
};

let task = await fetch(`${API}/tasks`, {
  method: "POST",
  headers: { ...headers, "Idempotency-Key": crypto.randomUUID() },
  body: JSON.stringify({
      "model": "kling-4.0-long-image",
      "input": {
          "prompt": "A cinematic shot of a lighthouse at dawn",
          "skill": "ecommerce",
          "length": "medium",
          "resolution": "2k"
      },
      "callback_url": "https://your-app.com/webhooks/nexus"
  }),
}).then((r) => r.json());

while (!["succeeded", "failed", "cancelled"].includes(task.status)) {
  await new Promise((r) => setTimeout(r, 3000));
  task = await fetch(`${API}/tasks/${task.id}`, { headers }).then((r) => r.json());
}
console.log(task.status, task.output);

Request

{
    "model": "kling-4.0-long-image",
    "input": {
        "prompt": "A cinematic shot of a lighthouse at dawn",
        "skill": "ecommerce",
        "length": "medium",
        "resolution": "2k"
    }
}

Response

{
    "id": "6f1c…",
    "object": "task",
    "model": "kling-4.0-long-image",
    "status": "succeeded",
    "output": {
        "files": [
            {
                "url": "https://…signed…",
                "mime": "…",
                "size": 0
            }
        ]
    },
    "estimated_cost": "…",
    "charged": "…"
}