{"openapi":"3.0.2","info":{"title":"kling/kling-3.0-turbo","description":"The request body Comfy Router accepts for the model \"kling/kling-3.0-turbo\", 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":"0fba57625d8f"},"paths":{"/v2/models/kling/kling-3.0-turbo":{"post":{"operationId":"runRouterModel","summary":"Run kling/kling-3.0-turbo synchronously.","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"description":"Request body for a Kling 3.0 Turbo text-to-video generation. `prompt` is the one field Kling requires. The model is named by the route on both surfaces -- the v1 path ends in the model spelling and the Comfy Router path is /v2/models/kling/kling-3.0-turbo -- so the body carries no model field at all and the same `required` list serves both.","example":{"prompt":"A neon-lit alley in the rain, slow dolly forward.","settings":{"aspect_ratio":"16:9","duration":5,"resolution":"1080p"}},"properties":{"aspect_ratio":{"$ref":"#/components/schemas/KlingVideoGenAspectRatio"},"duration":{"$ref":"#/components/schemas/KlingVideoGenDuration"},"options":{"$ref":"#/components/schemas/KlingV2Options"},"prompt":{"description":"Prompt that may include both positive and negative descriptions. Recommended length under 2500 characters. Multi-shot videos use the format \"shot n, m, words; shot n, m, words;\".","maxLength":3072,"type":"string"},"settings":{"description":"Output configuration such as resolution, aspect ratio and duration.","properties":{"aspect_ratio":{"description":"Aspect ratio (width:height) of the generated frames. One of \"16:9\", \"9:16\" or \"1:1\". Default \"16:9\".","enum":["16:9","9:16","1:1"],"type":"string"},"duration":{"description":"Video length in seconds. Supported values 3 through 15. Default 5.","maximum":15,"minimum":3,"type":"integer"},"resolution":{"description":"Clarity of the generated video. One of \"720p\" or \"1080p\". Default \"720p\".","enum":["720p","1080p"],"type":"string"}},"type":"object"}},"required":["prompt"],"type":"object"}}}},"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/KlingV2QueryTaskResponse"}],"description":"Comfy Router output schema for Kling's v2 task surface: the terminal `GET /tasks?task_ids={id}` document, forwarded unchanged. Every Router id on that surface is submit-and-poll (`routerresult/classification.go` records each as `ReturnModeSubmitPoll`) — and Router polls on the caller's behalf, so the body a caller receives is the finished task rather than the `data.id` handle the underlying submit answers with.\nThis is NOT the document the eleven Kling v1 video ids answer (`KlingVideoRouterOutput`), and the three differences are the reason it is its own component. `data` is a LIST — one element per task id the query named — rather than a single object, so the generated video's download URL is at `data[].outputs[].url`, under the element for the polled task. Router always polls ONE task (the poll route is built from the single id the submit returned, so the request is always `?task_ids=\u003cone id\u003e`), so that list carries one element in practice; a caller polling this route directly with several ids gets one element each and must match on `data[].id`. Second, the terminal status spells `succeeded`, where every v1 Kling route says `succeed`. Third, the outputs live under `outputs[]` rather than `task_result`.\nRead the ELEMENT field, not the `outputs` container: `KlingV2Output` is `{type, id, url, watermark_url, duration, ...}`, so a one-element list carrying an id and a type and no URL is a non-empty array holding nothing playable. `data[].outputs[].watermark_url` is the same asset under Kling's hotlink-protection form and counts as a result. `mp3_url` and `wav_url` deliberately do NOT: the operation Router serves here is text-to-video, so a success carrying only audio is a shape anomaly. `routerpollstate.classifyKlingV2` draws exactly those lines.\n`url` is hotlink-protected and Kling clears it after 30 days, so download it rather than storing the link.","example":{"code":0,"data":[{"create_time":1798761600000,"id":"kling-v2-task-7c8d9e0f1a2b","message":"","outputs":[{"duration":"5","id":"kling-v2-output-2b1a0f9e8d7c","type":"video","url":"https://example.invalid/kling/v2/generated.mp4"}],"status":"succeeded","update_time":1798761820000}],"message":"SUCCEED","request_id":"3d7e5c91-0b42-4f68-9a13-8e2c6d4b0a75"}}}}}}}}},"components":{"schemas":{"KlingV2Options":{"description":"General configuration such as callback address and watermark options.","properties":{"callback_url":{"description":"Callback notification URL for task results. The server notifies when the task status changes. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","type":"string"},"external_task_id":{"description":"Customized Task ID. Does not overwrite the system-generated task ID but can be used for queries. Must be unique within a single user account. Ignored: comfy-api drops this field before forwarding; Comfy Router polls on your behalf.","type":"string"},"watermark_info":{"description":"Whether to generate watermarked results simultaneously. Custom watermarks are not supported.","properties":{"enabled":{"description":"true means generate watermarked result, false means do not generate. Default false.","type":"boolean"}},"type":"object"}},"type":"object"},"KlingV2Output":{"description":"A generated output. The fields present depend on `type` (video, image, audio, voice or element).","properties":{"duration":{"description":"Duration of the generated video in seconds.","type":"string"},"group_id":{"description":"Grouping marker, present only for grouped images.","type":"string"},"id":{"description":"Output ID generated by the system.","type":"string"},"mp3_duration":{"description":"Duration of the generated MP3 audio in seconds.","type":"string"},"mp3_url":{"description":"MP3 URL of the generated audio (hotlink-protected).","type":"string"},"name":{"description":"Name of the generated material.","type":"string"},"owned_by":{"description":"Source of the material. \"kling\" denotes the official library; numbers are creator IDs.","type":"string"},"status":{"description":"Status of the material. One of \"succeeded\" or \"deleted\".","type":"string"},"type":{"description":"Output content type. One of \"video\", \"image\", \"audio\", \"voice\" or \"element\".","type":"string"},"url":{"description":"URL of the generated result (hotlink-protected). Cleared after 30 days.","type":"string"},"watermark_url":{"description":"URL of the watermarked result (hotlink-protected).","type":"string"},"wav_duration":{"description":"Duration of the generated WAV audio in seconds.","type":"string"},"wav_url":{"description":"WAV URL of the generated audio (hotlink-protected).","type":"string"}},"type":"object"},"KlingV2QueryTaskResponse":{"description":"Response returned when querying Kling v2 tasks by ID.","properties":{"code":{"description":"Error code. 0 indicates success.","type":"integer"},"data":{"description":"Tasks matching the query.","items":{"$ref":"#/components/schemas/KlingV2Task"},"type":"array"},"message":{"description":"Error message.","type":"string"},"request_id":{"description":"Request ID generated by the system.","type":"string"}},"type":"object"},"KlingV2Task":{"description":"A single Kling v2 task record.","properties":{"billing":{"description":"Billing details for the task.","items":{"properties":{"amount":{"description":"Consumption amount, accurate to two decimal places.","type":"string"},"cash_type":{"description":"Cash account the charge was drawn from (only present when charge_type is \"cash\"), for example \"balance\". Some tasks return it; others may omit it.","type":"string"},"charge_type":{"description":"Consumption account type. \"cash\" for balance, \"unit\" for a resource package.","type":"string"},"currency":{"description":"ISO 4217 currency code of `amount` and `list_price`, for example \"USD\". Some tasks return it; others may omit it.","type":"string"},"list_price":{"description":"List price of the task before any discount, as a decimal string. Some tasks return it; others may omit it.","type":"string"},"package_type":{"description":"Consumable resource bundle type (only present when charge_type is \"unit\"). One of \"video\", \"image\" or \"audio\".","type":"string"}},"type":"object"},"type":"array"},"create_time":{"description":"Task creation time. Unix timestamp in milliseconds.","format":"int64","type":"integer"},"external_id":{"description":"The custom task ID for this task, if any.","type":"string"},"id":{"description":"The task ID.","type":"string"},"message":{"description":"Task status information, displaying the failure reason when the task fails.","type":"string"},"outputs":{"description":"Generated outputs for the task.","items":{"$ref":"#/components/schemas/KlingV2Output"},"type":"array"},"status":{"description":"Task status. One of \"submitted\", \"processing\", \"succeeded\" or \"failed\".","type":"string"},"update_time":{"description":"Task update time. Unix timestamp in milliseconds.","format":"int64","type":"integer"}},"type":"object"},"KlingVideoGenAspectRatio":{"default":"16:9","description":"Video aspect ratio","enum":["16:9","9:16","1:1"],"type":"string"},"KlingVideoGenDuration":{"default":"5","description":"Video length in seconds","enum":["3","4","5","6","7","8","9","10","11","12","13","14","15"],"type":"string"}},"securitySchemes":{"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"},"BearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"x-comfy-router-model-id":"kling/kling-3.0-turbo","x-comfy-input-schema-authored":true,"x-comfy-output-schema-authored":true,"x-comfy-router-input-modalities":["text"],"x-comfy-router-output-modalities":["video"],"x-comfy-router-alt-providers":[{"provider":"higgsfield","model_id":"higgsfield/higgsfield-kling-3-turbo"}]}
