Agent skill

Klingai Common Errors

by jeremylongshore in jeremylongshore/tons-of-skills-marketplace

Diagnose and fix common Kling AI API errors. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check passedMedia & Creative

Install Klingai Common Errors

skills CLI
$ npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-common-errors -a claude-code

Project install by default; add -g for ~/.claude/skills/.

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace klingai-common-errors --agent claude-code

Project scope by default; add --scope user for a personal install. Needs GitHub CLI 2.90.0 or later (public preview).

Manual copy
$ git clone --depth 1 https://github.com/jeremylongshore/tons-of-skills-marketplace.git skills-src && mkdir -p .claude/skills && cp -r skills-src/skills/.curated/klingai-common-errors .claude/skills/klingai-common-errors && rm -rf skills-src

Use ~/.claude/skills/ instead of .claude/skills for a personal install. The folder must contain SKILL.md.

Claude Code skills documentation · loads skills from .claude/skills/

Facts

Skill name
klingai-common-errors
GitHub stars
2.8k
Token cost
~1.8k tokens
SKILL.md length
532 words
Files
2 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Diagnose and fix common Kling AI API errors. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 7 steps: Auth valid? — Test with a simple GET… → Credits available? — Check balance in… → Model valid? — Verify model_name matches… → …
  • Troubleshooting failed video generation
  • SKILL.md covers Overview, HTTP Error Codes, Task-Level Failures and JWT Authentication Errors, plus 9 more sections
  • Instructions only: no scripts, shell commands, URLs or credentials in SKILL.md

What it does

Klingai Common Errors is an agent skill from jeremylongshore/tons-of-skills-marketplace. Diagnose and fix common Kling AI API errors. Use when troubleshooting failed video generation or API issues. Trigger with phrases like 'kling ai error', 'klingai not working', 'fix klingai', 'klingai failed'.

Its SKILL.md is about 1.8k tokens, which your agent loads only when the skill is triggered. The skill folder holds 2 other files, including reference files (for example `references/error-codes.md`). Compatibility notes: Designed for Claude Code

It sits in Media & Creative, covering AI video generation. The repository describes itself as: Model-agnostic agent-skills platform with a harness-free canonical layer, verified adapters, and the ccpi package manager. Explore at tonsofskills.com. The licence is MIT.

When your agent uses it

  • Troubleshooting failed video generation
  • With phrases like kling ai error
  • Klingai not working

Example prompts

  • “kling ai error”
  • “klingai not working”
  • “fix klingai”
  • “/klingai-common-errors”

Requirements

  • Python 3
  • Compatibility (from SKILL.md): Designed for Claude Code
  • Pre-approved tools (allowed-tools): Read, Write, Edit, Bash(npm:*), Grep

Workflow steps

7 steps, taken from the first numbered list in SKILL.md.

  1. Auth valid? — Test with a simple GET request first
  2. Credits available? — Check balance in developer console
  3. Model valid? — Verify model_name matches catalog exactly
  4. Parameters valid? — duration must be "5" or "10" (string, not int)
  5. Prompt clean? — Remove special characters, keep under 2500 chars
  6. Image accessible? — For I2V, verify image URL is publicly accessible
  7. Feature exclusivity? — image_tail, dynamic_masks, and camera_control are mutually exclusive

What it can do on your machine

Read from SKILL.md and the folder at commit cfae287. It shows what the files ask for, not the result of running them.

  • Tool permissions

    Pre-approves these tools, so the agent can use them without asking each time:

    • Read
    • Write
    • Edit
    • Bash(npm:*)
    • Grep

    From allowed-tools in the SKILL.md frontmatter.

  • Runs code

    No scripts in the folder and no shell commands in SKILL.md (its code samples are python).

    From the folder's file list and the shell code blocks in SKILL.md.

  • Network

    No URLs in SKILL.md.

    From URLs in SKILL.md, links to its own repository left out.

  • Credentials

    Names no API keys, tokens, secrets or passwords.

    From names ending in _API_KEY, _TOKEN, _SECRET, _KEY or _PASSWORD in SKILL.md.

  • Compatibility

    Designed for Claude Code

    From compatibility in the SKILL.md frontmatter.

Context cost

Klingai Common Errors loads about 1.8k tokens when it runs, and up to ~3.2k if it reads all its reference files. Until then it costs about 58 tokens; SKILL.md has 532 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~58
When it runs · the whole SKILL.md, loaded when a task matches
~1.8k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~3.2k

Estimates: characters ÷ 4, the usual rule of thumb; real counts depend on the model's tokenizer. Scripts and assets cost tokens only if the agent reads them.

Safety

Auto-check passed

The automated check found no risky patterns in SKILL.md.

Automated static check — not a guarantee. Review scripts before installing. It scans the text of SKILL.md for risky patterns (piping downloads into a shell, reading credential files, hidden Unicode, destructive commands); files beside SKILL.md are not scanned.

