Agent skill

Klingai Batch Processing

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

Process multiple video generation requests efficiently with Kling AI.

MITAuto-check passedMedia & Creative

Install Klingai Batch Processing

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

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

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

At a glance

Process multiple video generation requests efficiently with Kling AI.

  • Works in 5 steps: Validate the manifest before any… → Run one synthetic canary with the… → Submit only the approved count with… → …
  • Generating batches of videos
  • SKILL.md covers Overview, Batch Submission with Rate…, Collect Results and Async Batch with asyncio, plus 8 more sections
  • Reaches api.klingai.com; needs KLING_ACCESS_KEY and KLING_SECRET_KEY

What it does

Klingai Batch Processing is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process multiple video generation requests efficiently with Kling AI. Use when generating batches of videos or building content pipelines. Trigger with phrases like 'klingai batch', 'kling ai bulk', 'multiple videos klingai', 'klingai parallel generation'.

Its SKILL.md is about 2.4k tokens, which your agent loads only when the skill is triggered. The skill folder holds 6 other files, including reference files (for example `references/batch-processor-class.md`, `references/batch-with-retry-logic.md` and `references/csv-batch-input.md`). Compatibility notes: Designed for Claude Code

It sits in Media & Creative, covering AI video generation and Data pipelines and ETL. 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

  • Generating batches of videos
  • Building content pipelines
  • With phrases like klingai batch
  • Multiple videos klingai

Example prompts

  • “klingai batch”
  • “kling ai bulk”
  • “multiple videos klingai”
  • “/klingai-batch-processing”

Requirements

  • Python 3
  • 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

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

  1. Validate the manifest before any request: reject missing rights/consent, disallowed content, unapproved destinations, duplicate batch IDs…
  2. Run one synthetic canary with the lowest-cost permitted mode. Confirm the model, duration, aspect ratio, callback destination…
  3. Submit only the approved count with bounded concurrency and pacing. Record opaque task IDs and an idempotency key; never log prompts…
  4. Poll or receive callbacks with a timeout and a retry budget. Hold successful outputs in quarantine until an owner reviews content policy…
  5. Promote approved outputs to the allowlisted destination, then expire temporary artifacts and access. Keep only a redacted receipt and the…

What it can do on your machine

Read from SKILL.md and the folder at commit 80f86df. 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

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

    • api.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 Batch Processing loads about 2.4k tokens when it runs, and up to ~4.9k if it reads all its reference files. Until then it costs about 70 tokens; SKILL.md has 435 words of instructions outside code blocks.

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

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 80f86df, republished under its MIT licence (© jeremylongshore). 435 words, ~2,399 tokens.

Download SKILL.mdSave it as .claude/skills/klingai-batch-processing/SKILL.md (or your agent's skills folder). This skill also uses 5 other files; get the full folder from GitHub.
name
klingai-batch-processing
description
Process multiple video generation requests efficiently with Kling AI. Use when generating batches of videos or building content pipelines. Trigger with phrases like 'klingai batch', 'kling ai bulk', 'multiple videos klingai', 'klingai parallel generation'.
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, batch, pipelines

Kling AI Batch Processing

Overview

Generate multiple videos efficiently using controlled parallelism, rate-limit-aware submission, progress tracking, and result collection. All requests go through https://api.klingai.com/v1.

Batch Submission with Rate Limiting

python
import 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"}

def submit_batch(prompts, model="kling-v2-master", duration="5",
                 mode="standard", max_concurrent=3, delay=2.0):
    """Submit batch with controlled concurrency and pacing."""
    tasks = []
    active = []

    for i, prompt in enumerate(prompts):
        # Wait if at concurrency limit
        while len(active) >= max_concurrent:
            active = [t for t in active if not check_complete(t["task_id"])]
            if len(active) >= max_concurrent:
                time.sleep(5)

        response = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={
            "model_name": model,
            "prompt": prompt,
            "duration": duration,
            "mode": mode,
        })
        data = response.json()["data"]
        task = {"task_id": data["task_id"], "prompt": prompt, "index": i}
        tasks.append(task)
        active.append(task)
        print(f"[{i+1}/{len(prompts)}] Submitted: {data['task_id']}")
        time.sleep(delay)  # pace requests

    return tasks

def check_complete(task_id):
    r = requests.get(f"{BASE}/videos/text2video/{task_id}", headers=get_headers()).json()
    return r["data"]["task_status"] in ("succeed", "failed")

Collect Results

