Agent skill

Klingai Install Auth

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

Set up Kling AI API authentication with JWT tokens. An agent skill from jeremylongshore/tons-of-skills-marketplace.

MITAuto-check: notesBackend & APIs

Install Klingai Install Auth

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

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

GitHub CLI
$ gh skill install jeremylongshore/tons-of-skills-marketplace klingai-install-auth --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-install-auth .claude/skills/klingai-install-auth && 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-install-auth
GitHub stars
2.8k
Token cost
~1.5k tokens
SKILL.md length
350 words
Files
4 (incl. references)
Skills in repo
3,342
Repo updated
First seen
Licence
MIT

At a glance

Set up Kling AI API authentication with JWT tokens. An agent skill from jeremylongshore/tons-of-skills-marketplace.

  • Works in 3 steps: Get Credentials → Generate JWT Token → Verify Authentication
  • Starting a new Kling AI integration
  • SKILL.md covers Overview, Prerequisites, Step 1 — Get Credentials and Step 2 — Generate JWT Token, plus 8 more sections
  • Reaches api.klingai.com; needs KLING_ACCESS_KEY and KLING_SECRET_KEY

What it does

Klingai Install Auth is an agent skill from jeremylongshore/tons-of-skills-marketplace. Set up Kling AI API authentication with JWT tokens. Use when starting a new Kling AI integration or troubleshooting auth issues. Trigger with phrases like 'kling ai setup', 'klingai api key', 'kling ai authentication', 'configure klingai'.

Its SKILL.md is about 1.5k tokens, which your agent loads only when the skill is triggered. The skill folder holds 4 other files, including reference files (for example `references/environment-setup.md`, `references/errors.md` and `references/examples.md`). Compatibility notes: Designed for Claude Code

It sits in Backend & APIs, covering Authentication and 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

  • Starting a new Kling AI integration
  • Troubleshooting auth issues
  • With phrases like kling ai setup
  • Klingai api key

Example prompts

  • “kling ai setup”
  • “klingai api key”
  • “kling ai authentication”
  • “/klingai-install-auth”

Requirements

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

Workflow steps

3 steps, taken from the step headings in SKILL.md.

  1. Get Credentials
  2. Generate JWT Token
  3. Verify Authentication

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, bash and javascript).

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

  • Network

    Hosts in commands or code, which the agent is likely to contact:

    • api.klingai.com

    Also links to:

    • klingai.com

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

  • Credentials

    Names these keys or tokens, usually read from environment variables:

    • KLING_ACCESS_KEY
    • KLING_SECRET_KEY

    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 Install Auth loads about 1.5k tokens when it runs, and up to ~2.2k if it reads all its reference files. Until then it costs about 65 tokens; SKILL.md has 350 words of instructions outside code blocks.

Always · name and description, kept in context so the agent knows when to use it
~65
When it runs · the whole SKILL.md, loaded when a task matches
~1.5k
With references · SKILL.md plus every file in references/, read only if the agent opens them
~2.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: notes

The automated check noted patterns worth knowing about, such as sudo or a known installer.

  • NoteMentions a .env fileSKILL.md:45
    # .env file
  • NoteMentions a .env fileSKILL.md:164
    - Use `.env` files with `.gitignore` exclusion

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). 350 words, ~1,484 tokens.

