Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Create your first Kling AI video generation with a minimal working example. Use when learning Kling AI or testing your setup. Trigger with phrases like 'kling ai hello world', 'first kling video', 'klingai quickstart', 'test klingai'.
.claude/skills/jeremylongshore-klingai-hello-world/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 23% | 0% |
| case-02 | ✗→✓ | ▲ Improved | -5% | 0% |
| case-03 | ✗→✓ | ▲ Improved | -3% | 0% |
| case-20 | ✗→✓ | ▲ Improved | 46% | 0% |
| case-21 | ✗→✓ | ▲ Improved | 28% | 0% |
Generate your first AI video in under 20 lines of code. This skill walks through the complete create-poll-download cycle using the Kling AI REST API.
Base URL: https://api.klingai.com/v1
klingai-install-auth setuprequests and PyJWTpythonimport jwt, time, os, requests # --- Auth --- def get_token(): ak = os.environ["KLING_ACCESS_KEY"] sk = os.environ["KLING_SECRET_KEY"] payload = {"iss": ak, "exp": int(time.time()) + 1800, "nbf": int(time.time()) - 5} return jwt.encode(payload, sk, algorithm="HS256", headers={"alg": "HS256", "typ": "JWT"}) BASE = "https://api.klingai.com/v1" HEADERS = {"Authorization": f"Bearer {get_token()}", "Content-Type": "application/json"} # --- Step 1: Create task --- task = requests.post(f"{BASE}/videos/text2video", headers=HEADERS, json={ "model_name": "kling-v2-master", "prompt": "A golden retriever running through autumn leaves in slow motion, cinematic lighting", "duration": "5", "aspect_ratio": "16:9", "mode": "standard", }).json() task_id = task["data"]["task_id"] print(f"Task created: {task_id}") # --- Step 2: Poll until complete --- import time as t while True: t.sleep(10) status = requests.get(f"{BASE}/videos/text2video/{task_id}", headers=HEADERS).json() state = status["data"]["task_status"] print(f"Status: {state}") if state == "succeed": video_url = status["data"]["task_result"]["videos"][0]["url"] print(f"Video ready: {video_url}") break elif state == "failed": print(f"Failed: {status['data']['task_status_msg']}") break
javascriptimport jwt from "jsonwebtoken"; const BASE = "https://api.klingai.com/v1"; function getHeaders() { const token = jwt.sign( { iss: process.env.KLING_ACCESS_KEY, exp: Math.floor(Date.now() / 1000) + 1800, nbf: Math.floor(Date.now() / 1000) - 5 }, process.env.KLING_SECRET_KEY, { algorithm: "HS256", header: { typ: "JWT" } } ); return { Authorization: `Bearer ${token}`, "Content-Type": "application/json" }; } // Create task const res = await fetch(`${BASE}/videos/text2video`, { method: "POST", headers: getHeaders(), body: JSON.stringify({ model_name: "kling-v2-master", prompt: "A golden retriever running through autumn leaves in slow motion", duration: "5", aspect_ratio: "16:9", mode: "standard", }), }); const { data } = await res.json(); console.log(`Task: ${data.task_id}`); // Poll const poll = setInterval(async () => { const r = await fetch(`${BASE}/videos/text2video/${data.task_id}`, { headers: getHeaders() }); const s = await r.json(); if (s.data.task_status === "succeed") { console.log("Video:", s.data.task_result.videos[0].url); clearInterval(poll); } else if (s.data.task_status === "failed") { console.error("Failed:", s.data.task_status_msg); clearInterval(poll); } }, 10000);
json{ "code": 0, "message": "success", "data": { "task_id": "abc123...", "task_status": "succeed", "task_result": { "videos": [{ "id": "vid_001", "url": "https://cdn.klingai.com/...", "duration": "5.0" }] } } }
| Status | Meaning | |--------|---------| | submitted | Task queued, waiting for processing | | processing | Video generation in progress | | succeed | Complete — video URL available | | failed | Generation failed — check task_status_msg |
| Problem | Fix | |---------|-----| | 401 response | JWT token expired or AK/SK wrong | | task_status: failed | Prompt too vague — add visual detail | | Empty videos array | Task still processing — poll longer | | Slow generation | Standard mode takes 60-120s; use mode: "standard" for first test |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-08 | pass→pass | 13,709 | 9,876 | -28% | 1 | 1 | 0% | 1,595 | 2,366 | +48% | 0 | 0 | — |
case-01 | fail→pass | 15,722 | 17,615 | +12% | 1 | 1 | 0% | 3,496 | 4,303 | +23% | 0 | 0 | — |
case-02 | fail→pass | 16,110 | 13,400 | -17% | 1 | 1 | 0% | 3,333 | 3,174 | -5% | 0 | 0 | — |
case-03 | fail→pass | 23,210 | 16,434 | -29% | 1 | 1 | 0% | 3,947 | 3,825 | -3% | 0 | 0 | — |
case-09 | pass→pass | 14,749 | 8,092 | -45% | 1 | 1 | 0% | 1,823 | 1,920 | +5% | 0 | 0 | — |
case-04 | fail→fail | 18,631 | 19,194 | +3% | 1 | 1 | 0% | 2,746 | 3,773 | +37% | 0 | 0 | — |
case-05 | fail→fail | 18,392 | 13,311 | -28% | 1 | 1 | 0% | 2,586 | 4,116 | +59% | 0 | 0 | — |
case-06 | fail→fail | 20,301 | 19,988 | -2% | 1 | 1 | 0% | 2,812 | 4,531 | +61% | 0 | 0 | — |
case-07 | pass→pass | 11,624 | 12,381 | +7% | 1 | 1 | 0% | 2,248 | 2,919 | +30% | 0 | 0 | — |
case-10 | fail→fail | 11,762 | 3,099 | -74% | 1 | 1 | 0% | 1,207 | 1,940 | +61% | 0 | 0 | — |
case-11 | pass→pass | 8,029 | 8,966 | +12% | 1 | 1 | 0% | 1,262 | 1,977 | +57% | 0 | 0 | — |
case-12 | pass→pass | 11,249 | 10,190 | -9% | 1 | 1 | 0% | 1,136 | 2,194 | +93% | 0 | 0 | — |
case-13 | pass→pass | 12,885 | 7,979 | -38% | 1 | 1 | 0% | 1,215 | 1,927 | +59% | 0 | 0 | — |
case-14 | pass→pass | 10,496 | 10,346 | -1% | 1 | 1 | 0% | 1,883 | 2,342 | +24% | 0 | 0 | — |
case-15 | pass→pass | 16,513 | 8,489 | -49% | 1 | 1 | 0% | 1,688 | 2,117 | +25% | 0 | 0 | — |
case-16 | pass→pass | 9,800 | 7,441 | -24% | 1 | 1 | 0% | 826 | 1,783 | +116% | 0 | 0 | — |
case-17 | pass→pass | 10,900 | 6,904 | -37% | 1 | 1 | 0% | 932 | 1,703 | +83% | 0 | 0 | — |
case-18 | pass→pass | 11,412 | 8,027 | -30% | 1 | 1 | 0% | 1,993 | 2,956 | +48% | 0 | 0 | — |
case-19 | pass→pass | 13,661 | 8,366 | -39% | 1 | 1 | 0% | 1,463 | 2,037 | +39% | 0 | 0 | — |
case-20 | fail→pass | 19,303 | 15,620 | -19% | 1 | 1 | 0% | 1,879 | 2,745 | +46% | 0 | 0 | — |
case-21 | fail→pass | 9,761 | 2,247 | -77% | 1 | 1 | 0% | 1,372 | 1,752 | +28% | 0 | 0 | — |
case-22 | pass→pass | 16,259 | 8,959 | -45% | 1 | 1 | 0% | 1,948 | 2,135 | +10% | 0 | 0 | — |
case-23 | fail→pass | 10,232 | 7,957 | -22% | 1 | 1 | 0% | 1,377 | 1,981 | +44% | 0 | 0 | — |
case-24 | pass→pass | 10,376 | 6,769 | -35% | 1 | 1 | 0% | 997 | 1,686 | +69% | 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.