python
def collect_results(tasks, timeout=600):
    """Wait for all tasks and collect results."""
    results = {}
    start = time.monotonic()

    while len(results) < len(tasks) and time.monotonic() - start < timeout:
        for task in tasks:
            if task["task_id"] in results:
                continue
            r = requests.get(
                f"{BASE}/videos/text2video/{task['task_id']}", headers=get_headers()
            ).json()
            status = r["data"]["task_status"]
            if status == "succeed":
                results[task["task_id"]] = {
                    "status": "succeed",
                    "url": r["data"]["task_result"]["videos"][0]["url"],
                    "prompt": task["prompt"],
                }
            elif status == "failed":
                results[task["task_id"]] = {
                    "status": "failed",
                    "error": r["data"].get("task_status_msg", "Unknown"),
                    "prompt": task["prompt"],
                }
        if len(results) < len(tasks):
            time.sleep(15)

    return results

Async Batch with asyncio

python
import asyncio
import aiohttp

async def async_batch(prompts, max_concurrent=3):
    """Async batch processing with semaphore-controlled concurrency."""
    semaphore = asyncio.Semaphore(max_concurrent)
    results = {}

    async def generate_one(prompt, index):
        async with semaphore:
            async with aiohttp.ClientSession() as session:
                # Submit
                async with session.post(
                    f"{BASE}/videos/text2video",
                    headers=get_headers(),
                    json={"model_name": "kling-v2-master", "prompt": prompt,
                          "duration": "5", "mode": "standard"},
                ) as resp:
                    data = (await resp.json())["data"]
                    task_id = data["task_id"]

                # Poll
                while True:
                    await asyncio.sleep(10)
                    async with session.get(
                        f"{BASE}/videos/text2video/{task_id}",
                        headers=get_headers(),
                    ) as resp:
                        data = (await resp.json())["data"]
                        if data["task_status"] == "succeed":
                            results[index] = data["task_result"]["videos"][0]["url"]
                            return
                        elif data["task_status"] == "failed":
                            results[index] = f"FAILED: {data.get('task_status_msg')}"
                            return

    await asyncio.gather(*[generate_one(p, i) for i, p in enumerate(prompts)])
    return results

Batch with Callbacks (No Polling)

python
def submit_batch_with_callbacks(prompts, callback_url):
    """Submit batch with webhook callbacks -- no polling needed."""
    tasks = []
    for prompt in prompts:
        r = requests.post(f"{BASE}/videos/text2video", headers=get_headers(), json={
            "model_name": "kling-v2-master",
            "prompt": prompt,
            "duration": "5",
            "mode": "standard",
            "callback_url": callback_url,
        }).json()
        tasks.append(r["data"]["task_id"])
        time.sleep(2)  # rate limit pacing
    return tasks

Cost Estimation Before Batch

python
def estimate_batch_cost(count, duration=5, mode="standard", audio=False):
    credits_map = {(5, "standard"): 10, (5, "professional"): 35,
                   (10, "standard"): 20, (10, "professional"): 70}
    per_video = credits_map.get((duration, mode), 10)
    if audio:
        per_video *= 5
    total = count * per_video
    print(f"Batch: {count} videos x {per_video} credits = {total} credits")
    print(f"Estimated cost: ${total * 0.14:.2f}")
    return total

# Check before submitting
needed = estimate_batch_cost(50, duration=5, mode="standard")

Prerequisites

  • An approved batch manifest with a unique batch ID, a bounded count, model, duration, mode, destination, and credit ceiling.
  • Prompts and reference media must be synthetic or rights-cleared, and the request must pass the provider's content policy review. Do not submit real people's likenesses, private data, or copyrighted material without documented permission.
  • Use a sandbox project and draft/watermarked outputs for the first canary. Store KLING_ACCESS_KEY and KLING_SECRET_KEY in the approved secret manager; never place them in prompts, source control, or logs.

Instructions

  1. Validate the manifest before any request: reject missing rights/consent, disallowed content, unapproved destinations, duplicate batch IDs, and a projected credit total above the approved ceiling.
  2. Run one synthetic canary with the lowest-cost permitted mode. Confirm the model, duration, aspect ratio, callback destination, watermark/draft status, and contacts_exported=0-style no-export invariant before expanding the batch.
  3. Submit only the approved count with bounded concurrency and pacing. Record opaque task IDs and an idempotency key; never log prompts, source media, callback secrets, or result URLs.
  4. Poll or receive callbacks with a timeout and a retry budget. Hold successful outputs in quarantine until an owner reviews content policy, rights, quality, and cost results.
  5. Promote approved outputs to the allowlisted destination, then expire temporary artifacts and access. Keep only a redacted receipt and the rollback reference.
