|
Download README.md from AI-APIs/Kling-API: direct link, hf CLI and curl.
- Browser
- Download file 3.04 kB
-
https://huggingface.co/AI-APIs/Kling-API/resolve/main/README.md
- Command line
-
hf download hf://AI-APIs/Kling-API/README.md
-
curl -L -o README.md https://huggingface.co/AI-APIs/Kling-API/resolve/main/README.md
3.04 kB
| language: | |
| - en | |
| license: other | |
| pipeline_tag: text-to-video | |
| tags: | |
| - kling | |
| - text-to-video | |
| - image-to-video | |
| inference: false | |
| # Kling API | |
| **Model Page:** [Kling API](https://apiframe.ai/models/kling-3.0) | |
| 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. | |
| <video src="https://apiframe.ai/models-examples/kling-3-0-ember-neon-cafe.mp4" width="280" muted controls></video> | |
| ## 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 | |
| ```bash | |
| pip install requests | |
| ``` | |
| ```python | |
| 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 | |
| ```python | |
| 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. | |