Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Extend video duration using Kling AI continuation. Use when creating longer videos from shorter clips or building sequences. Trigger with phrases like 'klingai extend video', 'kling ai video continuation', 'klingai longer video', 'extend klingai clip'.
.claude/skills/jeremylongshore-klingai-video-extension/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-19 | ✗→✓ | ▲ Improved | 10% | 0% |
| case-01 | ✗→✓ | ▲ Improved | -12% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-03 | ✗→✓ | ▲ Improved | 12% | 0% |
| case-05 | ✗→✓ | ▲ Improved | 64% | 0% |
Extend an existing video by appending additional seconds. The extension endpoint takes the task_id of a completed video and generates a seamless continuation.
Endpoint: POST https://api.klingai.com/v1/videos/video-extend
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | task_id | string | Yes | Task ID of the completed source video | | prompt | string | No | Motion/scene description for extension | | duration | string | No | Extension length: "5" (default) | | mode | string | No | "standard" or "professional" | | model_name | string | No | Default: "kling-v2-master" | | callback_url | string | No | Webhook for completion |
pythonimport jwt, time, os, requests BASE = "https://api.klingai.com/v1" def get_headers(): ak, sk = os.environ["KLING_ACCESS_KEY"], os.environ["KLING_SECRET_KEY"] token = jwt.encode( {"iss": ak, "exp": int(time.time()) + 1800, "nbf": int(time.time()) - 5}, sk, algorithm="HS256", headers={"alg": "HS256", "typ": "JWT"} ) return {"Authorization": f"Bearer {token}", "Content-Type": "application/json"} # Step 1: Generate the initial 5s video initial = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={ "model_name": "kling-v2-master", "prompt": "A rocket launching from a desert landscape, cinematic", "duration": "5", "mode": "standard", }).json() initial_task_id = initial["data"]["task_id"] # Wait for completion... # (poll until task_status == "succeed") # Step 2: Extend by 5 more seconds extension = requests.post(f"{BASE}/videos/video-extend", headers=get_headers(), json={ "task_id": initial_task_id, "prompt": "The rocket ascends through clouds into the stratosphere", "duration": "5", "mode": "standard", }).json() ext_task_id = extension["data"]["task_id"] # Step 3: Poll extension task while True: time.sleep(15) result = requests.get( f"{BASE}/videos/video-extend/{ext_task_id}", headers=get_headers() ).json() if result["data"]["task_status"] == "succeed": extended_url = result["data"]["task_result"]["videos"][0]["url"] print(f"Extended video: {extended_url}") break elif result["data"]["task_status"] == "failed": print(f"Failed: {result['data']['task_status_msg']}") break
pythondef chain_extensions(initial_task_id: str, prompts: list[str], duration: str = "5", mode: str = "standard") -> list[str]: """Chain multiple extensions to build a longer video.""" current_task_id = initial_task_id video_urls = [] for i, prompt in enumerate(prompts): print(f"Extension {i + 1}/{len(prompts)}: submitting...") # Submit extension r = requests.post(f"{BASE}/videos/video-extend", headers=get_headers(), json={ "task_id": current_task_id, "prompt": prompt, "duration": duration, "mode": mode, }).json() ext_task_id = r["data"]["task_id"] # Poll for completion while True: time.sleep(15) result = requests.get( f"{BASE}/videos/video-extend/{ext_task_id}", headers=get_headers() ).json() status = result["data"]["task_status"] if status == "succeed": url = result["data"]["task_result"]["videos"][0]["url"] video_urls.append(url) current_task_id = ext_task_id # next extension chains from this print(f"Extension {i + 1} complete: {url}") break elif status == "failed": raise RuntimeError(f"Extension {i + 1} failed: {result['data']['task_status_msg']}") return video_urls
python# Generate initial 5s initial_r = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={ "model_name": "kling-v2-master", "prompt": "Morning sunrise over a mountain lake, mist rising", "duration": "5", "mode": "standard", }).json() initial_id = initial_r["data"]["task_id"] # ... poll until complete ... # Chain 3 more extensions = 5 + 5 + 5 + 5 = 20 seconds total extensions = chain_extensions(initial_id, [ "Sun rises higher, birds begin flying across the lake", "A deer approaches the water's edge to drink", "Wide shot pulling back to reveal the full mountain range", ])
Each extension costs the same as a new generation:
| Extension Duration | Standard | Professional | |-------------------|----------|-------------| | 5 seconds | 10 credits | 35 credits |
A 20-second video (initial + 3 extensions) costs 40 credits in standard mode.
| Error | Cause | Fix | |-------|-------|-----| | Invalid task_id | Source task doesn't exist | Verify task_id is from a completed generation | | Source not complete | Extending a task still processing | Wait for source task to reach succeed status | | Extension failed | Prompt conflict with source | Align extension prompt with original scene |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-20 | pass→pass | 13,138 | 9,592 | -27% | 1 | 1 | 0% | 2,495 | 3,631 | +46% | 0 | 0 | — |
case-21 | pass→pass | 20,008 | 30,281 | +51% | 1 | 1 | 0% | 3,169 | 4,710 | +49% | 0 | 0 | — |
case-10 | pass→pass | 9,502 | 1,737 | -82% | 1 | 1 | 0% | 723 | 1,797 | +149% | 0 | 0 | — |
case-19 | fail→pass | 16,904 | 2,303 | -86% | 1 | 1 | 0% | 1,760 | 1,938 | +10% | 0 | 0 | — |
case-01 | fail→pass | 30,167 | 14,142 | -53% | 1 | 1 | 0% | 4,307 | 3,771 | -12% | 0 | 0 | — |
case-02 | fail→pass | 28,780 | 35,980 | +25% | 1 | 1 | 0% | 4,715 | 5,278 | +12% | 0 | 0 | — |
case-03 | fail→pass | 12,142 | 12,477 | +3% | 1 | 1 | 0% | 2,792 | 3,123 | +12% | 0 | 0 | — |
case-04 | pass→pass | 11,909 | 7,263 | -39% | 1 | 1 | 0% | 924 | 1,907 | +106% | 0 | 0 | — |
case-05 | fail→pass | 5,584 | 2,704 | -52% | 1 | 1 | 0% | 1,078 | 1,772 | +64% | 0 | 0 | — |
case-06 | pass→pass | 19,105 | 3,050 | -84% | 1 | 1 | 0% | 1,172 | 2,156 | +84% | 0 | 0 | — |
case-07 | pass→pass | 13,573 | 7,698 | -43% | 1 | 1 | 0% | 1,225 | 2,015 | +64% | 0 | 0 | — |
case-08 | pass→pass | 11,454 | 2,837 | -75% | 1 | 1 | 0% | 1,219 | 2,084 | +71% | 0 | 0 | — |
case-09 | pass→pass | 9,846 | 8,723 | -11% | 1 | 1 | 0% | 928 | 2,060 | +122% | 0 | 0 | — |
case-11 | pass→pass | 7,269 | 4,269 | -41% | 1 | 1 | 0% | 1,067 | 2,352 | +120% | 0 | 0 | — |
case-12 | pass→pass | 16,551 | 10,049 | -39% | 1 | 1 | 0% | 2,088 | 2,501 | +20% | 0 | 0 | — |
case-13 | pass→pass | 14,242 | 9,181 | -36% | 1 | 1 | 0% | 1,617 | 2,371 | +47% | 0 | 0 | — |
case-14 | pass→pass | 10,050 | 2,287 | -77% | 1 | 1 | 0% | 849 | 1,952 | +130% | 0 | 0 | — |
case-15 | pass→pass | 15,889 | 9,793 | -38% | 1 | 1 | 0% | 1,817 | 2,266 | +25% | 0 | 0 | — |
case-16 | pass→pass | 16,365 | 4,432 | -73% | 1 | 1 | 0% | 1,666 | 2,100 | +26% | 0 | 0 | — |
case-17 | pass→pass | 10,291 | 7,216 | -30% | 1 | 1 | 0% | 648 | 1,769 | +173% | 0 | 0 | — |
case-18 | pass→pass | 6,861 | 4,075 | -41% | 1 | 1 | 0% | 1,138 | 2,363 | +108% | 0 | 0 | — |
case-22 | pass→pass | 15,581 | 16,020 | +3% | 1 | 1 | 0% | 2,416 | 4,050 | +68% | 0 | 0 | — |
case-23 | fail→pass | 7,209 | 6,208 | -14% | 1 | 1 | 0% | 1,406 | 1,810 | +29% | 0 | 0 | — |
case-24 | pass→pass | 9,595 | 6,918 | -28% | 1 | 1 | 0% | 844 | 1,861 | +120% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 24 cases were attempted. The headline lift of +25 percentage points is the difference between those two pass rates over the 24 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.