SKILL.md

The full file from jeremylongshore/tons-of-skills-marketplace at commit cfae287, republished under its MIT licence (© jeremylongshore). 532 words, ~1,823 tokens.

Download SKILL.mdSave it as .claude/skills/klingai-common-errors/SKILL.md (or your agent's skills folder). This skill also uses 1 other file; get the full folder from GitHub.
name
klingai-common-errors
description
Diagnose and fix common Kling AI API errors. Use when troubleshooting failed video generation or API issues. Trigger with phrases like 'kling ai error', 'klingai not working', 'fix klingai', 'klingai failed'.
allowed-tools
Read, Write, Edit, Bash(npm:*), Grep
compatibility
Designed for Claude Code
version
1.18.0
license
MIT
author
Jeremy Longshore <jeremy@intentsolutions.io>
tags
saas, kling-ai, debugging, errors

Kling AI Common Errors

Overview

Complete error reference for the Kling AI API. Covers HTTP status codes, task-level failures, JWT issues, and generation-specific problems with tested solutions.

HTTP Error Codes

CodeErrorCauseSolution
400Bad RequestInvalid parameters, malformed JSONValidate all required fields; check model_name is valid
401UnauthorizedInvalid/expired JWT tokenRegenerate JWT; verify AK/SK; check exp claim
402Payment RequiredInsufficient creditsTop up API resource pack or subscription
403ForbiddenContent policy violation or API disabledReview prompt against content policy; enable API access
404Not FoundInvalid task_id or wrong endpointVerify task_id; check endpoint path spelling
429Too Many RequestsRate limit exceededImplement exponential backoff (see pattern below)
500Internal Server ErrorKling platform issueRetry after 30s; if persistent, check status page
502Bad GatewayUpstream service unavailableRetry with backoff; typically transient
503Service UnavailableSystem maintenanceWait and retry; check announcements

Task-Level Failures

When HTTP returns 200 but task_status is "failed":

task_status_msgCauseSolution
Content policy violationPrompt contains restricted contentRemove violent, adult, or copyrighted references
Image quality too lowSource image is blurry or too smallUse image >= 300x300px, clear and sharp
Prompt too complexToo many scene elementsSimplify to 1-2 subjects, clear action
Generation timeoutInternal processing exceeded limitRetry; reduce duration from 10s to 5s
Invalid image formatUnsupported file typeUse JPG, PNG, or WebP
Mask dimension mismatchMask size differs from sourceEnsure mask matches source image dimensions exactly

JWT Authentication Errors

Problem: 401 on every request
python
# WRONG — missing headers parameter
token = jwt.encode(payload, sk, algorithm="HS256")

# CORRECT — include explicit headers
token = jwt.encode(payload, sk, algorithm="HS256",
                   headers={"alg": "HS256", "typ": "JWT"})
Problem: Token works then fails after 30 min
python
# WRONG — token generated once at import time
TOKEN = generate_token()

# CORRECT — refresh before expiry
class TokenManager:
    def __init__(self, ak, sk):
        self.ak, self.sk = ak, sk
        self._token = None
        self._exp = 0

    @property
    def token(self):
        if time.time() >= self._exp - 300:  # 5 min buffer
            payload = {"iss": self.ak, "exp": int(time.time()) + 1800,
                       "nbf": int(time.time()) - 5}
            self._token = jwt.encode(payload, self.sk, algorithm="HS256",
                                     headers={"alg": "HS256", "typ": "JWT"})
            self._exp = int(time.time()) + 1800
        return self._token

Rate Limit Handling

python
import time
import requests

def request_with_backoff(method, url, headers, json=None, max_retries=5):
    """Retry with exponential backoff on 429 and 5xx errors."""
    for attempt in range(max_retries):
        response = method(url, headers=headers, json=json)

        if response.status_code == 429:
            retry_after = int(response.headers.get("Retry-After", 2 ** attempt))
            print(f"Rate limited. Retrying in {retry_after}s...")
            time.sleep(retry_after)
            continue
        elif response.status_code >= 500:
            wait = 2 ** attempt
            print(f"Server error {response.status_code}. Retrying in {wait}s...")
            time.sleep(wait)
            continue

        response.raise_for_status()
        return response

    raise RuntimeError(f"Max retries ({max_retries}) exceeded")

Diagnostic Checklist

When a generation fails, check in order:

  1. Auth valid? — Test with a simple GET request first
  2. Credits available? — Check balance in developer console
  3. Model valid? — Verify model_name matches catalog exactly
  4. Parameters valid? — duration must be "5" or "10" (string, not int)
  5. Prompt clean? — Remove special characters, keep under 2500 chars
  6. Image accessible? — For I2V, verify image URL is publicly accessible
  7. Feature exclusivity? — image_tail, dynamic_masks, and camera_control are mutually exclusive
Show full SKILL.md (188 more words)Show less

Debug Logging

python
import logging

logging.basicConfig(level=logging.DEBUG)
logger = logging.getLogger("kling")

def debug_request(method, url, headers, json=None):
    """Log request/response for debugging."""
    logger.debug(f"→ {method.__name__.upper()} {url}")
    logger.debug(f"→ Body: {json}")
    r = method(url, headers=headers, json=json)
    logger.debug(f"← Status: {r.status_code}")
    logger.debug(f"← Body: {r.text[:500]}")
    return r

Prerequisites

  • A sandbox workspace, synthetic or rights-cleared diagnostic brief, secret references, approved scope, redaction rules, draft-only destination, and incident owner.

Instructions

  1. Reproduce errors with sandbox fixtures only; do not log authorization headers, prompts, source assets, response bodies, or generated asset URLs.
  2. Capture aggregate status, error class, credit use, policy/rights outcome, and task state while verifying redaction and retention controls.
  3. Halt the canary and remove temporary drafts on scope, policy, rights, budget, or retention drift; revoke temporary access where appropriate.
  4. Store a redacted diagnostic receipt for the approved window and restore the known-good configuration before resuming work.

Output

Produce an error-triage receipt with environment, fixture classification, error class, aggregate status/credit signal, policy/rights/draft-only checks, incident owner, cleanup proof, and rollback reference. Exclude prompts, assets, identities, and credentials.

Error Handling

ConditionResponse
Sensitive material appears in diagnosticsStop collection, delete the artifact, correct redaction, and rotate/revoke access as needed.
Policy, rights, budget, or retention driftCancel tasks, remove drafts, and require owner review before retrying.

Examples

env=ci-sandbox; error=429; retries=backoff; budget=within-cap; policy=pass; destination=draft-only; cleanup=verified is a valid triage record.

Resources

© jeremylongshore, MIT. Rendered from Markdown: HTML in the file is shown as text, images as links, and headings moved down two levels. Raw file

Files

SKILL.md and 1 other file (references) in skills/.curated/klingai-common-errors of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/error-codes.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Klingai Common Errors next to the 5 skills that share the most tags, products or categories with it. Stars are the repository's; “used in” counts other GitHub owners with a copy.

Klingai Common Errors compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Klingai Common Errors this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.8kAutomated safety check: PassMIT
Clipmivo VideoBarneyD66/clipmivo-tools142—~945Automated safety check: PassMIT
Video Generationbytedance/deer-flow84k3 repos~1.4kAutomated safety check: PassMIT
Video Cover Imageitwanger/toBeBetterJavaer18k—~3.3kAutomated safety check: PassNone
Seedancesongguoxs/seedance-prompt-skill2.9k1 repos~2.5kAutomated safety check: PassNone
HyperFrames Video Entry Pointheygen-com/hyperframes60k3 repos~5.2kAutomated safety check: PassApache-2.0

Similar skills

  • Clipmivo Video

    BarneyD66/clipmivo-tools

    Create and manage AI video tasks through ClipmivoAI using its MCP server, CLI or REST API.

    142 GitHub stars~945 tokensUpdated 24 days ago
    Media & CreativeAuto-check passed
  • Video Generation

    bytedance/deer-flow

    Generates short videos from a structured JSON prompt, optionally guided by a reference image used as the first or last frame.

    84k GitHub starsUsed in 3 repos~1.4k tokens
    Media & CreativeAuto-check passed
  • Video Cover Image

    itwanger/toBeBetterJavaer

    Generate matched 3:4, 16:9, and 4:3 short-video cover images from toBeBetterJavaer video scripts or AI/Java technical topics.

    18k GitHub stars~3.3k tokensUpdated today
    Media & CreativeAuto-check passed
  • Seedance

    songguoxs/seedance-prompt-skill

    This skill should be used when the user asks to "generate video prompts", "create Seedance prompts", "write video descriptions", mentions "Seedance", "seedance", "即梦", "即梦平台", "视频提示词", "视频生成"…

    2.9k GitHub starsUsed in 1 repo~2.5k tokens
    Media & CreativeAuto-check passed
  • HyperFrames Video Entry Point

    heygen-com/hyperframes

    Entry point for making, editing and rendering videos from HTML compositions with HyperFrames, routing each request to the right workflow.

    60k GitHub starsUsed in 3 repos~5.2k tokens
    Media & CreativeAuto-check passed
  • Lanshu Create AI Presenter Video

    cclank/lanshu-create-ai-presenter-video

    Turn a topic or finished script into a complete, publish-ready explainer video — led by an AI presenter from an authorized adult presenter image, or performed in one of nine visual explainer styles…

    2.6k GitHub stars~3.6k tokensUpdated 4 days ago
    Media & CreativeAuto-check passed

More from jeremylongshore/tons-of-skills-marketplace

All 3,342 skills in this repo
  • Performing Security Code Review

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to conduct a security-focused code review using the security-agent plugin.

    2.8k GitHub starsUsed in 2 repos~1.3k tokens
    Auto-check: notes
  • Adapting Transfer Learning Models

    jeremylongshore/tons-of-skills-marketplace

    Build this skill automates the adaptation of pre-trained machine learning models using transfer learning techniques.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Agent Context Loader

    jeremylongshore/tons-of-skills-marketplace

    Execute proactive auto-loading: automatically detects and loads agents.md files.

    2.8k GitHub stars~1.1k tokensUpdated today
    Auto-check passed
  • Aggregating Performance Metrics

    jeremylongshore/tons-of-skills-marketplace

    Aggregate and centralize performance metrics from applications, systems, databases, caches, and services.

    2.8k GitHub stars~1.2k tokensUpdated today
    Auto-check passed
  • Analyzing Capacity Planning

    jeremylongshore/tons-of-skills-marketplace

    Execute this skill enables AI assistant to analyze capacity requirements and plan for future growth.

    2.8k GitHub stars~947 tokensUpdated today
    Auto-check passed
  • Analyzing Database Indexes

    jeremylongshore/tons-of-skills-marketplace

    Process use when you need to work with database indexing. An agent skill from jeremylongshore/tons-of-skills-marketplace.

    2.8k GitHub stars~2k tokensUpdated today
    Auto-check passed

Questions about Klingai Common Errors

What does Klingai Common Errors do?

Diagnose and fix common Kling AI API errors. An agent skill from jeremylongshore/tons-of-skills-marketplace. Klingai Common Errors is an agent skill from jeremylongshore/tons-of-skills-marketplace. Diagnose and fix common Kling AI API errors.

When should I use Klingai Common Errors?

Klingai Common Errors fits situations like: troubleshooting failed video generation; with phrases like kling ai error; klingai not working.

How do I install Klingai Common Errors in Claude Code?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-common-errors -a claude-code`. Or copy the skill folder (skills/.curated/klingai-common-errors in jeremylongshore/tons-of-skills-marketplace) into .claude/skills/klingai-common-errors in your project. Claude Code loads it when a task matches its description.

How do I install Klingai Common Errors in Codex?

Run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-common-errors -a codex`. Or copy the skill folder (skills/.curated/klingai-common-errors in jeremylongshore/tons-of-skills-marketplace) into .agents/skills/klingai-common-errors in your project. Codex loads it when a task matches its description.

Can I use Klingai Common Errors in Cursor, Gemini CLI or GitHub Copilot?

Cursor, Gemini CLI, GitHub Copilot and OpenCode also load SKILL.md folders. With the skills CLI, run `npx skills add jeremylongshore/tons-of-skills-marketplace --skill klingai-common-errors -a cursor` (or -a gemini-cli, github-copilot or opencode for the others). To copy it by hand, put the folder in .cursor/skills/klingai-common-errors, .gemini/skills/klingai-common-errors, .github/skills/klingai-common-errors and .opencode/skills/klingai-common-errors in your project.

What does Klingai Common Errors need to run?

SKILL.md names no scripts, command-line tools or credentials: Klingai Common Errors is instructions for the agent only. Our summary lists: Python 3. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Klingai Common Errors access the network?

SKILL.md contains no URLs. Any network use would come from the scripts or tools the agent runs. This is read from the text; nothing was executed.

Is Klingai Common Errors safe to install?

Our automated static check of SKILL.md found no risky patterns, such as piping downloads into a shell, reading credential files or hidden Unicode. It is not a guarantee. Review the folder before installing.

What licence does Klingai Common Errors use?

Klingai Common Errors is published under the MIT licence (declared in SKILL.md). It allows redistribution, so the full SKILL.md is shown on this page.

How many tokens does Klingai Common Errors use?

About 1.8k tokens (SKILL.md is roughly 7.3k characters). Agents keep only the skill's name and description in context until a task matches; then they load SKILL.md in full. Its references folder adds about 1.4k tokens, read only when the agent opens those files.

What are the alternatives to Klingai Common Errors?

Skills that share tags, products or a category with Klingai Common Errors: Clipmivo Video (BarneyD66/clipmivo-tools, 142 stars), Video Generation (bytedance/deer-flow, 84k stars), Video Cover Image (itwanger/toBeBetterJavaer, 18k stars) and Seedance (songguoxs/seedance-prompt-skill, 2.9k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Klingai Common Errors?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,827 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 10, 2026.

Source: jeremylongshore/tons-of-skills-marketplace on GitHub. Facts on this page come from the repository at the commit we read; the author's words are quoted as theirs.