{"openapi":"3.0.2","info":{"title":"kling/kling-v3","description":"The request body Comfy Router accepts for the model \"kling/kling-v3\", and the response body it returns. The INPUT schema is the same schema the server validates a call against before it reaches the provider, so what is published and what is enforced cannot differ. `x-comfy-router-input-modalities` records the media kinds the model is documented to accept; the request schema is shared across sibling models and may admit media kinds this model ignores. The OUTPUT schema describes the provider's native result document exactly as Router returns it: Router does not validate, narrow or re-envelope the response, so the output schema is descriptive rather than enforced, and Comfy owns no output shape of its own.","version":"d6120bca8ada"},"paths":{"/v2/models/kling/kling-v3":{"post":{"operationId":"runRouterModel","summary":"Run kling/kling-v3 synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KlingText2VideoInputs"},{"properties":{"image":{"description":"Reference Image - URL or Base64 encoded string, cannot exceed 10MB, resolution not less than 300*300px, aspect ratio between 1:2.5 ~ 2.5:1. Base64 should not include data:image prefix.","type":"string"},"image_tail":{"description":"Reference Image - End frame control. URL or Base64 encoded string, cannot exceed 10MB, resolution not less than 300*300px. Base64 should not include data:image prefix. Cannot be used simultaneously with dynamic_masks/static_mask or camera_control.","type":"string"},"mode":{"$ref":"#/components/schemas/KlingVideoGenMode4K"}},"type":"object"}],"description":"Request body for a Kling video generation on Comfy Router. OMIT `image` and `image_tail` for text-to-video; INCLUDE `image` (optionally with `image_tail` as the end frame) for image-to-video. The example below is the text-to-video call; adding `image` to it is the whole of the structural difference. `model_name` is filled from the request path. `mode` additionally accepts \"4k\" on this model.","example":{"aspect_ratio":"16:9","duration":"5","mode":"std","prompt":"A red fox trotting through falling snow, cinematic lighting."}}}}},"responses":{"200":{"description":"OK - the model's native JSON output, returned unchanged; the schema describes the provider's terminal result document as Router returns it.","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/KlingQueryTaskResponse"}],"description":"Comfy Router output schema for the Kling v1 VIDEO models: the terminal `GET /v1/videos/{operation}/{id}` task-query document, forwarded unchanged. Every Kling v1 operation is SUBMIT-AND-POLL, each polled on `\u003csubmit path\u003e/:id` — the operations this component covers, `/v1/videos/text2video`, `/v1/videos/omni-video` and `/v1/videos/avatar/image2video`, and the lip-sync sibling documented separately alike — and Router polls on the caller's behalf, so the body a caller receives is the finished task rather than the `{code, message, request_id, data.task_id}` handle the underlying `/proxy/kling/*` submit answers with.\nThe generated video's download URL is at `data.task_result.videos[].url`. Read the ELEMENT field, not the `videos` container: `KlingVideoResult` is `{id, url, watermark_url, duration}`, so a one-element list carrying an id and a duration and no URL is a non-empty array holding nothing playable. `data.task_result.videos[].watermark_url` is the same asset under Kling's hotlink-protection form and counts as a result; `routerpollstate.classifyKling` draws exactly that line, and a `succeed` carrying neither is `success_without_output` rather than a finished generation.\n`data.task_status` is Kling's own four-value vocabulary — `submitted`, `processing`, `succeed`, `failed` — and the terminal success spells it `succeed`, NOT `succeeded`. The `kling/kling-3.0-turbo` sibling (`KlingV2RouterOutput`) says `succeeded` and carries an entirely different document; the two vocabularies are deliberately not folded together.\nThe operations share this component because they share this document, and the ids are grouped by operation in the list above: text2video is the family's primary and admits every create-task id, so `kling/kling-v3-omni` and `kling/kling-video-o1` are the pair that resolves onto omni-video. The last id is a route-slug model — `kling/videos-avatar-image2video`, the only id on its own operation. Its document is typed separately in the v1 contract (`KlingAvatarResponse`) but declares the same property set as `KlingQueryTaskResponse`, envelope and `data.task_result.videos[]` leaf alike, which is why it is documented here rather than as a near-identical component of its own. Its route-slug sibling is NOT: `kling/videos-lip-sync` answers a strictly NARROWER envelope and is authored by `KlingLipSyncRouterOutput`. `kling/videos-avatar-image2video` publishes its own example, on its own model page; the five generation-id pages carry the shared text2video one.","example":{"code":0,"data":{"created_at":1798761600000,"task_id":"kling-task-1a2b3c4d5e6f","task_result":{"videos":[{"duration":"5","id":"kling-video-6f5e4d3c2b1a","url":"https://example.invalid/kling/kling-v2-5-turbo/generated.mp4"}]},"task_status":"succeed","task_status_msg":"","updated_at":1798761840000},"message":"SUCCEED","request_id":"9f2c1a04-7b6e-4d38-8a51-3c0e7d9b2f46"}}}}}}}}},"components":{"schemas":{"KlingCameraConfig":{"properties":{"horizontal":{"description":"Controls camera's movement along horizontal axis (x-axis). Negative indicates left, positive indicates right.","maximum":10,"minimum":-10,"type":"number"},"pan":{"description":"Controls camera's rotation in vertical plane (x-axis). Negative indicates downward rotation, positive indicates upward rotation.","maximum":10,"minimum":-10,"type":"number"},"roll":{"description":"Controls camera's rolling amount (z-axis). Negative indicates counterclockwise, positive indicates clockwise.","maximum":10,"minimum":-10,"type":"number"},"tilt":{"description":"Controls camera's rotation in horizontal plane (y-axis). Negative indicates left rotation, positive indicates right rotation.","maximum":10,"minimum":-10,"type":"number"},"vertical":{"description":"Controls camera's movement along vertical axis (y-axis). Negative indicates downward, positive indicates upward.","maximum":10,"minimum":-10,"type":"number"},"zoom":{"description":"Controls change in camera's focal length. Negative indicates narrower field of view, positive indicates wider field of view.","maximum":10,"minimum":-10,"type":"number"}},"type":"object"},"KlingCameraControl":{"properties":{"config":{"$ref":"#/components/schemas/KlingCameraConfig"},"type":{"$ref":"#/components/schemas/KlingCameraControlType"}},"type":"object"},"KlingCameraControlType":{"description":"Predefined camera movements type. simple: Customizable camera movement. down_back: Camera descends and moves backward. forward_up: Camera moves forward and tilts up. right_turn_forward: Rotate right and move forward. left_turn_forward: Rotate left and move forward.","enum":["simple","down_back","forward_up","right_turn_forward","left_turn_forward"],"type":"string"},"KlingQueryTaskResponse":{"properties":{"code":{"description":"Error code","type":"integer"},"data":{"properties":{"created_at":{"description":"Task creation time, Unix timestamp in milliseconds","type":"integer"},"final_unit_deduction":{"description":"The deduction units of task","type":"string"},"task_id":{"description":"Task ID","type":"string"},"task_info":{"properties":{"external_task_id":{"type":"string"}},"type":"object"},"task_result":{"properties":{"videos":{"items":{"$ref":"#/components/schemas/KlingVideoResult"},"type":"array"}},"type":"object"},"task_status":{"$ref":"#/components/schemas/KlingTaskStatus"},"task_status_msg":{"description":"Task status information, displaying the failure reason when the task fails","type":"string"},"updated_at":{"description":"Task update time, Unix timestamp in milliseconds","type":"integer"},"watermark_info":{"properties":{"enabled":{"type":"boolean"}},"type":"object"}},"type":"object"},"message":{"description":"Error message","type":"string"},"request_id":{"description":"Request ID","type":"string"}},"type":"object"},"KlingTaskStatus":{"description":"Task Status","enum":["submitted","processing","succeed","failed"],"type":"string"},"KlingText2VideoInputs":{"description":"Request body for a Kling text-to-video generation. The `example` below is the COMFY ROUTER form and deliberately omits `model_name`, which Router fills from the `{model}` path segment; a direct v1 call to POST /proxy/kling/v1/videos/text2video may add it (the proxy forwards an absent one as-is and Kling applies its own default). One example cannot serve both surfaces -- KlingVideoRouterRequest, the Router input schema for all three spellings, composes this component, so an example naming one of them is refused by the other two routes for naming a different model, while the omitting form is valid on all three.","example":{"aspect_ratio":"16:9","duration":"5","prompt":"A red fox trotting through falling snow, cinematic lighting."},"properties":{"aspect_ratio":{"$ref":"#/components/schemas/KlingVideoGenAspectRatio"},"callback_url":{"description":"The callback notification address. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","format":"uri","type":"string"},"camera_control":{"$ref":"#/components/schemas/KlingCameraControl"},"cfg_scale":{"$ref":"#/components/schemas/KlingVideoGenCfgScale"},"duration":{"$ref":"#/components/schemas/KlingVideoGenDuration"},"external_task_id":{"description":"Customized Task ID. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","type":"string"},"model_name":{"description":"Model name. Omit it or send null when using Comfy Router; the model is selected by the request path. A supplied name must match that path.","nullable":true,"type":"string"},"multi_prompt":{"description":"Information about each storyboard, such as prompts and duration. Supports up to 6 storyboards, with a minimum of 1. Required when multi_shot is true and shot_type is customize.","items":{"properties":{"duration":{"description":"Duration of this storyboard in seconds. Must not exceed total task duration and must not be less than 1. Sum of all storyboard durations equals total task duration.","type":"string"},"index":{"description":"Shot sequence number","type":"integer"},"prompt":{"description":"Prompt word for this storyboard. Maximum length 512 characters.","maxLength":512,"type":"string"}},"type":"object"},"maxItems":6,"minItems":1,"type":"array"},"multi_shot":{"default":false,"description":"Whether to generate multi-shot video. When true, the prompt parameter is invalid. When false, the shot_type and multi_prompt parameters are invalid.","type":"boolean"},"negative_prompt":{"description":"Negative text prompt. It is recommended to supplement negative prompt information through negative sentences directly within positive prompts.","maxLength":2500,"type":"string"},"prompt":{"description":"Positive text prompt. Use \u003c\u003c\u003cvoice_1\u003e\u003e\u003e to specify a voice matching the voice_list parameter order. A task can reference up to 2 tones. When specifying a tone, the sound parameter value must be on.","maxLength":2500,"type":"string"},"shot_type":{"description":"Storyboard method. Required when the multi_shot parameter is set to true.","enum":["customize","intelligence"],"type":"string"},"sound":{"default":"off","description":"Whether to generate sound simultaneously when generating videos. Only V2.6 and subsequent versions of the model support this parameter.","enum":["on","off"],"type":"string"},"voice_list":{"description":"List of voices referenced when generating videos. Supports up to 2 voices; reference them in `prompt` as \u003c\u003c\u003cvoice_1\u003e\u003e\u003e and \u003c\u003c\u003cvoice_2\u003e\u003e\u003e in list order. Requires `sound` set to \"on\", which only V2.6 and subsequent versions of the model support; on an earlier model, or with `sound` left at its \"off\" default, voices are not applied.","items":{"properties":{"voice_id":{"description":"Voice ID returned through the voice customization API or a system preset voice ID.","minLength":1,"type":"string"}},"required":["voice_id"],"type":"object"},"maxItems":2,"minItems":1,"type":"array"},"watermark_info":{"description":"Whether to generate watermarked results simultaneously. Custom watermark is not supported at this time.","properties":{"enabled":{"description":"true means generate watermark, false means do not generate.","type":"boolean"}},"type":"object"}},"type":"object"},"KlingVideoGenAspectRatio":{"default":"16:9","description":"Video aspect ratio","enum":["16:9","9:16","1:1"],"type":"string"},"KlingVideoGenCfgScale":{"default":0.5,"description":"Flexibility in video generation. The higher the value, the lower the model's degree of flexibility, and the stronger the relevance to the user's prompt.","format":"float","maximum":1,"minimum":0,"type":"number"},"KlingVideoGenDuration":{"default":"5","description":"Video length in seconds","enum":["3","4","5","6","7","8","9","10","11","12","13","14","15"],"type":"string"},"KlingVideoGenMode4K":{"default":"std","description":"Video generation mode. std: Standard Mode, which is cost-effective. pro: Professional Mode, generates videos with longer duration but higher quality output. 4k: Ultra-HD mode, generating a 4K-resolution video. Only kling-v3 supports 4k on this family; every other Kling text-to-video model answers pro/std only.","enum":["std","pro","4k"],"type":"string"},"KlingVideoResult":{"properties":{"duration":{"description":"Total video duration in seconds","type":"string"},"id":{"description":"Generated video ID","type":"string"},"url":{"description":"URL for generated video","format":"uri","type":"string"},"watermark_url":{"description":"URL for generated video with watermark, hotlink protection format","format":"uri","type":"string"}},"type":"object"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"kling/kling-v3","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["image","text"],"x-comfy-router-output-modalities":["video"],"x-comfy-router-alt-providers":[{"provider":"higgsfield","model_id":"higgsfield/higgsfield-kling-3-std"},{"provider":"tencent","limits":{"resolutions":["720P"],"audio":["silent"],"duration_seconds":{"min":3,"max":15,"default":5},"aspect_ratios":["16:9","9:16","1:1"],"rejected_inputs":[{"field":"image","rule":"set","reason":"Tencent MPS's kling 3.0 endpoint is text-to-video only; for image-conditioned video use kling/kling-v3-omni with image_list"},{"field":"image_tail","rule":"set","reason":"Tencent MPS's kling 3.0 endpoint is text-to-video only; for image-conditioned video use kling/kling-v3-omni with image_list"},{"field":"sound","rule":"equals","values":["on"],"example":"on","reason":"Tencent MPS's kling 3.0 endpoint does not support audio yet; send sound \"off\" or omit it"},{"field":"mode","rule":"not_in","values":["std"],"example":"pro","reason":"Tencent MPS's kling 3.0 endpoint serves the std tier only"},{"field":"multi_shot","rule":"set","example":true,"reason":"Tencent MPS's kling 3.0 endpoint generates a single shot; a multi-shot sequence cannot be honoured"},{"field":"multi_prompt","rule":"set","reason":"Tencent MPS's kling 3.0 endpoint generates a single shot; a multi-shot sequence cannot be honoured"},{"field":"shot_type","rule":"set","example":"customize","reason":"Tencent MPS's kling 3.0 endpoint generates a single shot; a multi-shot sequence cannot be honoured"}],"rejected_with":"invalid_input","fallback":{"provider":"kling","default":true,"opt_out":"fallback_provider=false"}}}]}
