{"openapi":"3.1.0","info":{"title":"Kling 4.0 API — CheaperGen","version":"1.0.0","description":"Kuaishou Kling 4.0 generates 3–30 second videos at 720p or 1080p with stereo sound, from text, a first and last frame, or reference images and videos."},"servers":[{"url":"https://cheapergen.com/api/v1"}],"security":[{"bearer":[]}],"components":{"securitySchemes":{"bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Generation":{"type":"object","properties":{"id":{"type":"string"},"object":{"const":"generation"},"model":{"type":"string"},"endpoint":{"type":"string"},"status":{"enum":["queued","running","succeeded","failed","canceled"]},"output":{"type":["object","null"]},"error":{"type":["object","null"]},"cost":{"type":"object","properties":{"amount_usd":{"type":"number"},"official_usd":{"type":["number","null"],"description":"The list price for the same request: see list_price_source."},"list_price_source":{"enum":["official","reference"],"description":"official: the developer's own list price; reference: another price we compare with, named by list_price_label (e.g. fal API)."},"list_price_label":{"type":"string"},"saved_usd":{"type":["number","null"]},"estimated":{"type":"boolean"}}},"created_at":{"type":"string","format":"date-time"},"completed_at":{"type":["string","null"],"format":"date-time"}}}}},"paths":{"/run/kuaishou/kling-4.0/text-to-video":{"post":{"summary":"Kling 4.0 — Text to Video","operationId":"kuaishou_kling_4_0_text_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":8000},"aspect_ratio":{"title":"Aspect ratio","description":"Output frame shape.","type":"string","enum":["16:9","9:16","1:1","21:9"],"default":"16:9"},"resolution":{"title":"Resolution","description":"Output resolution. Higher resolutions cost more per second.","type":"string","enum":["720p","1080p"],"default":"720p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (3–30s). You pay per second.","type":"integer","minimum":3,"maximum":30,"default":5},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/run/kuaishou/kling-4.0/image-to-video":{"post":{"summary":"Kling 4.0 — Image to Video","operationId":"kuaishou_kling_4_0_image_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt","image_url"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":8000},"image_url":{"title":"First frame","description":"Image used as the opening frame. JPG/PNG/WebP, URL or upload.","type":"string","format":"uri"},"end_image_url":{"title":"Last frame","description":"Optional closing frame — the model animates between the two.","type":"string","format":"uri"},"resolution":{"title":"Resolution","description":"Output resolution. Higher resolutions cost more per second.","type":"string","enum":["720p","1080p"],"default":"720p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (3–30s). You pay per second.","type":"integer","minimum":3,"maximum":30,"default":5},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/run/kuaishou/kling-4.0/reference-to-video":{"post":{"summary":"Kling 4.0 — Reference to Video","operationId":"kuaishou_kling_4_0_reference_to_video","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["prompt"],"properties":{"prompt":{"title":"Prompt","description":"Describe the shot: subject, action, camera movement, lighting and style.","type":"string","maxLength":8000},"reference_image_urls":{"title":"Reference images","description":"Up to 10 images for characters, products, style or scene. Refer to them in the prompt as @Image1, @Image2…","type":"array","items":{"type":"string","format":"uri"},"maxItems":10},"reference_video_urls":{"title":"Reference videos","description":"Up to 5 MP4/MOV clips for motion, camera moves or effects (3–30 s each, 30 s in total, ≤ 200 MB each). Refer to them as @Video1, @Video2… With a reference video, the output seconds plus the longer of the output and the reference videos are billed at a lower per-second rate.","type":"array","items":{"type":"string","format":"uri"},"maxItems":5,"x-media-limits":{"formats":["mp4","mov"],"min_seconds":3,"max_seconds":30,"max_total_seconds":30,"max_bytes":209715200}},"aspect_ratio":{"title":"Aspect ratio","description":"Output frame shape.","type":"string","enum":["16:9","9:16","1:1","21:9"],"default":"16:9"},"resolution":{"title":"Resolution","description":"Output resolution. Higher resolutions cost more per second.","type":"string","enum":["720p","1080p"],"default":"720p"},"duration":{"title":"Duration","description":"Length of the generated clip in seconds (3–30s). You pay per second.","type":"integer","minimum":3,"maximum":30,"default":5},"webhook_url":{"type":"string","format":"uri","title":"Webhook URL","description":"Optional. We POST the finished generation here (signed)."}},"additionalProperties":false}}}},"responses":{"202":{"description":"Queued","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}},"400":{"description":"Invalid request"},"402":{"description":"Insufficient balance"}}}},"/generations/{id}":{"get":{"summary":"Get a generation","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Generation"}}}}}}}}}