Skip to main content
Kling Image Generation
Send a MixRoute API key as a Bearer token. Use the exact path below: the model catalog lists kling-image-4.0, but /kling/image-generation/kling-image-4.0 is not accepted. Do not add /v1, a body model field, or a metadata wrapper. POST https://api.mixroute.ai/kling/image-generation/kling-4.0

Request Body

Input Items

Reference images and Elements share a limit of 10 inputs. To reference one explicitly, use @id in the prompt. Images must be JPG, JPEG, or PNG, at most 30 MB each; both sides must be at least 300 px and their width-to-height ratio must be between 2:5 and 5:2. Prompt limit: up to 50,000 English characters or 21,000 non-English characters. For mixed text, the English count divided by 50,000 plus the non-English count divided by 21,000 must not exceed 1.

Settings

Options

Generate One Image

An accepted request returns code: 0 and a gateway task ID in data.id; it does not return the image yet.

Retrieve the Image

Copy data.id to KLING_TASK_ID. Poll with one ID per call; see Query Kling Task for statuses and errors.
When the matching task reports succeeded, read the url of each type: "image" entry in outputs. Download from the result URL without forwarding your MixRoute API key.