Kling API
Model Page: Kling API
Community model card for calling Kling through a REST API.
This repo documents the kling-3.0 model as exposed by Apiframe: Kuaishou's Kling Video 3.0, text-to-video and image-to-video, 3–15s, optional native audio, start/end frame control. Related ids on the same endpoint: kling-3.0-omni, kling-3.0-motion-control.
This repository does not host weights. Kling is a closed model. Inference runs remotely.
Model description
| Architecture | Kling 3.0 |
| Task | text-to-video; image-to-video |
| Output | 1 video (videoUrl) |
| Duration | 3, 5, 8, 10, or 15 seconds |
| Aspect ratios | 1:1, 9:16, 16:9 |
| Modes | standard (720p), pro (1080p), 4k |
| Typical latency | ~135s |
How to use
pip install requests
import os
import time
import requests
API = "https://api.apiframe.ai/v2"
headers = {
"X-API-Key": os.environ["APIFRAME_API_KEY"],
"Content-Type": "application/json",
}
job = requests.post(
f"{API}/videos/generate",
headers=headers,
json={
"model": "kling-3.0",
"prompt": "a cinematic sunrise over a futuristic cityscape",
"klingParams": {
"duration": 5,
"mode": "pro",
"aspect_ratio": "16:9",
"generate_audio": True,
},
},
).json()
while True:
result = requests.get(f"{API}/jobs/{job['jobId']}", headers=headers).json()
if result["status"] in ("COMPLETED", "FAILED"):
break
time.sleep(2)
print(result.get("result"))
result["videoUrl"] is the CDN URL. Pass webhookUrl on the generate call if you do not want to poll.
Image-to-video
import os
import requests
headers = {
"X-API-Key": os.environ["APIFRAME_API_KEY"],
"Content-Type": "application/json",
}
requests.post(
"https://api.apiframe.ai/v2/videos/generate",
headers=headers,
json={
"model": "kling-3.0",
"prompt": "slow push in, steam rising from the cup",
"klingParams": {
"start_image": "https://example.com/frame.jpg",
"duration": 5,
"mode": "pro",
"aspect_ratio": "16:9",
},
},
)
Swap model for kling-3.0-omni (reference images/video) or kling-3.0-motion-control (transfer motion from a clip onto a character).
Limitations
- Closed model. No weights, fine-tuning, or local inference.
- Requires an Apiframe API key (
X-API-Key). - Commercial use follows Kling's terms.
- Generated media is retained on the CDN for 90 days.
License
Outputs are subject to Kling's terms. This card is documentation only. Apiframe is not affiliated with, endorsed by, or sponsored by Kuaishou Technology.