Show full SKILL.md (174 more words)Show less

Output

Return a batch receipt containing the opaque batch ID, model/mode/duration, requested and completed counts, success/failure counts, credit estimate and actual, canary result, policy/rights review state, destination class, retention deadline, and rollback/removal action. The receipt must exclude prompts, media, personal data, credentials, and signed URLs.

Error Handling

  • Retry only bounded transient transport or rate-limit failures with exponential backoff; do not retry policy refusals, rights failures, authentication failures, or invalid parameters.
  • If the credit ceiling, concurrency limit, policy probe, or destination allowlist check fails, stop new submissions and mark the batch paused. Reconcile unknown task states before deciding whether to retry.
  • On a failed canary or review, cancel pending tasks where supported, remove quarantined outputs, revoke temporary callback access, and record the redacted removal receipt. Restore the last approved batch configuration rather than silently changing scope.

Examples

For a safe dry run, use batch_id=synthetic-launch-01, 3 synthetic prompts, model=kling-v2-5-turbo, duration=5, mode=standard, destination=sandbox-review, watermark=draft, credits_max=30, and contacts_exported=0. Promote only after the owner records policy=pass, rights=pass, and approval=granted; otherwise remove the canary outputs.

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 5 other files (references) in skills/.curated/klingai-batch-processing of jeremylongshore/tons-of-skills-marketplace.

  • SKILL.md
  • references/batch-processor-class.md
  • references/batch-with-retry-logic.md
  • references/csv-batch-input.md
  • references/errors.md
  • references/examples.md

Open the folder on GitHubat commit 80f86df

Compare with similar skills

Klingai Batch Processing 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 Batch Processing compared with similar skills
SkillStarsUsed inTokensAuto-checkLicenceRepo updated
Klingai Batch Processing this skilljeremylongshore/tons-of-skills-marketplace2.8k—~2.4kAutomated 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/hyperframes59k3 repos~5.2kAutomated safety check: PassApache-2.0
Lanshu Create AI Presenter Videocclank/lanshu-create-ai-presenter-video2.6k—~3.6kAutomated safety check: PassMIT

Similar skills

  • 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 yesterday
    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.

    59k 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 3 days ago
    Media & CreativeAuto-check passed
  • Video Shots

    eternityspring/reelbench-skills

    拉片:把一条成片拆成逐镜头的分析表——每个镜头的时长、景别、类别、运镜、画面. An agent skill from eternityspring/reelbench-skills.

    872 GitHub starsUsed in 1 repo~1.8k tokens
    Media & CreativeAuto-check: notes

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 Batch Processing

What does Klingai Batch Processing do?

Process multiple video generation requests efficiently with Kling AI. Klingai Batch Processing is an agent skill from jeremylongshore/tons-of-skills-marketplace. Process multiple video generation requests efficiently with Kling AI.

When should I use Klingai Batch Processing?

Klingai Batch Processing fits situations like: generating batches of videos; building content pipelines; with phrases like klingai batch; multiple videos klingai.

How do I install Klingai Batch Processing in Claude Code?

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

How do I install Klingai Batch Processing in Codex?

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

Can I use Klingai Batch Processing 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-batch-processing -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-batch-processing, .gemini/skills/klingai-batch-processing, .github/skills/klingai-batch-processing and .opencode/skills/klingai-batch-processing in your project.

What does Klingai Batch Processing need to run?

Going by SKILL.md and its folder, Klingai Batch Processing needs credentials named KLING_ACCESS_KEY and KLING_SECRET_KEY. Our summary lists: Python 3; 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 Batch Processing access the network?

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

Is Klingai Batch Processing 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 Batch Processing use?

Klingai Batch Processing 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 Batch Processing use?

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

What are the alternatives to Klingai Batch Processing?

Skills that share tags, products or a category with Klingai Batch Processing: Video Generation (bytedance/deer-flow, 84k stars), Video Cover Image (itwanger/toBeBetterJavaer, 18k stars), Seedance (songguoxs/seedance-prompt-skill, 2.9k stars) and HyperFrames Video Entry Point (heygen-com/hyperframes, 59k stars). The comparison table on this page puts their stars, adoption, token cost, safety result and licence side by side.

Who maintains Klingai Batch Processing?

jeremylongshore (a GitHub user) maintains it in jeremylongshore/tons-of-skills-marketplace, which has 2,825 GitHub stars. The repository holds 3,342 skills in this directory. The repository was last updated on October 9, 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.