{ "model_id": "klingai/kling-v4-flash", "provider_id": "klingai", "name": "Kling 4.0 Flash", "description": "Kling 4.0 Flash is Kling AI's fast text-to-video model, producing 3 to 20 seconds of 720p video from prompts of up to 26,000 characters.", "task": "Text-to-Video", "tags": [ "Video Generation", "Text-to-Video", "Fast", "720p" ], "context_length": null, "max_output_tokens": null, "schema_version": "1.0.0", "pricing": { "@720p (per second)": 0.094, "Default (per second)": 0.094 }, "examples": [ { "name": "Neon Alley Paper Boat", "description": "Text-to-video with the default 16:9 aspect ratio", "input": { "aspect_ratio": "16:9", "duration": 5, "prompt": "A paper boat drifts down a narrow, rain-soaked Tokyo alley at night. Neon signs in pink and teal reflect in the puddles and ripple as raindrops fall. The camera tracks low alongside the boat, close to the water. Cinematic, photorealistic, shallow depth of field." }, "output": { "video": "https://examples.aig.cloudflare.com/klingai/kling-v4-flash/neon-alley-paper-boat.mp4" }, "raw_response": { "state": "Completed", "result": { "video": "https://examples.aig.cloudflare.com/klingai/kling-v4-flash/neon-alley-paper-boat.mp4" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'klingai/kling-v4-flash',\n {\n aspect_ratio: '16:9',\n duration: 5,\n prompt:\n 'A paper boat drifts down a narrow, rain-soaked Tokyo alley at night. Neon signs in pink and teal reflect in the puddles and ripple as raindrops fall. The camera tracks low alongside the boat, close to the water. Cinematic, photorealistic, shallow depth of field.',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"klingai/kling-v4-flash\",\n \"input\": {\n \"aspect_ratio\": \"16:9\",\n \"duration\": 5,\n \"prompt\": \"A paper boat drifts down a narrow, rain-soaked Tokyo alley at night. Neon signs in pink and teal reflect in the puddles and ripple as raindrops fall. The camera tracks low alongside the boat, close to the water. Cinematic, photorealistic, shallow depth of field.\"\n }\n}'" } ] }, { "name": "Latte Art Close-Up", "description": "Vertical 9:16 video for mobile and social feeds", "input": { "aspect_ratio": "9:16", "duration": 5, "prompt": "A barista pours steamed milk into a latte in slow motion, forming a heart. Warm morning light streams through a caf\u00e9 window behind her. The camera starts on the cup and slowly tilts up to her smile. Cozy, realistic, soft focus background." }, "output": { "video": "https://examples.aig.cloudflare.com/klingai/kling-v4-flash/latte-art-close-up.mp4" }, "raw_response": { "state": "Completed", "result": { "video": "https://examples.aig.cloudflare.com/klingai/kling-v4-flash/latte-art-close-up.mp4" } }, "code_snippets": [ { "label": "typescript", "language": "typescript", "code": "const response = await env.AI.run(\n 'klingai/kling-v4-flash',\n {\n aspect_ratio: '9:16',\n duration: 5,\n prompt:\n 'A barista pours steamed milk into a latte in slow motion, forming a heart. Warm morning light streams through a caf\u00e9 window behind her. The camera starts on the cup and slowly tilts up to her smile. Cozy, realistic, soft focus background.',\n },\n)\nconsole.log(response)" }, { "label": "curl", "language": "bash", "code": "curl https://api.cloudflare.com/client/v4/accounts/$CLOUDFLARE_ACCOUNT_ID/ai/run \\\n --header \"Authorization: Bearer $CLOUDFLARE_API_TOKEN\" \\\n --header \"Content-Type: application/json\" \\\n --data '{\n \"model\": \"klingai/kling-v4-flash\",\n \"input\": {\n \"aspect_ratio\": \"9:16\",\n \"duration\": 5,\n \"prompt\": \"A barista pours steamed milk into a latte in slow motion, forming a heart. Warm morning light streams through a caf\u00e9 window behind her. The camera starts on the cup and slowly tilts up to her smile. Cozy, realistic, soft focus background.\"\n }\n}'" } ] } ], "default_example": null, "code_snippets": [], "supports_async": false, "zdr": false, "zdr_comment": null, "external_info": "https://klingai.com/", "terms": "https://klingai.com/terms", "cover_image_url": null, "metadata": { "Aspect Ratios": "21:9, 16:9, 9:16, 1:1", "Billing": "Pay-as-you-go, per output second", "Duration": "3-20 seconds", "Input Types": "Text", "Resolutions": "720p" }, "request_formats": null, "providers": null, "provider_details": [ { "id": "klingai", "pricing": { "720p": 0.094, "default": 0.094 } } ], "banner": null, "created_at": "2026-11-09 04:11:07", "schema": { "input": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "prompt": { "type": "string", "minLength": 1, "maxLength": 26000, "description": "Text prompt describing the video: scene, actions, camera movement, and style. Up to 26,000 English characters, or 11,000 non-English characters." }, "duration": { "default": 5, "description": "Video duration in seconds", "type": "integer", "minimum": 3, "maximum": 20 }, "aspect_ratio": { "default": "16:9", "description": "Video aspect ratio", "type": "string", "enum": [ "21:9", "16:9", "9:16", "1:1" ] }, "resolution": { "default": "720p", "description": "Output resolution", "type": "string", "enum": [ "720p" ] } }, "required": [ "prompt", "duration", "aspect_ratio", "resolution" ], "additionalProperties": false }, "output": { "$schema": "https://json-schema.org/draft/2020-12/schema", "type": "object", "properties": { "video": { "type": "string", "description": "URL to the generated video" } }, "required": [ "video" ], "additionalProperties": false } } }