Download SKILL.mdSave it as .claude/skills/klingai-install-auth/SKILL.md (or your agent's skills folder). This skill also uses 3 other files; get the full folder from GitHub.
name
klingai-install-auth
description
Set up Kling AI API authentication with JWT tokens. Use when starting a new Kling AI integration or troubleshooting auth issues. Trigger with phrases like 'kling ai setup', 'klingai api key', 'kling ai authentication', 'configure klingai'.
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, api, authentication

Kling AI Install & Auth

Overview

Kling AI uses JWT (JSON Web Token) authentication. You generate a token from your Access Key (AK) and Secret Key (SK), then pass it as a Bearer token in every request. Tokens expire after 30 minutes.

Base URL: https://api.klingai.com/v1

Prerequisites

  • Kling AI account at klingai.com
  • API access enabled (self-service, no waitlist)
  • Python 3.8+ with PyJWT or Node.js 18+

Step 1 — Get Credentials

  1. Sign in at app.klingai.com/global/dev
  2. Navigate to API Keys in the developer console
  3. Click Create API Key to generate an Access Key + Secret Key pair
  4. Store both values securely — the Secret Key is shown only once
bash
# .env file
KLING_ACCESS_KEY="ak_your_access_key_here"
KLING_SECRET_KEY="sk_your_secret_key_here"

Step 2 — Generate JWT Token

Python
python
import jwt
import time
import os

def generate_kling_token():
    """Generate a JWT token for Kling AI API authentication."""
    ak = os.environ["KLING_ACCESS_KEY"]
    sk = os.environ["KLING_SECRET_KEY"]

    headers = {"alg": "HS256", "typ": "JWT"}
    payload = {
        "iss": ak,
        "exp": int(time.time()) + 1800,  # 30 min expiry
        "nbf": int(time.time()) - 5,     # valid 5s ago (clock skew)
    }

    return jwt.encode(payload, sk, algorithm="HS256", headers=headers)

token = generate_kling_token()
# Use: Authorization: Bearer <token>
Node.js
javascript
import jwt from "jsonwebtoken";

function generateKlingToken() {
  const ak = process.env.KLING_ACCESS_KEY;
  const sk = process.env.KLING_SECRET_KEY;

  const payload = {
    iss: ak,
    exp: Math.floor(Date.now() / 1000) + 1800,
    nbf: Math.floor(Date.now() / 1000) - 5,
  };

  return jwt.sign(payload, sk, { algorithm: "HS256", header: { typ: "JWT" } });
}

Step 3 — Verify Authentication

python
import requests

BASE_URL = "https://api.klingai.com/v1"
token = generate_kling_token()

response = requests.get(
    f"{BASE_URL}/videos/text2video",  # any endpoint to test auth
    headers={"Authorization": f"Bearer {token}"},
)

if response.status_code == 401:
    print("Auth failed — check AK/SK values")
elif response.status_code in (200, 400):
    print("Auth working — credentials valid")

Token Management Pattern

python
import time

class KlingAuth:
    """Auto-refreshing JWT token manager."""

    def __init__(self, access_key: str, secret_key: str, buffer_sec: int = 300):
        self.ak = access_key
        self.sk = secret_key
        self.buffer = buffer_sec  # refresh 5 min before expiry
        self._token = None
        self._expires_at = 0

    @property
    def token(self) -> str:
        if time.time() >= (self._expires_at - self.buffer):
            self._refresh()
        return self._token

    def _refresh(self):
        now = int(time.time())
        payload = {"iss": self.ak, "exp": now + 1800, "nbf": now - 5}
        self._token = jwt.encode(payload, self.sk, algorithm="HS256",
                                  headers={"alg": "HS256", "typ": "JWT"})
        self._expires_at = now + 1800

    @property
    def headers(self) -> dict:
        return {
            "Authorization": f"Bearer {self.token}",
            "Content-Type": "application/json",
        }

Error Handling

ErrorCauseFix
401 UnauthorizedInvalid/expired JWTRegenerate token, check AK/SK
403 ForbiddenAPI access not enabledEnable API in developer console
JWT decode errorWrong secret keyVerify SK matches the AK pair
Token expired>30 min since generationImplement auto-refresh (see above)
Clock skew errorServer time mismatchUse nbf: now - 5 for tolerance

Security Checklist

  • Never commit AK/SK to version control
  • Use .env files with .gitignore exclusion
  • Rotate keys quarterly via the developer console
  • Use separate keys per environment (dev/staging/prod)
  • Set exp to 1800s max (Kling enforces this ceiling)
Show full SKILL.md (136 more words)Show less

Instructions

  1. Configure credentials only through approved secret references and separate sandbox/staging/production identities; never paste AK/SK values into source, prompts, logs, or receipts.
  2. Verify least-privilege scope, token lifetime, clock behavior, policy/rights workflow, credit cap, and draft-only destination with a synthetic canary.
  3. Halt use on an authentication, scope, policy, budget, or retention anomaly; revoke or rotate the affected credential and restore the approved configuration.
  4. Retain a redacted setup receipt only and remove temporary test assets at the approved boundary.

Output

Produce an authentication receipt with environment, secret-reference status, granted scope, token-lifetime check, synthetic canary result, policy/rights/budget/draft-only assertions, owner, cleanup proof, and revocation reference. Exclude keys, identities, prompts, and asset URLs.

Examples

env=staging; credential=secret-reference; scope=draft-only; token=within-policy; fixture=synthetic; policy=pass; cleanup=verified is a safe connection-check 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 3 other files (references) in skills/.curated/klingai-install-auth of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/environment-setup.md
  • references/errors.md
  • references/examples.md

Open the folder on GitHubat commit cfae287

Compare with similar skills

Klingai Install Auth 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 Install Auth compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Klingai Install Auth this skilljeremylongshore/tons-of-skills-marketplace2.8k—~1.5kAutomated safety check: NotesMIT
Fortify Developmentcoollabsio/coolify63k4 repos~1.9kAutomated safety check: PassMIT
Supabase Development and Debuggingsupabase/agent-skills2.7k3 repos~3.6kAutomated safety check: PassMIT
Better Auth Best Practiceslatitude-dev/latitude-llm4.7k7 repos~1.6kAutomated safety check: PassMIT
Gitnexus Exploringaws-samples/sample-kolya-br-proxy10612 repos~749Automated safety check: PassMIT-0
Supabasecurvenote/curvenote1705 repos~2.2kAutomated safety check: PassCustom licence

Similar skills

  • Fortify Development

    coollabsio/coolify

    ACTIVATE when the user works on authentication in Laravel. An agent skill from coollabsio/coolify.

    63k GitHub starsUsed in 4 repos~1.9k tokens
    Backend & APIsAuto-check passed
  • Official

    General Supabase skill for database, auth, Edge Functions, Realtime and storage work, plus client libraries, migrations, security audits, debugging and reading logs.

    2.7k GitHub starsUsed in 3 repos~3.6k tokens
    Backend & APIsAuto-check passed
  • Better Auth Best Practices

    latitude-dev/latitude-llm

    Configure Better Auth server and client, set up database adapters, manage sessions, add plugins, and handle environment variables.

    4.7k GitHub starsUsed in 7 repos~1.6k tokens
    Backend & APIsAuto-check passed
  • Gitnexus Exploring

    aws-samples/sample-kolya-br-proxy

    Official

    A skill your agent uses when the user asks how code works, wants to understand architecture, trace execution flows, or explore unfamiliar parts of the codebase.

    106 GitHub starsUsed in 12 repos~749 tokens
    Backend & APIsAuto-check passed
  • Supabase

    curvenote/curvenote

    A skill your agent uses when doing ANY task involving Supabase.

    170 GitHub starsUsed in 5 repos~2.2k tokens
    Backend & APIsAuto-check passed
  • Gemini Live API Dev

    google-gemini/gemini-skills

    Official

    A skill your agent uses when building real-time, bidirectional streaming applications with the Gemini Live API, or migrating legacy Live models (2.0/2.5/3.1) to Gemini 3.8 Live.

    4.3k GitHub stars~4.6k tokensUpdated 4 days ago
    Backend & APIsAuto-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

Categories

Questions about Klingai Install Auth

What does Klingai Install Auth do?

Set up Kling AI API authentication with JWT tokens. An agent skill from jeremylongshore/tons-of-skills-marketplace. Klingai Install Auth is an agent skill from jeremylongshore/tons-of-skills-marketplace. Set up Kling AI API authentication with JWT tokens.

When should I use Klingai Install Auth?

Klingai Install Auth fits situations like: starting a new Kling AI integration; troubleshooting auth issues; with phrases like kling ai setup; klingai api key.

How do I install Klingai Install Auth in Claude Code?

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

How do I install Klingai Install Auth in Codex?

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

Can I use Klingai Install Auth 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-install-auth -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-install-auth, .gemini/skills/klingai-install-auth, .github/skills/klingai-install-auth and .opencode/skills/klingai-install-auth in your project.

What does Klingai Install Auth need to run?

Going by SKILL.md and its folder, Klingai Install Auth needs credentials named KLING_ACCESS_KEY and KLING_SECRET_KEY. Our summary lists: Python 3; Node.js; A credential in KLING_ACCESS_KEY; A credential in KLING_SECRET_KEY. Its frontmatter pre-approves these tools: Read, Write, Edit, Bash(npm:*), Grep. Compatibility (from SKILL.md): Designed for Claude Code.

Does Klingai Install Auth access the network?

SKILL.md names 2 domains. In commands or code: api.klingai.com; the agent is likely to contact it when it follows the instructions. As links in the text: klingai.com. This is read from the text; nothing was executed.

Is Klingai Install Auth safe to install?

Our automated static check of SKILL.md found notes only (mentions a .env file), nothing it rates as a warning. It is not a guarantee. Review the folder before installing.

What licence does Klingai Install Auth use?

Klingai Install Auth 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 Install Auth use?

About 1.5k tokens (SKILL.md is roughly 5.9k 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 749 tokens, read only when the agent opens those files.

What are the alternatives to Klingai Install Auth?

Skills that share tags, products or a category with Klingai Install Auth: Fortify Development (coollabsio/coolify, 63k stars), Supabase Development and Debugging (supabase/agent-skills, 2.7k stars), Better Auth Best Practices (latitude-dev/latitude-llm, 4.7k stars) and Gitnexus Exploring (aws-samples/sample-kolya-br-proxy, 106 stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Klingai Install Auth?

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.