Skip to main content
POST
Submit a Kling 4.0 text-to-video task in Kling's native shape.

Authorizations

Authorization
string
header
required

Bearer token authentication. Normally a Firebase or Cloud JWT. A 'comfyui-' prefixed API key is also accepted in this header: the prefix classifies the value as an API key and it is validated exactly as if it had been sent in X-API-Key.

Body

application/json

Kling's native Kling 4.0 text-to-video request.

Request body for a Kling 4.0 text-to-video generation. settings.duration and settings.resolution are required so the request never falls back to Kling's own defaults, which are the most expensive configuration.

prompt
string
required

Prompt that may include positive and negative descriptions. Up to 26,000 English characters or 11,000 non-English characters; comfy-api enforces 1 to 26,000 characters, and Kling itself refuses longer non-English text.

Required string length: 1 - 26000
settings
object
required

Output configuration such as resolution, aspect ratio and duration.

options
object | null

General configuration such as watermark options. options.callback_url and options.external_task_id are not supported on Kling 4.0; Comfy Router refuses a request that sets either inside options. A top-level callback_url or external_task_id is not part of this schema and is removed before the request reaches Kling. An explicit null options is treated as absent, as the /proxy Kling 4.0 check and Kling do.

Response

OK - the task-creation response, in Kling's own shape.

Response returned when a Kling 3.0 Turbo task is created.

code
integer

Error code. 0 indicates success.

message
string

Error message.

request_id
string

Request ID generated by the system.

data
object