Kling 4.0
Kling 4.0 is Kuaishou’s newest flagship video model: 3–30 second videos up to 4K HDR, guided by reference images, videos, subjects and voices, or by first, middle and last keyframes.
Kling 4.0 Keyframe to Video
Drag and drop an image, or click to browse
Supports PNG, JPEG, WebP. Max 10MB. You can also paste from clipboard (Ctrl+V).
Up to 8 middle frames in order (@keyframe_1, @keyframe_2...). Total frames are limited by duration.
Drag and drop an image, or click to browse
Supports PNG, JPEG, WebP. Max 10MB. You can also paste from clipboard (Ctrl+V).
Drag and drop an image, or click to browse
Supports PNG, JPEG, WebP. Max 10MB. You can also paste from clipboard (Ctrl+V).
3–30
Result
Results will appear here
Cost: $0.157/second
Pre-deducted at submit: $0.785 (5s)
Kling 4.0 API Implementation Guide
Get API Key
Generate your API key from the dashboard and set it as an environment variable.
export MODELHUNTER_KEY="your_api_key"Make Your First Call
Follow the API documentation for complete code examples in cURL, JavaScript, and Python, including request format, polling, and error handling.
View API Documentation →Kling 4.0 Key Info
Capabilities
- Reference to Video
- Keyframe to Video
Pricing
Price per second by resolution
| Option | 720p | 1080p | 4k |
|---|---|---|---|
| no video reference | $0.157/second | $0.235/second | $0.549/second |
| with video reference, input + output seconds | $0.094/second | $0.141/second | $0.329/second |
Billed per second at the official Kling price. With reference videos, input seconds are billed too; the final charge is settled from actual usage.
Use Cases
Output Formats
Kling 4.0 API Documentation
Run the playground first, then open the full API docs for integration details.
About
Guide the video with a first frame, up to 8 middle keyframes and a last frame.
Code Examples
1curl -X POST https://api.modelhunter.ai/api/v1/kling/keyframe-to-video \2-H "Authorization: Bearer YOUR_API_KEY" \3-H "Content-Type: application/json" \4-d '{5"model": "kling-4.0/keyframe-to-video",6"input": {7"prompt": "A futuristic cityscape at sunset with neon signs",8"first_frame_url": "https://example.com/image.jpg",9"resolution": "720p"10}11}'
Schema
View Full API DocsInput
modelModel ID for this capability.
Value: kling-4.0/keyframe-to-video
promptPrompt
first_frame_urlFirst Frame
keyframe_urlsUp to 8 middle frames in order (@keyframe_1, @keyframe_2...). Total frames are limited by duration.
last_frame_urlLast Frame
resolutionResolution
Options: 720p, 1080p, 4k
Default: 720p
durationDuration (seconds)
Default: 5
Range: 3 to 30
dynamic_rangeHDR needs 1080p or 4K and adds a per-second surcharge.
Options: sdr, hdr
Default: sdr
webhookUrlURL to receive a webhook notification when the task completes.
metadataCustom key-value metadata to attach to the task for tracking.
Response (HTTP 202)
successWhether the request was accepted successfully.
data.idUnique task ID. Use this to poll GET /api/v1/tasks/{id} for results.
data.statusTask status: pending, processing, completed, failed.
data.typeGeneration type: keyframe-to-video.
data.providerProvider name: kling.
data.modelModel ID used for generation.
data.created_atISO 8601 timestamp of when the task was created.
data.estimated_secondsEstimated time in seconds until the task completes.