klingai-team-setup
Configure Kling AI for teams with per-project API keys, usage quotas, and role-based access. Trigger with phrases like 'klingai team', 'kling ai organization', 'klingai multi-user', 'shared klingai access'.
What this skill does
# Kling AI Team Setup
## Overview
Manage team access to the Kling AI API using separate API keys, environment-based routing, usage quotas per team member, and centralized credential management.
## Per-Environment API Keys
Create separate API key pairs in the [Kling AI developer console](https://app.klingai.com/global/dev/api-key) for each environment:
| Environment | Key Naming Convention | Purpose |
|------------|----------------------|---------|
| Development | `dev-<project>` | Local testing, free tier |
| Staging | `staging-<project>` | Integration testing |
| Production | `prod-<project>` | Live traffic |
```bash
# .env.development
KLING_ACCESS_KEY="ak_dev_..."
KLING_SECRET_KEY="sk_dev_..."
# .env.production
KLING_ACCESS_KEY="ak_prod_..."
KLING_SECRET_KEY="sk_prod_..."
```
## Team Configuration
```python
from dataclasses import dataclass
from typing import Optional
@dataclass
class TeamMember:
name: str
email: str
role: str # admin, editor, viewer
daily_credit_limit: int
allowed_models: list[str]
@dataclass
class TeamConfig:
name: str
members: list[TeamMember]
total_daily_limit: int = 1000
default_model: str = "kling-v2-master"
default_mode: str = "standard"
def get_member(self, email: str) -> Optional[TeamMember]:
return next((m for m in self.members if m.email == email), None)
# Example team configuration
team = TeamConfig(
name="marketing",
total_daily_limit=5000,
members=[
TeamMember("Alice", "[email protected]", "admin", 2000,
["kling-v2-6", "kling-v2-master", "kling-v2-5-turbo"]),
TeamMember("Bob", "[email protected]", "editor", 500,
["kling-v2-master", "kling-v2-5-turbo"]),
TeamMember("Carol", "[email protected]", "viewer", 100,
["kling-v2-5-turbo"]),
],
)
```
## Usage Quotas Per Member
```python
import time
from collections import defaultdict
class TeamQuotaManager:
"""Enforce per-member and team-wide credit limits."""
def __init__(self, config: TeamConfig):
self.config = config
self._usage = defaultdict(int) # email -> credits used today
self._reset_time = time.time()
def _check_reset(self):
if time.time() - self._reset_time > 86400:
self._usage.clear()
self._reset_time = time.time()
def authorize(self, email: str, credits_needed: int, model: str) -> bool:
self._check_reset()
member = self.config.get_member(email)
if not member:
raise PermissionError(f"Unknown user: {email}")
if model not in member.allowed_models:
raise PermissionError(f"{email} not authorized for {model}")
if self._usage[email] + credits_needed > member.daily_credit_limit:
raise RuntimeError(f"{email} exceeds daily limit "
f"({self._usage[email]} + {credits_needed} > {member.daily_credit_limit})")
team_total = sum(self._usage.values()) + credits_needed
if team_total > self.config.total_daily_limit:
raise RuntimeError(f"Team daily limit exceeded ({team_total} > {self.config.total_daily_limit})")
return True
def record_usage(self, email: str, credits: int):
self._usage[email] += credits
def usage_report(self) -> dict:
return {
"team_total": sum(self._usage.values()),
"team_limit": self.config.total_daily_limit,
"by_member": dict(self._usage),
}
```
## Secrets Management
| Tool | How to Store AK/SK |
|------|-------------------|
| AWS Secrets Manager | `aws secretsmanager create-secret --name kling/prod` |
| GCP Secret Manager | `gcloud secrets create kling-prod` |
| HashiCorp Vault | `vault kv put secret/kling ak=... sk=...` |
| 1Password CLI | `op item create --category login --title "Kling API"` |
```python
# Load from AWS Secrets Manager
import boto3
import json
def get_kling_credentials(secret_name="kling/prod"):
client = boto3.client("secretsmanager")
secret = client.get_secret_value(SecretId=secret_name)
creds = json.loads(secret["SecretString"])
return creds["access_key"], creds["secret_key"]
```
## Access Control Wrapper
```python
class TeamKlingClient:
"""Kling client with team-level access control."""
def __init__(self, base_client, quota_manager: TeamQuotaManager):
self.client = base_client
self.quotas = quota_manager
def text_to_video(self, email: str, prompt: str, **kwargs):
model = kwargs.get("model", "kling-v2-master")
credits = 10 if kwargs.get("mode") != "professional" else 35
self.quotas.authorize(email, credits, model)
result = self.client.text_to_video(prompt, **kwargs)
self.quotas.record_usage(email, credits)
return result
```
## Resources
- [API Key Management](https://app.klingai.com/global/dev/api-key)
- [Developer Portal](https://app.klingai.com/global/dev)
Related in Image & Video
watch
IncludedWatch a video (URL or local path). Downloads with yt-dlp, extracts auto-scaled frames with ffmpeg, pulls the transcript from captions (or Whisper API fallback), and hands the result to Claude so it can answer questions about what's in the video.
physical-ai-defect-image-generation
IncludedUse when the user wants to orchestrate defect image generation, run associated setup, or handle outputs on OSMO. The Day 0 path handles cold-start with USD-to-ROI, image-edit augmentation, and AnomalyGen to create initial PCBA datasets. The Day 1 path performs inference and labeling on real images. This skill helps with first-time asset setup, creation of finetuning checkpoints, and configuring deployment. Trigger keywords: defect image generation, dig workflow, dig pipeline, defect image detection workflow, aoi pipeline, aoi anomalygen, usd2roi anomalygen, day 0 pcba, day 1 pcba, day 1 real-photo alignment, day 1 manual roi, metal surface anomaly, glass defect, anomalygen finetune, setup_pcb, setup_metal, setup_glass, setup_pretrained, dig setup, dig datasets, dig pretrained checkpoint, dig image-edit endpoint.
accelint-react-best-practices
IncludedReact performance optimization and best practices. ALWAYS use this skill when working with any React code - writing components, hooks, JSX; refactoring; optimizing re-renders, memoization, state management; reviewing for performance; fixing hydration mismatches; debugging infinite re-renders, stale closures, input focus loss, animations restarting; preventing remounting; implementing transitions, lazy initialization, effect dependencies. Even simple React tasks benefit from these patterns. Covers React 19+ (useEffectEvent, Activity, ref props). Triggers - useEffect, useState, useMemo, useCallback, memo, inline components, nested components, components inside components, re-render, performance, hydration, SSR, Next.js, useDeferredValue, combined hooks.
elevenlabs-agents
IncludedBuild conversational AI voice agents with ElevenLabs Platform using React, JavaScript, React Native, or Swift SDKs. Configure agents, tools (client/server/MCP), RAG knowledge bases, multi-voice, and Scribe real-time STT. Use when: building voice chat interfaces, implementing AI phone agents with Twilio, configuring agent workflows or tools, adding RAG knowledge bases, testing with CLI "agents as code", or troubleshooting deprecated @11labs packages, Android audio cutoff, CSP violations, dynamic variables, or WebRTC config. Keywords: ElevenLabs Agents, ElevenLabs voice agents, AI voice agents, conversational AI, @elevenlabs/react, @elevenlabs/client, @elevenlabs/react-native, @elevenlabs/elevenlabs-js, @elevenlabs/agents-cli, elevenlabs SDK, voice AI, TTS, text-to-speech, ASR, speech recognition, turn-taking model, WebRTC voice, WebSocket voice, ElevenLabs conversation, agent system prompt, agent tools, agent knowledge base, RAG voice agents, multi-voice agents, pronunciation dictionary, voice speed control, elevenlabs scribe, @11labs deprecated, Android audio cutoff, CSP violation elevenlabs, dynamic variables elevenlabs, case-sensitive tool names, webhook authentication
humanizer
IncludedHumanize AI-generated text by detecting and removing patterns typical of LLM output. Rewrites text to sound natural, specific, and human. Uses 28 pattern detectors, 560+ AI vocabulary terms across 3 tiers, and statistical analysis (burstiness, type-token ratio, readability) for comprehensive detection. Use when asked to humanize text, de-AI writing, make content sound more natural/human, review writing for AI patterns, score text for AI detection, or improve AI-generated drafts. Covers content, language, style, communication, and filler categories.
generating-mermaid-diagrams
IncludedSalesforce architecture diagrams using Mermaid with ASCII fallback. Use this skill when generating text-based diagrams for Salesforce architecture, OAuth flows, ERDs, integration sequences, or Agentforce structure. TRIGGER when: user says "diagram", "visualize", "ERD", or asks for sequence diagrams, flowcharts, class diagrams, or architecture visualizations in Mermaid. DO NOT TRIGGER when: user wants PNG/SVG image output (use generating-visual-diagrams), or asks about non-Salesforce systems.