Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Generate videos from text prompts with Kling AI. Use when creating videos from descriptions, learning prompt techniques, or building T2V pipelines. Trigger with phrases like 'kling ai text to video', 'klingai prompt', 'generate video from text', 'text2video kling'.
.claude/skills/jeremylongshore-klingai-text-to-video/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-02 | ✗→✓ | ▲ Improved | 30% | 0% |
| case-17 | ✗→✓ | ▲ Improved | -13% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 17% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 59% | 0% |
| case-05 | ✓→✓ | = Same ✓ | 89% | 0% |
Generate videos from text prompts using the /v1/videos/text2video endpoint. Supports models v1 through v2.6, standard/professional modes, camera control, negative prompts, and native audio (v2.6+).
Endpoint: POST https://api.klingai.com/v1/videos/text2video
| Parameter | Type | Required | Description | |-----------|------|----------|-------------| | model_name | string | Yes | Model version (see model catalog) | | prompt | string | Yes | Video description, max 2500 chars | | negative_prompt | string | No | What to exclude from generation | | duration | string | Yes | "5" or "10" seconds | | aspect_ratio | string | No | "16:9" (default), "9:16", "1:1", etc. | | mode | string | No | "standard" (default) or "professional" | | cfg_scale | float | No | Prompt adherence (0.0-1.0, default 0.5) | | camera_control | object | No | Camera movement config | | callback_url | string | No | Webhook URL for completion notification |
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"} # Create text-to-video task response = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={ "model_name": "kling-v2-6", "prompt": "Aerial drone shot of a coral reef at golden hour, " "tropical fish swimming through crystal clear water, " "sun rays penetrating the surface, cinematic 4K", "negative_prompt": "blurry, low quality, distorted, watermark", "duration": "5", "aspect_ratio": "16:9", "mode": "professional", "cfg_scale": 0.5, }) task = response.json() task_id = task["data"]["task_id"] # Poll for completion while True: time.sleep(15) result = requests.get( f"{BASE}/videos/text2video/{task_id}", headers=get_headers() ).json() status = result["data"]["task_status"] if status == "succeed": video = result["data"]["task_result"]["videos"][0] print(f"Video URL: {video['url']}") print(f"Duration: {video['duration']}s") break elif status == "failed": raise RuntimeError(result["data"]["task_status_msg"]) # else: submitted/processing — keep polling
python# Camera movement types: pan, tilt, zoom, roll response = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={ "model_name": "kling-v2-6", "prompt": "A medieval castle on a cliff at sunrise, fog in the valley", "duration": "5", "mode": "standard", "camera_control": { "type": "simple", "config": { "horizontal": 5, # pan right (negative = left), range -10 to 10 "vertical": 0, # tilt (negative = down, positive = up) "zoom": 3, # zoom in (positive) or out (negative) "roll": 0, # rotation "pan": 0, # dolly left/right "tilt": -2, # dolly up/down } }, })
Rule: Only one non-zero field in config for type: "simple".
pythonresponse = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={ "model_name": "kling-v2-6", "prompt": "A jazz band performing in a dimly lit club, saxophone solo, " "audience clapping, warm amber lighting", "duration": "10", "mode": "professional", "motion_has_audio": True, # generates synchronized audio })
| Technique | Example | |-----------|---------| | Scene + action + style | "A samurai walking through cherry blossoms, cinematic slow motion" | | Lighting cues | "golden hour", "neon-lit", "overcast diffused light" | | Camera language | "close-up", "wide establishing shot", "tracking shot" | | Negative prompt | "blurry, watermark, text overlay, distorted faces" | | Material/texture | "brushed steel", "hand-painted watercolor", "photorealistic" |
| Duration | Standard | Professional | |----------|----------|-------------| | 5 seconds | 10 credits | 35 credits | | 10 seconds | 20 credits | 70 credits |
| Error | Cause | Fix | |-------|-------|-----| | 400 invalid prompt | Empty or >2500 chars | Check prompt length | | 400 invalid model | Unsupported model_name | Use valid model ID from catalog | | 402 insufficient credits | Not enough credits | Top up account | | task_status: failed | Content policy violation or complexity | Simplify prompt, remove restricted content |
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→fail | 15,062 | 18,636 | +24% | 1 | 1 | 0% | 3,201 | 4,479 | +40% | 0 | 0 | — |
case-02 | fail→pass | 19,269 | 14,999 | -22% | 1 | 1 | 0% | 2,623 | 3,413 | +30% | 0 | 0 | — |
case-03 | pass→pass | 30,839 | 19,978 | -35% | 1 | 1 | 0% | 4,419 | 5,155 | +17% | 0 | 0 | — |
case-04 | pass→pass | 9,264 | 5,396 | -42% | 1 | 1 | 0% | 1,740 | 2,773 | +59% | 0 | 0 | — |
case-05 | pass→pass | 16,385 | 12,199 | -26% | 1 | 1 | 0% | 2,129 | 4,019 | +89% | 0 | 0 | — |
case-06 | pass→pass | 18,775 | 19,308 | +3% | 1 | 1 | 0% | 2,367 | 4,348 | +84% | 0 | 0 | — |
case-07 | pass→pass | 15,905 | 13,468 | -15% | 1 | 1 | 0% | 2,096 | 3,322 | +58% | 0 | 0 | — |
case-08 | pass→pass | 10,968 | 8,170 | -26% | 1 | 1 | 0% | 860 | 2,150 | +150% | 0 | 0 | — |
case-09 | pass→pass | 10,510 | 8,883 | -15% | 1 | 1 | 0% | 989 | 2,315 | +134% | 0 | 0 | — |
case-10 | pass→pass | 8,825 | 7,388 | -16% | 1 | 1 | 0% | 1,617 | 2,053 | +27% | 0 | 0 | — |
case-11 | pass→pass | 18,933 | 10,970 | -42% | 1 | 1 | 0% | 1,930 | 2,402 | +24% | 0 | 0 | — |
case-12 | pass→pass | 13,348 | 7,768 | -42% | 1 | 1 | 0% | 1,412 | 2,012 | +42% | 0 | 0 | — |
case-13 | pass→pass | 9,352 | 7,311 | -22% | 1 | 1 | 0% | 782 | 1,959 | +151% | 0 | 0 | — |
case-14 | pass→pass | 11,961 | 7,232 | -40% | 1 | 1 | 0% | 995 | 1,925 | +93% | 0 | 0 | — |
case-15 | pass→pass | 12,393 | 7,660 | -38% | 1 | 1 | 0% | 1,469 | 1,982 | +35% | 0 | 0 | — |
case-16 | pass→pass | 14,549 | 9,649 | -34% | 1 | 1 | 0% | 1,396 | 2,368 | +70% | 0 | 0 | — |
case-17 | fail→pass | 19,738 | 8,199 | -58% | 1 | 1 | 0% | 2,481 | 2,150 | -13% | 0 | 0 | — |
case-18 | pass→pass | 6,153 | 4,015 | -35% | 1 | 1 | 0% | 1,030 | 2,372 | +130% | 0 | 0 | — |
case-19 | pass→pass | 8,870 | 10,861 | +22% | 1 | 1 | 0% | 1,693 | 2,408 | +42% | 0 | 0 | — |
case-20 | pass→pass | 5,098 | 2,737 | -46% | 1 | 1 | 0% | 887 | 2,076 | +134% | 0 | 0 | — |
case-21 | pass→pass | 19,598 | 13,096 | -33% | 1 | 1 | 0% | 2,218 | 2,881 | +30% | 0 | 0 | — |
case-22 | pass→pass | 10,953 | 7,951 | -27% | 1 | 1 | 0% | 948 | 2,131 | +125% | 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. 22 cases were attempted. The headline lift of +9 percentage points is the difference between those two pass rates over the 22 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.