Claude Opus 5.5 is live on SeedRouter

Image

Kling Image 4.0

View Markdown

Create 2K or 4K images with Kling Image 4.0. Use named reference photos, single-image variations or a connected series, then poll for the finished image URLs.

Submit a JSON request to POST /v1/images/generations with the model ID kling-image-4-0. Save the returned task ID. The same endpoint accepts text-only briefs and reference-guided briefs.

Quick example

This request makes one square 2K still. Store your API key in the SEEDROUTER_API_KEY environment variable.

curl https://api.seedrouter.ai/v1/images/generations \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
    "model": "kling-image-4-0",
    "contents": [
      {"type": "prompt", "text": "Photograph an amber glass teapot on blue slate, lit through its handle by the morning sun."}
    ],
    "settings": {"resolution": "2k", "aspect_ratio": "1:1"}
  }'

Endpoint and headers

Send JSON to POST https://api.seedrouter.ai/v1/images/generations with Content-Type: application/json and Authorization: Bearer YOUR_API_KEY. Keep the key on your server.

Parameters

FieldTypeValues and defaults
modelstring, requiredkling-image-4-0
contentsarray, requiredOne prompt and zero to ten reference images.
contents[].typestring, requiredprompt or refer_image.
contents[].textstringRequired for the prompt. English-only limit 50,000 characters, non-English limit 21,000. In mixed text, the two fractions of their respective limits must sum to at most one.
contents[].urlstringRequired for each reference. Use an accessible HTTP(S) URL for a JPEG or PNG up to 30 MB. Both sides must be at least 300 pixels and the width-to-height ratio must be between 2:5 and 5:2.
contents[].idstringOptional unique name for a reference. Mention the name as @name in the prompt.
settings.result_typestringsingle (default) for independent images, or series for related images.
settings.ninteger1–9 independent images. Defaults to 1. Only used in single mode.
settings.series_amountinteger or stringIn series mode, 2–10 images, default 4. For 5–10 images, mention every reference and keep the prompt within 20,000 characters after reference names are converted to positions. Each reference must be readable and at most 20 MB. In single mode this field is ignored and may be an integer from 2 to 10 or the string auto.
settings.resolutionstring2k (default) or 4k.
settings.aspect_ratiostringauto (default), 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3 or 21:9.
options.watermark_info.enabledbooleanOptional. Only false is supported.

A series from a reference photograph

Replace the example URL with a public URL of your product photograph. This example requests three connected images. Keep each frame's instruction in the same prompt.

{
  "model": "kling-image-4-0",
  "contents": [
    {"type": "refer_image", "url": "https://example.com/lamp.jpg", "id": "lamp"},
    {"type": "prompt", "text": "Three shots of @lamp in the same studio. Start with a wide view of the workbench, move to the brass shade, then finish on the warm reflection of the bulb in the desk."}
  ],
  "settings": {"result_type": "series", "series_amount": 3, "resolution": "4k", "aspect_ratio": "3:2"}
}

Retrieve every image

Copy the id from the POST response into TASK_ID. Poll this endpoint with the same key until the task status is completed or failed.

curl "https://api.seedrouter.ai/v1/tasks/$TASK_ID" \
  -H "Authorization: Bearer $SEEDROUTER_API_KEY"

On completion, read every URL in output.data[].url. A task can return multiple images. If a status check is interrupted, look up the original ID again. See the task reference for the lifecycle and the error directory for error codes.

Pricing

The total is the number of output images at the requested resolution multiplied by the live output rate, plus one reference-image charge per input image. Four 4K images with two references cost four 4K output charges and two reference charges. A failed request carries no charge. See the current rates.

Errors and tips

Invalid input returns a request error. Check for missing prompt text, duplicate reference IDs and unsupported resolution or series settings. If the initial call returned a task ID, query that ID before deciding whether another submission is necessary.

For a multi-reference brief, use a distinct name for each subject and tell the model which visual features each reference supplies. Place camera directions and the sequence of shots in the prompt. See the Kling Image 4.0 playground and OpenAPI schema.