{"id":"478ac647-c393-4a81-aa57-9a64c8ff2436","entityType":"agent","slug":"clawhub-klingai-dev-klingai","name":"Kling AI","canonicalUrl":"https://www.xpersona.co/agent/clawhub-klingai-dev-klingai","canonicalPath":"/agent/clawhub-klingai-dev-klingai","generatedAt":"2026-10-09T17:49:47.411Z","source":"CLAWHUB","claimStatus":"UNCLAIMED","verificationTier":"NONE","summary":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":null},"description":"Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生","descriptionLabel":"Source description","evidenceSummary":"Capability contract not published. No trust telemetry is available yet. 4.9K downloads reported by the source. Last updated 10/9/2026.","installCommand":"clawhub skill install s171hj9jje7gzmg9v3nvpjweph83hj68:klingai","sourceUrl":"https://clawhub.ai/klingai-dev/klingai","homepage":"https://clawhub.ai/klingai-dev/skills/klingai","primaryLinks":[{"label":"View on ClawHub","url":"https://clawhub.ai/klingai-dev/klingai","kind":"source"},{"label":"Homepage","url":"https://clawhub.ai/klingai-dev/skills/klingai","kind":"homepage"}],"safetyScore":84,"overallRank":62,"popularityScore":59,"trustScore":null,"claimedByName":null,"isOwner":false,"seoDescription":"Kling AI technical dossier on Xpersona with agent coverage, OPENCLEW support, and live trust metadata."},"coverage":{"evidence":{"source":"public-profile","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":null},"protocols":[{"protocol":"OPENCLEW","label":"OpenClaw","status":"self-declared","notes":"Declared in the public agent profile."}],"capabilities":[],"verifiedCount":0,"selfDeclaredCount":1,"capabilityMatrix":{"rows":[{"key":"OPENCLEW","type":"protocol","support":"unknown","confidenceSource":"profile","notes":"Listed on profile"}],"flattenedTokens":"protocol:OPENCLEW|unknown|profile"}},"adoption":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":null},"stars":null,"forks":null,"downloads":4893,"packageName":null,"latestVersion":"2.0.0","tractionLabel":"4.9K downloads"},"release":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:37:23.517Z","emptyReason":null},"lastUpdatedAt":"2026-10-09T04:37:23.518Z","lastCrawledAt":"2026-10-09T04:37:23.517Z","lastIndexedAt":null,"nextCrawlAt":"2026-10-10T04:37:23.517Z","lastVerifiedAt":null,"highlights":[{"version":"2.0.0","createdAt":"2026-09-23T12:10:53.034Z","changelog":"Kling AI Skill 2.0.0 introduces support for the new official API and updates authentication. - Updated API authentication: now uses KLING_API_KEY (Bearer token) only; legacy KLING_TOKEN and AK/SK are no longer supported. - Revised canonical model names and routing: model lists and alias handling are changed to match the new API requirements. - Changed credential flows: device bind and import now write/read API Key, and never JWT/AK/SK. - Documentation updated throughout for new flags, stricter preflight checks, and clearer error/retry/reporting flows. - Removed legacy credential handling and references to outdated parameters. - Removed the skill-card.md file.","fileCount":14,"zipByteSize":51425},{"version":"1.1.0","createdAt":"2026-04-09T14:24:56.609Z","changelog":"klingai 1.1.0 - Changed account credential binding to use only url and removed unsafe browser ops. - Minor meta changes.","fileCount":14,"zipByteSize":47139},{"version":"1.0.9","createdAt":"2026-04-09T14:14:32.029Z","changelog":"- Changed account credential binding to use only url and removed unsafe browser ops.","fileCount":13,"zipByteSize":45866},{"version":"1.0.8","createdAt":"2026-04-09T05:18:48.082Z","changelog":"klingai 1.0.8 - Added more trigger keywords and clarified keyword mapping for subcommand routing and forced skill usage. - Improved prerequisites and user guidance for troubleshooting and credential binding.","fileCount":13,"zipByteSize":46633},{"version":"1.0.7","createdAt":"2026-04-09T04:55:18.964Z","changelog":"Kling AI 1.0.7 - Added more trigger keywords and clarified keyword mapping for subcommand routing and forced skill usage. - Improved prerequisites and user guidance for troubleshooting and credential binding.","fileCount":13,"zipByteSize":46953},{"version":"1.0.6","createdAt":"2026-04-02T13:44:22.346Z","changelog":"- Added support for the account subcommand, enabling users to check account quotas, resource packs, and remaining credits. - Updated invocation and routing instructions: now support video, image, element, and account subcommands based on user intent. - Updated documentation for prerequisites, credential selection, and quick start instructions reflecting account management features.","fileCount":13,"zipByteSize":39546},{"version":"1.0.5","createdAt":"2026-03-26T09:01:07.795Z","changelog":"Kling AI Skill 1.0.5 : - Video subcommand now documents and clarifies use of Omni mode with `--video` and `--video_refer_type` (\"feature\" or \"base\") for video referencing and editing. - Added explicit CLI usage examples for editing and referencing videos. - Documentation updated throughout for clearer distinction between feature reference (trait transfer) vs. base reference (video editing). - Minor version bump and enhancements to the description for improved discoverability.","fileCount":12,"zipByteSize":24561},{"version":"1.0.4","createdAt":"2026-03-24T07:48:43.004Z","changelog":"Version 1.0.4 - Added automatic loading of Kling authentication keys from kling.env, .env, or ~/.config/kling/ before requesting user input. - Noted support for loading environment variables from KLING_ENV_FILE. - Added instructions for resolving network/TLS issues with NODE_USE_ENV_PROXY and NODE_TLS_REJECT_UNAUTHORIZED when behind a corporate proxy. - Minor clarifications in prerequisites and authentication handling. - No functional changes to commands or parameters.","fileCount":12,"zipByteSize":24146}]},"execution":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No published capability contract is available yet."},"installCommand":"clawhub skill install s171hj9jje7gzmg9v3nvpjweph83hj68:klingai","setupComplexity":"low","setupSteps":["Install using `clawhub skill install s171hj9jje7gzmg9v3nvpjweph83hj68:klingai` in an isolated environment before connecting it to live workloads.","No published capability contract is available yet, so validate auth and request/response behavior manually.","Review the upstream CLAWHUB listing at https://clawhub.ai/klingai-dev/klingai before using production credentials."],"contract":{"contractStatus":"missing","authModes":[],"requires":[],"forbidden":[],"supportsMcp":false,"supportsA2a":false,"supportsStreaming":false,"inputSchemaRef":null,"outputSchemaRef":null,"dataRegion":null,"contractUpdatedAt":null,"sourceUpdatedAt":null,"freshnessSeconds":null},"invocationGuide":{"preferredApi":{"snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/trust"},"curlExamples":["curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/snapshot\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/contract\"","curl -s \"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/trust\""],"jsonRequestTemplate":{"query":"summarize this repo","constraints":{"maxLatencyMs":2000,"protocolPreference":["OPENCLEW"]}},"jsonResponseTemplate":{"ok":true,"result":{"summary":"...","confidence":0.9},"meta":{"source":"CLAWHUB","generatedAt":"2026-10-09T17:49:47.403Z"}},"retryPolicy":{"maxAttempts":3,"backoffMs":[500,1500,3500],"retryableConditions":["HTTP_429","HTTP_503","NETWORK_TIMEOUT"]}},"endpoints":{"dossierUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/dossier","snapshotUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/snapshot","contractUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/contract","trustUrl":"https://www.xpersona.co/api/v1/agents/clawhub-klingai-dev-klingai/trust"}},"reliability":{"evidence":{"source":"runtime-metrics","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No trust, reliability, or runtime telemetry is available."},"trust":{"status":"unavailable","handshakeStatus":"UNKNOWN","verificationFreshnessHours":null,"reputationScore":null,"p95LatencyMs":null,"successRate30d":null,"fallbackRate":null,"attempts30d":null,"trustUpdatedAt":null,"trustConfidence":"unknown","sourceUpdatedAt":null,"freshnessSeconds":null},"decisionGuardrails":{"doNotUseIf":["Contract metadata is missing or unavailable for deterministic execution."],"safeUseWhen":[],"riskFlags":["missing_or_unavailable_contract","trust_data_unavailable","schema_references_missing"],"operationalConfidence":"low"},"executionMetrics":{"observedLatencyMsP50":null,"observedLatencyMsP95":null,"estimatedCostUsd":null,"uptime30d":null,"rateLimitRpm":null,"rateLimitBurst":null,"lastVerifiedAt":null,"verificationSource":null},"runtimeMetrics":{"successRate":null,"avgLatencyMs":null,"avgCostUsd":null,"hallucinationRate":null,"retryRate":null,"disputeRate":null,"p50Latency":null,"p95Latency":null,"lastUpdated":null}},"benchmarks":{"evidence":{"source":"no-benchmark-data","verified":false,"confidence":"low","updatedAt":null,"emptyReason":"No benchmark suites or observed failure patterns are available."},"suites":[],"failurePatterns":[]},"artifacts":{"evidence":{"source":"CLAWHUB","verified":false,"confidence":"medium","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":null},"readme":"Skill: Kling AI\n\nOwner: klingai-dev\n\nSummary: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生\n\nTags: latest:2.0.0\n\nVersion history:\n\nv2.0.0 | 2026-09-23T12:10:53.034Z | user\n\nKling AI Skill 2.0.0 introduces support for the new official API and updates authentication.\n\n- Updated API authentication: now uses KLING_API_KEY (Bearer token) only; legacy KLING_TOKEN and AK/SK are no longer supported.\n- Revised canonical model names and routing: model lists and alias handling are changed to match the new API requirements.\n- Changed credential flows: device bind and import now write/read API Key, and never JWT/AK/SK.\n- Documentation updated throughout for new flags, stricter preflight checks, and clearer error/retry/reporting flows.\n- Removed legacy credential handling and references to outdated parameters.\n- Removed the skill-card.md file.\n\nv1.1.0 | 2026-04-09T14:24:56.609Z | user\n\nklingai 1.1.0\n- Changed account credential binding to use only url and removed unsafe browser ops.\n- Minor meta changes.\n\nv1.0.9 | 2026-04-09T14:14:32.029Z | user\n\n- Changed account credential binding to use only url and removed unsafe browser ops.\n\nv1.0.8 | 2026-04-09T05:18:48.082Z | user\n\nklingai 1.0.8\n\n- Added more trigger keywords and clarified keyword mapping for subcommand routing and forced skill usage.\n- Improved prerequisites and user guidance for troubleshooting and credential binding.\n\nv1.0.7 | 2026-04-09T04:55:18.964Z | user\n\nKling AI 1.0.7\n\n- Added more trigger keywords and clarified keyword mapping for subcommand routing and forced skill usage.\n- Improved prerequisites and user guidance for troubleshooting and credential binding.\n\nv1.0.6 | 2026-04-02T13:44:22.346Z | user\n\n- Added support for the account subcommand, enabling users to check account quotas, resource packs, and remaining credits.\n- Updated invocation and routing instructions: now support video, image, element, and account subcommands based on user intent.\n- Updated documentation for prerequisites, credential selection, and quick start instructions reflecting account management features.\n\nv1.0.5 | 2026-03-26T09:01:07.795Z | user\n\nKling AI Skill 1.0.5 :\n\n- Video subcommand now documents and clarifies use of Omni mode with `--video` and `--video_refer_type` (\"feature\" or \"base\") for video referencing and editing.\n- Added explicit CLI usage examples for editing and referencing videos.\n- Documentation updated throughout for clearer distinction between feature reference (trait transfer) vs. base reference (video editing).\n- Minor version bump and enhancements to the description for improved discoverability.\n\nv1.0.4 | 2026-03-24T07:48:43.004Z | user\n\nVersion 1.0.4\n\n- Added automatic loading of Kling authentication keys from kling.env, .env, or ~/.config/kling/ before requesting user input.\n- Noted support for loading environment variables from KLING_ENV_FILE.\n- Added instructions for resolving network/TLS issues with NODE_USE_ENV_PROXY and NODE_TLS_REJECT_UNAUTHORIZED when behind a corporate proxy.\n- Minor clarifications in prerequisites and authentication handling.\n- No functional changes to commands or parameters.\n\nv1.0.3 | 2026-03-20T14:53:37.721Z | user\n\nKling AI Skill 1.0.3\n\n- Version updated from 1.0.1 to 1.0.3.\n- Minor internal changes.\n\nv1.0.2 | 2026-03-20T14:07:19.399Z | user\n\nNo file or documentation changes detected for this version.\n\n- Minor internal changes.\n- Version number incremented to 1.0.2.\n\nv1.0.1 | 2026-03-20T12:25:15.731Z | user\n\n**Major update: Klingai skill now supports video, image, and subject/element management with clear intent routing.**\n\n- Added subcommands: video, image, element. The skill now covers video generation, image generation, and subject (element/character) management.\n- You must select the subcommand based on user intent (video, image, or subject tasks). When intent is ambiguous, confirm with the user before submission.\n- Updated scripts: new separate files for element, image, and video features. Unified entry script.\n- Deprecated/removed the previous dedicated video script (`kling_video.mjs`), integrated under the new structure.\n- CLI and documentation are updated to reflect new usage patterns, billing/cost warnings, and stricter confirmation before task submission.\n- Expanded user intent trigger phrases and improved language adaptation for responses.\n\nv1.0.0 | 2026-03-18T16:04:50.911Z | user\n\n- Initial release of the official Kling AI Skill for video generation.\n- Supports text-to-video, image-to-video, Omni (multi-modal: text/image/video/subject), and multi-shot video creation.\n- Automatic selection of the best API endpoint based on input parameters.\n- Bilingual CLI output (English/Chinese); always responds in the user's language.\n- Includes detailed CLI usage, core parameters, and guidance for a variety of video-generation scenarios.\n\nArchive index:\n\nArchive v2.0.0: 14 files, 51425 bytes\n\nFiles: README.md (741b), reference.md (3672b), scripts/account.mjs (10011b), scripts/element.mjs (8641b), scripts/image.mjs (14258b), scripts/kling.mjs (2584b), scripts/shared/args.mjs (7175b), scripts/shared/auth.mjs (15236b), scripts/shared/client.mjs (24493b), scripts/shared/task.mjs (5454b), scripts/video.mjs (28946b), skill-card.md (2923b), SKILL.md (25492b), _meta.json (126b)\n\nFile v2.0.0:SKILL.md\n\n---\nname: klingai\nversion: \"2.0.0\"\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_API_KEY\",\"homepage\":\"https://klingai.com/document-api/\"}}\n---\n\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\n\n# Kling AI\n\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\n\n## Invocation\n\nFrom repository root:\n\n```bash\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\n```\n\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\n\n## Routing priority (OpenClaw)\n\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\n\n## Intent routing (required)\n\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\n\n| User intent | Subcommand |\n| --- | --- |\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\n| Subject / element (create, manage, list, presets, delete) | `element` |\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\n| Credential setup (bind/import) | `account` with `--bind-url` / `--import-env` / `--import-credentials` |\n\nSelection rules:\n- Video-related -> `video`\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\n- Image-only -> `image`\n- Subject CRUD -> `element`\n- Quota/balance/resource packs -> `account` (default `--costs`)\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\n- Create subject first -> `element`\n\nForce skill conditions (any hit -> use this skill):\n- multi-image input (>=2 images)\n- Omni/frame control (`first_frame`/`last_frame`/`image_types`)\n- reference video (`--video` + `feature`/`base`) or video editing\n- subject/element reuse (`--element_ids`)\n- storyboard/multi-shot (`--multi_shot`, 分镜)\n- image series (`--result_type series`/`--series_amount`, 组图)\n- extension parameter gaps or ambiguous/unclear parameter intent\n\nModel name strict rule:\n- Video `--model` canonical names: `kling-3.0`, `kling-3.0-turbo`, `kling-2.6`, `kling-2.5-turbo`, `kling-3.0-omni`, `kling-o1`.\n- Image `--model` canonical names: `kling-v3`, `kling-v2-1`, `kling-v3-omni`, `kling-image-o1`.\n- Do not pass aliases as CLI values.\n- Alias disambiguation: `视频O3` -> `kling-3.0-omni`; `图片O3` -> `kling-v3-omni`; only `o1`/`omni1` map to O1 models by intent.\n\nWhen ambiguous (for example video vs image, or 3.0-omni vs o1), ask user first, then submit.\n\n## Preflight checklist (mandatory before submit)\n\nBefore any billable submit, pass all checks below. If any check fails, stop and ask user or run `--help`.\n\n1. Subcommand is confirmed: `video` / `image` / `element` / `account`.\n2. Route is confirmed by flags: basic vs Omni (from **Route & model**).\n3. `--model` is canonical (no alias values like `o3`, `omni3`).\n4. All params come from this SKILL.md or subcommand `--help`; no undocumented flags.\n5. No conflicting combinations (for example `--video_refer_type base` + first/last frame, `--video` feature + `--audio native`/`original`, `--audio original` without `--video`).\n6. Query mode and submit mode are not mixed.\n\n## Anti-fabrication policy (no guessing)\n\n- Do not invent model names, enums, ranges, defaults, request fields, or hidden flags.\n- Do not infer unsupported values from older/other skills.\n- If value is uncertain, verify with `node {baseDir}/scripts/kling.mjs <subcommand> --help`.\n- If user intent is uncertain, ask first; do not submit trial jobs.\n- If user uses alias words, map to canonical names and pass canonical only.\n\n## Cost and submission rules\n\n- Every submit is charged; do not submit speculatively.\n- Confirm intent first when unclear.\n- On timeout/failure/unexpected result, ask user whether to wait or retry.\n- Do not auto-resubmit or silently change intent/parameters.\n\n## Agent loop & results\n\n- Entry: only `node {baseDir}/scripts/kling.mjs` with `video`/`image`/`element`/`account`.\n- Default flow: submit -> poll (~10s interval) -> download to `--output_dir`.\n- Keep user updated on long runs (video: `submitted -> processing -> succeeded/failed`; image/element: `succeed/failed`).\n- `--no-wait` flow (video/image): submit -> get task id -> query by same subcommand `--task_id <id>` -> add `--download` when succeeded.\n- Query mode strictness: when using `--task_id`, do not mix submit-only flags (`--prompt`, `--multi_shot`, `--image`, `--element_ids`, `--video`).\n- Never print secrets (`KLING_API_KEY`, `api_key`).\n\nPresenting results:\n- Always return task id + local path(s).\n- If stdout includes an URL, include markdown link as fallback.\n\n## Prerequisites\n\n- Runtime: Node.js 18+, no extra packages.\n- Credential priority: `KLING_API_KEY` (session Bearer as-is) -> stored `api_key` in `.credentials` (same Bearer; **no JWT**). `KLING_TOKEN` is not recognized.\n- Official business APIs: `Authorization: Bearer <apiKey>`. Device bind is unchanged Device Flow; `POST /auth/skill/exchange` `ISSUED` returns `credential.apiKey`. See [接口鉴权](https://klingai.com/document-api/api/get-started/authentication.md).\n- `KLING_API_KEY` is never read from env files. `--import-env` copies the process env value into credentials. `--bind-url` / `--import-credentials` / `--configure` write credentials, not the env var.\n- Permission/auth errors: report the API `message`. Rebind only after user confirmation when the stored API Key itself is invalid. Legacy AK/SK files are ignored — ask the user to rebind.\n- Storage root: default `~/.config/kling`, optional `KLING_STORAGE_ROOT`.\n- No `KLING_API_KEY` and no stored `api_key`: CLI auto-starts bind flow (writes API Key).\n- `account --bind-url`: init -> print URL (manual open) -> poll exchange -> persist `api_key`.\n- Bind/auth failures: do not silently switch API base or rewrite network params.\n- Forced rebind (requires user confirmation):\n  - `node {baseDir}/scripts/kling.mjs account --bind-url --force`\n- Manual import fallback:\n  - `node {baseDir}/scripts/kling.mjs account --import-env`\n  - `node {baseDir}/scripts/kling.mjs account --import-credentials --api_key \"<API_KEY>\"`\n  - `node {baseDir}/scripts/kling.mjs account --configure`\n- Mask secret values in user-facing text.\n- Optional behavior (API base, media roots): check subcommand `--help`.\n\n## Quick start\n\n```bash\n# Show help\nnode {baseDir}/scripts/kling.mjs --help\n\n# Video\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\nnode {baseDir}/scripts/kling.mjs video --multi_shot true --prompt \"镜头 1, 5, Sunrise over the hills; 镜头 2, 5, Conflict in the valley;\"\nnode {baseDir}/scripts/kling.mjs video --prompt \"A story in three beats: arrival, conflict, resolution\"\n\n# Image\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\nnode {baseDir}/scripts/kling.mjs image --model kling-image-o1 --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\nnode {baseDir}/scripts/kling.mjs image --prompt \"Character on the beach\" --element_ids 123456\n\n# Subject / element\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg --refer_images ./side.jpg\nnode {baseDir}/scripts/kling.mjs element --action list\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\n\n# Account\nnode {baseDir}/scripts/kling.mjs account --help\nnode {baseDir}/scripts/kling.mjs account\nnode {baseDir}/scripts/kling.mjs account --days 90\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\nnode {baseDir}/scripts/kling.mjs account --bind-url\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\nnode {baseDir}/scripts/kling.mjs account --import-env\nnode {baseDir}/scripts/kling.mjs account --import-credentials --api_key \"<API_KEY>\"\nnode {baseDir}/scripts/kling.mjs account --configure\n\n# Query existing task\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\n```\n\n## Core parameters by subcommand\n\nDo not invent values/ranges/enums/defaults. If unsure, check:\n`node {baseDir}/scripts/kling.mjs <subcommand> --help`\n\n### video (video generation)\n\nOfficial docs: [文生视频 3.0](https://klingai.com/document-api/api/video/3-0-omni/text-to-video.md), [图生视频 3.0](https://klingai.com/document-api/api/video/3-0-omni/image-to-video.md), [Omni 视频](https://klingai.com/document-api/api/video/3-0-omni/video-omni.md), [能力地图](https://klingai.com/document-api/guides/capability-map/video.md).\n\n| Parameter | Description | Default |\n| --- | --- | --- |\n| `--prompt` | T2V/Omni required. Multi-shot format: `镜头 n, m, words;` (half-width separators; n=index 1–6, m=shot seconds ≥1 summing to `--duration`, words ≤512). Omni refs: `@image_1` `@element_1` `@video_1`. | — |\n| `--image` | Basic i2v: single first-frame image. Omni: comma-separated list. With `--aspect_ratio`, route to Omni. | — |\n| `--image_types` | Omni only. Per-image type aligned with `--image`: `first_frame` / `last_frame` / `refer_image` / empty (`refer_image`). Do not combine `last_frame` with `--image_tail`. | — |\n| `--duration` | Seconds. `kling-3.0` / `kling-3.0-turbo` / `kling-3.0-omni`: 3–15. `kling-o1`: 3–10. `kling-2.6` / `kling-2.5-turbo`: `5` or `10`. | 5 |\n| `--model` | Path model; see **Route & model**. | route default |\n| `--resolution` | `720p` / `1080p` / `4k`. `4k` only on `kling-3.0` and `kling-3.0-omni`. | official `720p` if omitted |\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1`. T2V; Omni when no first_frame and not base video edit. Feature video without first_frame: default `16:9`. Do not pass with first_frame or `--video_refer_type base`. I2V has no this field (with `--image` it routes to Omni). | 16:9 when sent |\n| `--audio` | `native` / `off` / `original`. 3.0 T2V/I2V and 2.6: `native\\|off`. Omni 3.0: `native\\|original\\|off`. O1: `original\\|off`. Turbo/2.5: not sent. `original` requires `--video` (keep source audio). Feature video: `off` only. Base video: not `native`. 2.6 native requires `1080p`. | official `off` if omitted |\n| `--image_tail` | Last-frame image (`contents[].type=last_frame`). Requires `--image`. Do not combine with `--image_types last_frame`. Turbo I2V does not support last_frame. | — |\n| `--element_ids` | Subject IDs (comma-separated). Single `--image` + `kling-3.0` I2V: `contents` `type=element` (max 3). Otherwise Omni. | — |\n| `--video` | Omni reference clip: public http(s) URL only. | — |\n| `--video_refer_type` | `feature` → `feature_video` / `base` → `base_video`. | base |\n| `--multi_shot` | `true` / `false`. Request field only on `kling-3.0` and `kling-3.0-omni` (`settings.multi_shot`). Turbo: write `镜头 n, m, words;` in `--prompt`; do not pass `--multi_shot`. `false` disables 镜头-format prompts. Base video edit: if omitted, CLI sends `false` (server default `true` would fail). | official `true` if omitted (3.0 / 3.0-omni), except base edit → `false` |\n| `--output_dir` | Output directory. | `./output` |\n| `--task_id` | Query via `GET /tasks?task_ids=`; pair with `--download`. | — |\n\nDo not pass: `--mode`, `--sound`, `--shot_type`, `--multi_prompt`, `--keep_original_sound`, `--negative_prompt`.\n\nModel alias reminder (do not pass aliases to `--model`):\n- `omni3`/`omni v3`/`o3`/`video o3`/`视频O3` -> `kling-3.0-omni`\n- `o1`/`omni1` -> `kling-o1` (video) or `kling-image-o1` (image)\n\nOmni `contents` image rules:\n- `url` cannot be empty (URL or Base64).\n- Types: `first_frame` / `last_frame` / `refer_image`. Last-frame requires first-frame. No last-frame-only. `kling-3.0-omni` and `kling-o1` both support last_frame (o1 has extra limits below).\n- `--image_tail` requires `--image`. Do not pass `--image_tail` together with `--image_types last_frame`.\n- With `--video`: max 4 images. Without `--video`: max 7.\n- `kling-o1`: when image count > 2, no `last_frame`. First+last: no extra `refer_image`.\n- Frame generation cannot combine with `--video_refer_type base`.\n- `kling-o1` + `feature_video`: first_frame only, no last_frame.\n- `kling-o1` first_frame only (no `refer_image`, no `--video`): `--duration` only `5` or `10`.\n\nOmni `contents` element rules:\n- `element_id` cannot be empty; `id` is `element_1`…\n- Frame generation supports up to 3 subjects.\n- First+last frame with `kling-o1`: subjects unsupported.\n- With `--video`: `image_count + element_count <= 4`; otherwise `<= 7`.\n\nOmni `contents` video rules:\n- Max one URL.\n- `--video_refer_type`: `feature` / `base` (default `base`).\n- `feature_video`: `--audio` must be `off`; do not set `--multi_shot false`; no first_frame → send `aspect_ratio` (default `16:9`).\n- `base_video`: no first/last frame; no `--multi_shot true`; if `--multi_shot` omitted, CLI sends `false`; `--audio` cannot be `native`; do not send `aspect_ratio`.\n- `--audio original` requires `--video` (keep source audio). Feature cannot use `original`.\n\nCompact examples:\n\n```bash\n# explicit frame marking by intent\nnode {baseDir}/scripts/kling.mjs video --model kling-3.0-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,refer_image,last_frame --prompt \"...\"\n\n# with reference video: image count <= 4\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --audio off --image a.jpg,b.jpg --prompt \"...\"\n```\n\n### image (image generation)\n\n| Parameter | Description | Default |\n| --- | --- | --- |\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\n| `--prompt` | Image prompt (required). Omni: `<<<image_1>>>` / `<<<element_1>>>`. | — |\n| `--image` | Basic: single image. Omni: image list (comma-separated). | — |\n| `--resolution` | `1k` / `2k` / `4k`; `4k` routes to Omni. | 1k |\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1` / `auto` (`auto` Omni only, and only with `--image`). | basic: `16:9`; Omni t2i: `16:9`; Omni with `--image`: `auto` |\n| `--n` | Result count 1–9 (`result_type=single`). | 1 |\n| `--negative_prompt` | Basic API only. | — |\n| `--result_type` | `single` / `series` (`series` is Omni and i2i-only). | single |\n| `--series_amount` | 2–9 or `auto` for `result_type=series`. `auto` = 智能选择数量. | 4 |\n| `--element_ids` | Subject IDs (comma-separated). `kling-v3` generations: `element_list`. Omni: `element_list`. `kling-v2-1` unsupported. | — |\n| `--output_dir` | Output directory. | `./output` |\n| `--task_id` | Query task id; pair with `--download`. | — |\n\nNotes:\n- `n` and `series_amount` apply to different modes.\n- `series` is i2i-only, so `--result_type series` requires `--image`.\n- `--negative_prompt` is generations-only and cannot combine with `--image`.\n- Omni `aspect_ratio=auto` needs `--image`. Text-to-image Omni (no `--image`) defaults to `16:9`; do not pass `auto`.\n\nOmni refs rules (image):\n- `image` cannot be empty (URL or Base64).\n- `element_id` cannot be empty.\n- `image_count + element_count <= 10`.\n\n### element (subject management)\n\nManage custom subjects: create from image/video, query task, list custom/preset, delete.\nUse `element_id` in `video`/`image` with `--element_ids` for reusable subject consistency.\n\n| Parameter | Description |\n| --- | --- |\n| `--action create` | Create subject; requires `--name` (<=20), `--description` (<=100), `--ref_type` |\n| `--ref_type` | `image_refer` (requires `--frontal_image` and `--refer_images`) / `video_refer` (requires `--video`) |\n| `--frontal_image` | Front reference image (`image_refer`) |\n| `--refer_images` | Other reference images (comma-separated, **required** 1–3). Official API: must differ from the frontal image. |\n| `--video` | Reference video (`video_refer`) |\n| `--voice_id` | Optional voice bind (image_refer: 人物/类人形象) |\n| `--action query --task_id <id>` | Query creation task |\n| `--action list` | List custom subjects |\n| `--action list-presets` | List preset subjects |\n| `--action delete --element_id <id>` | Delete subject |\n\nIf the user only provides a frontal image: **ask** whether to (1) add 1–3 other-angle images, or (2) explicitly reuse the frontal file as `--refer_images`. Do not submit without `--refer_images`. The CLI does not silently copy `--frontal_image` into `refer_images`.\n\n### account (resource & quota inquiry, optional credential setup)\n\n| Flag | Purpose |\n| --- | --- |\n| `--costs` (default) | Read-only quota/resource packs via `GET /account/costs`. |\n| `--bind-url` | Device bind with polling; prints URL for manual open; optional `--force`. |\n| `--import-env` | Read `KLING_API_KEY` and persist. |\n| `--import-credentials` | Persist `--api_key`. |\n| `--configure` | Interactive API Key input and save credentials. |\n\nAll bind/account files persist under storage root (`~/.config/kling` by default, or `KLING_STORAGE_ROOT`).\n\n`--costs` query params:\n\n| Query param (API) | CLI | Default |\n| --- | --- | --- |\n| `start_time` (required, Unix ms) | `--start_time` | if omitted: `end_time - days` |\n| `end_time` (required, Unix ms) | `--end_time` | if omitted: now |\n| — | `--days` | 30 (only when `--start_time` omitted) |\n| `resource_pack_name` (optional) | `--resource_pack_name` | — |\n\nRun `node {baseDir}/scripts/kling.mjs account --help` for details.\nRun `node {baseDir}/scripts/kling.mjs video --help`, `image --help`, or `element --help` for full params.\n\n## Route & model (CLI: `kling.mjs` + flags -> default `model_name`)\n\nAgents call `node {baseDir}/scripts/kling.mjs <video|image|element|account>` with flags.\n`--model` selects the official path/model. Video encodes model in the URL (`/text-to-video/kling-3.0`); image still sends `model_name`. Must be exact canonical spelling.\nIf `--model` is omitted, route defaults apply.\nCLI guardrails reject incompatible model/route and invalid `audio` / frame combinations before submit.\n\n### Routing decision tree (must follow)\n\n1. Choose subcommand from intent: `video` / `image` / `element` / `account`.\n2. Determine route triggers:\n   - any Omni trigger -> Omni route\n   - otherwise -> basic route\n3. Validate model-route compatibility:\n   - Omni route accepts only Omni-capable canonical models\n   - basic route rejects Omni-only models\n4. Validate strict parameter combos (`audio`, `multi_shot`, frame rules, ref limits).\n5. If uncertain, run `--help` or ask user; never guess-submit.\n\n### Video (`video` subcommand)\n\nOmni routing triggers (any of these -> `/omni-video/{model}`):\n- `--video`\n- comma in `--image`\n- `--image` + `--aspect_ratio`\n- `--element_ids` without a single I2V first-frame (or with turbo/2.6/2.5)\n- explicit `--model kling-3.0-omni` or `--model kling-o1`\n\nOtherwise:\n- T2V: no `--image` → `POST /text-to-video/{model}`\n- I2V: single `--image` (optional `--image_tail`, optional `--element_ids` on `kling-3.0` max 3) → `POST /image-to-video/{model}`\n\n`--multi_shot` does not force Omni; it still follows the routing triggers above. Turbo has no `settings.multi_shot`; use prompt `镜头 n, m, words;` only.\n\n| Video routing (CLI) | Default if `--model` omitted | Allowed `--model` |\n| --- | --- | --- |\n| T2V / I2V | `kling-3.0` | `kling-3.0`, `kling-3.0-turbo`, `kling-2.6`, `kling-2.5-turbo` |\n| Omni | `kling-3.0-omni` | `kling-3.0-omni` (default), `kling-o1` (explicit) |\n\n### Image (`image` subcommand)\n\nOmni routing triggers (any of these -> omni-image API route):\n- explicit `--model kling-v3-omni` or `--model kling-image-o1`\n- `--result_type series`\n- `--resolution 4k`\n- `--aspect_ratio auto`\n- comma in `--image`\n\n`--element_ids` alone stays on `/v1/images/generations` with `kling-v3` `element_list` (`kling-v2-1` rejected). 4k/series/multi-image still go Omni.\n\nElse -> basic generations route (text-to-image / image-to-image).\n\n| Image routing (CLI) | Default if `--model` omitted | Allowed `--model` |\n| --- | --- | --- |\n| Basic `/v1/images/generations` | `kling-v3` | `kling-v3`, `kling-v2-1` |\n| Omni `/v1/images/omni-image` (4k / series) | `kling-v3-omni` | `kling-v3-omni`, `kling-image-o1` |\n| Omni `/v1/images/omni-image` (other) | `kling-image-o1` | `kling-image-o1` (official default), `kling-v3-omni` |\n\n### Model catalog (by name)\n\nCommon aliases (understanding only; do not pass aliases to `--model`):\n- `omni3`, `omni v3`, `视频O3`, `O3`, `o3` -> `kling-3.0-omni` (video) / `kling-v3-omni` (image)\n- `o1`, `omni1` -> `kling-o1` (video) or `kling-image-o1` (image)\n\n`--model` input rule: pass only canonical names from this table.\n\n| Model | Valid on | Notes |\n| --- | --- | --- |\n| `kling-3.0` | T2V / I2V | Default video basic. Resolution 720p/1080p/4k; audio native/off; multi_shot. I2V contents may include `element` (max 3). |\n| `kling-3.0-turbo` | T2V / I2V | No audio / `settings.multi_shot`; I2V first_frame only (no last_frame). Multi-shot via prompt `镜头 n, m, words;` only. |\n| `kling-2.6` | T2V / I2V | Duration 5 or 10; audio native/off (native needs 1080p). Last-frame: 1080p silent. |\n| `kling-2.5-turbo` | T2V / I2V | Duration 5 or 10; no audio field. Last-frame: 1080p only. |\n| `kling-3.0-omni` | Omni video | Default Omni video. audio native/original/off (`original` needs `--video`); 4k; first+last frame; feature/base video. |\n| `kling-o1` | Omni video | Duration 3–10; audio original/off; no 4k; no multi_shot field. First-frame-only: 5 or 10s. Feature video: no last_frame. First+last: no extra refs/subjects. |\n| `kling-v3` | Basic image | Default basic image. 1k/2k. Supports `element_list`. |\n| `kling-v2-1` | Basic image | Official generations `model_name`. No subjects. |\n| `kling-v3-omni` | Omni image | 1k/2k/4k; series + `auto`. Default Omni when 4k or series. Text-to-image: no `aspect_ratio=auto` (default `16:9`). |\n| `kling-image-o1` | Omni image | Official omni-image default. Capability map: 1k/2k (not 4k, not series). Text-to-image default `16:9`; `auto` only with `--image`. |\n\nPrinciple:\n- Set task flags first (`--image`, `--element_ids`, `--video`, `--multi_shot`, ...).\n- Omit `--model` to use route defaults.\n- If `--model` is explicit, it must match route implied by flags.\n\n## When to use Omni; element vs image reference\n\nWhich route: follow **Route & model** triggers.\nPrefer Omni when you need multi-image composition, 4K/series, reference-video edit, or mixed image+element Omni prompts (`<<<image_1>>>` / `@image_1`).\nSingle-image + subject on `kling-3.0` I2V or `kling-v3` generations stays on the basic route.\n\nPrefer plain image reference for simple tasks.\nCreate element first only when user explicitly wants reusable subject consistency across outputs.\n\n## Prompt template syntax (video / image Omni)\n\nIn Omni video, pass media/subjects by flags; reference in `--prompt` with official `@` ids (`contents[].id`):\n- `@image_1` -> first `--image` (`@image_2`, ...)\n- `@element_1` -> first `--element_ids` (`@element_2`, ...)\n- `@video_1` -> `--video` clip\n\nOmni image still uses `<<<image_1>>>` / `<<<element_1>>>` in `--prompt` (official `/v1/images/omni-image`). Those placeholders require the Omni route (explicit `--model kling-image-o1` / `kling-v3-omni`, or 4k/series/multi-image). `kling-v3` generations uses `element_list` without `<<<>>>`.\n\n## Notes\n\n- Timing: video ~1–5+ min; image ~20–60 s; subject creation ~30 s–2 min.\n- Retention: platform may remove assets after ~30 days; save outputs locally.\n\n## Reference\n\n- Official docs index: https://klingai.com/document-api/llms.txt\n- Official docs home: https://klingai.com/document-api/\n- API endpoint quick map in this package: `reference.md`\n\nFile v2.0.0:README.md\n\n# Kling AI\n\nVideo generation, image generation, and subject management.\n\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\n- **Subcommands**:\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\n  - `element`: subject CRUD\n  - `account`: quota query and credential bind/import\n- Choose by user intent; if ambiguous, ask the user first.\n\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview).\n\nFile v2.0.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"2.0.0\",\n  \"publishedAt\": 1790165453034\n}\n\nFile v2.0.0:reference.md\n\n# Kling AI — API reference\n\nOfficial source: [klingai.com/document-api/llms.txt](https://klingai.com/document-api/llms.txt)\n\n| Subcommand | Endpoints |\n| ---------- | --------- |\n| `video`    | `POST /text-to-video/kling-3.0` (`kling-3.0-turbo` / `kling-2.6` / `kling-2.5-turbo`); `POST /image-to-video/kling-3.0` (same model suffixes); `POST /omni-video/kling-3.0-omni`; `POST /omni-video/kling-o1`; query `GET /tasks?task_ids=` |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image` |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-advanced-elements` |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\nAuth and polling notes:\n\n- Official: path-encoded models (all `video` submit paths above) are **new API** and require `Authorization: Bearer <API Key>`. See [authentication](https://klingai.com/document-api/api/get-started/authentication.md).\n- Official: `/v1/...` image and element paths are **old API** (`model_name` in body); API Key Bearer works.\n- Current script: process env `KLING_API_KEY` is sent as Bearer as-is. Else `api_key` in `~/.config/kling/.credentials` is sent as Bearer (**no JWT**). `account --bind` writes that API Key from exchange `ISSUED`. `KLING_TOKEN` is not recognized.\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- New video submit returns `data.id` + `data.status` (`submitted` / `processing` / `succeeded` / `failed`). Poll `GET /tasks?task_ids=` and read `outputs[].url`.\n- Image/element `/v1` submit still returns `task_id`; poll `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read `task_result`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial pages (primary source):\n\n- [Docs index](https://klingai.com/document-api/llms.txt)\n- [Video capability map](https://klingai.com/document-api/guides/capability-map/video.md)\n- [Image capability map](https://klingai.com/document-api/guides/capability-map/image.md)\n- [Kling 3.0 T2V](https://klingai.com/document-api/api/video/3-0-omni/text-to-video.md)\n- [Kling 3.0 I2V](https://klingai.com/document-api/api/video/3-0-omni/image-to-video.md)\n- [Kling 3.0 Omni video](https://klingai.com/document-api/api/video/3-0-omni/video-omni.md)\n- [Kling 3.0 Turbo T2V](https://klingai.com/document-api/api/video/3-0-turbo/text-to-video.md)\n- [Kling 3.0 Turbo I2V](https://klingai.com/document-api/api/video/3-0-turbo/image-to-video.md)\n- [Kling O1 video](https://klingai.com/document-api/api/video/o1/video-omni.md)\n- [Kling 2.6 T2V](https://klingai.com/document-api/api/video/2-6/text-to-video.md)\n- [Kling 2.6 I2V](https://klingai.com/document-api/api/video/2-6/image-to-video.md)\n- [Kling 2.5 Turbo T2V](https://klingai.com/document-api/api/video/2-5-turbo/text-to-video.md)\n- [Kling 2.5 Turbo I2V](https://klingai.com/document-api/api/video/2-5-turbo/image-to-video.md)\n- [Image 3.0 generations](https://klingai.com/document-api/api/image/3-0-omni/image-generation.md)\n- [Omni image](https://klingai.com/document-api/api/image/3-0-omni/image-omni.md)\n- [Elements](https://klingai.com/document-api/api/video/3-0-omni/elements.md)\n- [Account costs](https://klingai.com/document-api/api/assets/account-usage.md)\n\nFile v2.0.0:skill-card.md\n\n## Description:\n\nCalls Kling AI for video generation, image generation, subject management, and account quota inquiry.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[klingai-dev](https://clawhub.ai/user/klingai-dev)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and developers use this skill to turn Kling AI generation, subject-management, and quota requests into validated CLI actions. It helps agents choose the correct video, image, element, or account workflow before submitting billable Kling API tasks.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and selected media are sent to Kling AI for generation and subject workflows.\n\nMitigation: Submit only prompts and media that are appropriate to share with Kling AI, and confirm ambiguous generation intent before starting billable tasks.\n\nRisk: Kling API keys may be persisted under the Kling storage root when bind, import, or configure flows are used.\n\nMitigation: Prefer session-only KLING_API_KEY for non-persistent use, or protect and periodically review the local Kling credentials storage.\n\nRisk: Subject deletion is explicit but not separately confirmed by the skill.\n\nMitigation: Review delete commands and subject identifiers carefully before execution.\n\nRisk: Generated assets may be removed by the platform after a retention period.\n\nMitigation: Download and retain needed outputs locally after successful generation.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/klingai-dev/skills/klingai)\n- [Kling AI API Documentation](https://klingai.com/document-api/)\n- [Kling AI Docs Index](https://klingai.com/document-api/llms.txt)\n- [Kling API Authentication](https://klingai.com/document-api/api/get-started/authentication.md)\n- [Video Capability Map](https://klingai.com/document-api/guides/capability-map/video.md)\n- [Image Capability Map](https://klingai.com/document-api/guides/capability-map/image.md)\n- [Kling Elements API](https://klingai.com/document-api/api/video/3-0-omni/elements.md)\n- [Account Usage API](https://klingai.com/document-api/api/assets/account-usage.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, files, guidance]\n\n**Output Format:** [Markdown guidance with shell commands; CLI runs print task status and local output paths.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Generated media can be downloaded to the selected output directory; account and subject commands may print status, quota, or task identifiers.]\n\n## Skill Version(s):\n\n2.0.0 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.1.0: 14 files, 47139 bytes\n\nFiles: README.md (755b), reference.md (2209b), scripts/account.mjs (10931b), scripts/element.mjs (8287b), scripts/image.mjs (12254b), scripts/kling.mjs (2662b), scripts/shared/args.mjs (7415b), scripts/shared/auth.mjs (15874b), scripts/shared/client.mjs (24273b), scripts/shared/task.mjs (3808b), scripts/video.mjs (25365b), skill-card.md (2301b), SKILL.md (21269b), _meta.json (126b)\n\nFile v1.1.0:SKILL.md\n\n---\r\nname: klingai\r\nversion: \"1.1.0\"\r\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\r\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_TOKEN\",\"homepage\":\"https://app.klingai.com/cn/dev/document-api\"}}\r\n---\r\n\r\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\r\n\r\n# Kling AI\r\n\r\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\r\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\r\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\r\n\r\n## Invocation\r\n\r\nFrom repository root:\r\n\r\n```bash\r\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\r\n```\r\n\r\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\r\n\r\n## Routing priority (OpenClaw)\r\n\r\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\r\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\r\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\r\n\r\n## Intent routing (required)\r\n\r\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\r\n\r\n| User intent | Subcommand |\r\n| --- | --- |\r\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\r\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\r\n| Subject / element (create, manage, list, presets, delete) | `element` |\r\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\r\n| Credential setup (bind/import) | `account` with `--bind-url` / `--import-env` / `--import-credentials` |\r\n\r\nSelection rules:\r\n- Video-related -> `video`\r\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\r\n- Image-only -> `image`\r\n- Subject CRUD -> `element`\r\n- Quota/balance/resource packs -> `account` (default `--costs`)\r\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\r\n- Create subject first -> `element`\r\n\r\nForce skill conditions (any hit -> use this skill):\r\n- multi-image input (>=2 images)\r\n- Omni/frame control (`first_frame`/`end_frame`/`image_types`)\r\n- reference video (`--video` + `feature`/`base`) or video editing\r\n- subject/element reuse (`--element_ids`)\r\n- storyboard/multi-shot (`--multi_shot`, 分镜)\r\n- image series (`--result_type series`/`--series_amount`, 组图)\r\n- extension parameter gaps or ambiguous/unclear parameter intent\r\n\r\nModel name strict rule:\r\n- `--model` must be canonical lowercase/hyphen names only: `kling-v3`, `kling-v3-omni`, `kling-video-o1`, `kling-image-o1`.\r\n- Do not pass aliases as CLI values.\r\n- Alias disambiguation: `视频O3`/`图片O3` -> `kling-v3-omni`; only `o1`/`omni1` map to O1 models by intent.\r\n\r\nWhen ambiguous (for example video vs image, or v3-omni vs o1), ask user first, then submit.\r\n\r\n## Preflight checklist (mandatory before submit)\r\n\r\nBefore any billable submit, pass all checks below. If any check fails, stop and ask user or run `--help`.\r\n\r\n1. Subcommand is confirmed: `video` / `image` / `element` / `account`.\r\n2. Route is confirmed by flags: basic vs Omni (from **Route & model**).\r\n3. `--model` is canonical (no alias values like `o3`, `omni3`).\r\n4. All params come from this SKILL.md or subcommand `--help`; no undocumented flags.\r\n5. No conflicting combinations (for example `--multi_shot` + `--image_tail`, `--video` + `--sound on`).\r\n6. Query mode and submit mode are not mixed.\r\n\r\n## Anti-fabrication policy (no guessing)\r\n\r\n- Do not invent model names, enums, ranges, defaults, request fields, or hidden flags.\r\n- Do not infer unsupported values from older/other skills.\r\n- If value is uncertain, verify with `node {baseDir}/scripts/kling.mjs <subcommand> --help`.\r\n- If user intent is uncertain, ask first; do not submit trial jobs.\r\n- If user uses alias words, map to canonical names and pass canonical only.\r\n\r\n## Cost and submission rules\r\n\r\n- Every submit is charged; do not submit speculatively.\r\n- Confirm intent first when unclear.\r\n- On timeout/failure/unexpected result, ask user whether to wait or retry.\r\n- Do not auto-resubmit or silently change intent/parameters.\r\n\r\n## Agent loop & results\r\n\r\n- Entry: only `node {baseDir}/scripts/kling.mjs` with `video`/`image`/`element`/`account`.\r\n- Default flow: submit -> poll (~10s interval) -> download to `--output_dir`.\r\n- Keep user updated on long runs (`submitted -> processing -> succeed/failed`).\r\n- `--no-wait` flow (video/image): submit -> get `task_id` -> query by same subcommand `--task_id <id>` -> add `--download` when succeeded.\r\n- Query mode strictness: when using `--task_id`, do not mix submit-only flags (`--prompt`, `--multi_shot`, `--image`, `--element_ids`, `--video`).\r\n- Never print secrets (`KLING_TOKEN`, `access_key_id`, `secret_access_key`).\r\n\r\nPresenting results:\r\n- Always return task id + local path(s).\r\n- If stdout includes an URL, include markdown link as fallback.\r\n\r\n## Prerequisites\r\n\r\n- Runtime: Node.js 18+, no extra packages.\r\n- Credential priority: `KLING_TOKEN` (session only) -> stored AK/SK in `.credentials` (JWT per request).\r\n- `KLING_TOKEN` is session-only override: not read from env files, and never persisted by `--bind-url`, `--import-env`, `--import-credentials`, or `--configure`.\r\n- Permission/auth errors: use bind/rebind flow only; report cause; rebind only after user confirmation.\r\n- Storage root: default `~/.config/kling`, optional `KLING_STORAGE_ROOT`.\r\n- No token and no AK/SK: CLI auto-starts bind flow.\r\n- `account --bind-url`: init -> verify -> print URL (manual open) -> poll.\r\n- Bind/auth failures: do not silently switch API base or rewrite network params.\r\n- Forced rebind (requires user confirmation):\r\n  - `node {baseDir}/scripts/kling.mjs account --bind-url --force`\r\n- Manual import fallback:\r\n  - `node {baseDir}/scripts/kling.mjs account --import-env`\r\n  - `node {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"`\r\n  - `node {baseDir}/scripts/kling.mjs account --configure`\r\n- Mask secret values in user-facing text.\r\n- Optional behavior (API base, media roots): check subcommand `--help`.\r\n\r\n## Quick start\r\n\r\n```bash\r\n# Show help\r\nnode {baseDir}/scripts/kling.mjs --help\r\n\r\n# Video\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\r\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type customize --multi_prompt '[{\"index\":1,\"prompt\":\"Sunrise\",\"duration\":\"5\"}]'\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type intelligence --prompt \"A story in three beats: arrival, conflict, resolution\"\r\n\r\n# Image\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\r\n\r\n# Subject / element\r\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg\r\nnode {baseDir}/scripts/kling.mjs element --action list\r\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\r\n\r\n# Account\r\nnode {baseDir}/scripts/kling.mjs account --help\r\nnode {baseDir}/scripts/kling.mjs account\r\nnode {baseDir}/scripts/kling.mjs account --days 90\r\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\r\nnode {baseDir}/scripts/kling.mjs account --bind-url\r\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\r\nnode {baseDir}/scripts/kling.mjs account --import-env\r\nnode {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"\r\nnode {baseDir}/scripts/kling.mjs account --configure\r\n\r\n# Query existing task\r\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\r\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\r\n```\r\n\r\n## Core parameters by subcommand\r\n\r\nDo not invent values/ranges/enums/defaults. If unsure, check:\r\n`node {baseDir}/scripts/kling.mjs <subcommand> --help`\r\n\r\n### video (video generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--prompt` | Non-multi-shot text2video/Omni requires non-empty prompt. With `--multi_shot`, follow `--shot_type` rules. | — |\r\n| `--image` | Basic i2v: single image. Omni: image list (comma-separated). With `--aspect_ratio`, route to Omni video. | — |\r\n| `--image_types` | Omni only. Per-image type list aligned with `--image`: `first_frame` / `end_frame` / empty. | — |\r\n| `--duration` | 3–15 seconds. | 5 |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--mode` | `pro` (1080P) / `std` (720P). | pro |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1`. With `--image`, routes to Omni. | 16:9 |\r\n| `--sound` | `on` / `off`. `kling-v3` and `kling-v3-omni` support sound; `kling-video-o1` does not. With `--video`, must be `off`. | off |\r\n| `--image_tail` | Last-frame image. | — |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--video` | Omni reference clip: public http(s) URL only. | — |\r\n| `--video_refer_type` | `feature` (reference) / `base` (edit clip). | base |\r\n| `--keep_original_sound` | Omni-only, with `--video`: `yes` / `no`. | — |\r\n| `--multi_shot` | Enable multi-shot for storyboard/multi-beat generation across text2video, image2video, and omni-video routes (same core rules). | false |\r\n| `--shot_type` | `customize` / `intelligence` (required with `--multi_shot`; CLI default `customize`). | — |\r\n| `--multi_prompt` | For `shot_type=customize` only. | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download` for download. | — |\r\n\r\nModel alias reminder:\r\n- `omni3`/`omni v3`/`o3`/`video o3`/`image o3`/`视频O3`/`图片O3` -> `kling-v3-omni`\r\n- `o1`/`omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\nMulti-shot (`--multi_shot`) rules (text2video / image2video / omni-video share the same request semantics):\r\n- `multi_shot=false`: `shot_type` and `multi_prompt` ignored.\r\n- `multi_shot=true`: `--shot_type` required (`customize` default); do not use `--image_tail`.\r\n- `shot_type=customize`: `--multi_prompt` required (JSON array, 1–6 shots, per-shot `index`/`prompt`/`duration`, durations sum to `--duration`).\r\n- `shot_type=intelligence`: non-empty `--prompt` required; do not pass `--multi_prompt`.\r\n\r\nOmni `image_list` rules (video):\r\n- `image_url` cannot be empty (URL or Base64).\r\n- `type` is intent-driven: `first_frame` / `end_frame` only when user asks frame control.\r\n- `--image_tail` requires `--image`.\r\n- With `--video`: max 4 images. Without `--video`: max 7.\r\n- `kling-video-o1`: when image count > 2, no `end_frame`.\r\n- Frame generation cannot combine with `--video_refer_type base`.\r\n\r\nOmni `element_list` rules (video):\r\n- `element_id` cannot be empty.\r\n- Frame generation supports up to 3 subjects.\r\n- First+last frame with `kling-video-o1`: subjects unsupported.\r\n- With `--video`: `image_count + element_count <= 4`; otherwise `<= 7`.\r\n- With `--video`, video-role subjects are not supported by API; CLI cannot pre-validate subject role from `element_id` alone.\r\n\r\nOmni `video_list` rules (video):\r\n- Max one video URL.\r\n- `--video_refer_type`: `feature` / `base` (default `base`).\r\n- `--keep_original_sound`: `yes` / `no`.\r\n- If `refer_type=base`, do not define first/end frame (`first_frame`/`end_frame`/`--image_tail`).\r\n- When `--video` is used, `--sound` must be `off`.\r\n\r\nCompact examples:\r\n\r\n```bash\r\n# explicit frame marking by intent\r\nnode {baseDir}/scripts/kling.mjs video --model kling-v3-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,,end_frame --prompt \"...\"\r\n\r\n# with reference video: image count <= 4\r\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --image a.jpg,b.jpg --prompt \"...\"\r\n```\r\n\r\n### image (image generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--prompt` | Image prompt (required). | — |\r\n| `--image` | Basic: single image. Omni: image list (comma-separated). | — |\r\n| `--resolution` | `1k` / `2k` / `4k`; `4k` routes to Omni. | 1k |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1` / `auto` (`auto` Omni only). | basic: `16:9`; Omni: `auto` |\r\n| `--n` | Result count 1–9 (`result_type=single`). | 1 |\r\n| `--negative_prompt` | Basic API only. | — |\r\n| `--result_type` | `single` / `series` (`series` is Omni and i2i-only). | single |\r\n| `--series_amount` | 2–9 for `result_type=series`. | 4 |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download`. | — |\r\n\r\nNotes:\r\n- `n` and `series_amount` apply to different modes.\r\n- `series` is i2i-only, so `--result_type series` requires `--image`.\r\n\r\nOmni refs rules (image):\r\n- `image` cannot be empty (URL or Base64).\r\n- `element_id` cannot be empty.\r\n- `image_count + element_count <= 10`.\r\n\r\n### element (subject management)\r\n\r\nManage custom subjects: create from image/video, query task, list custom/preset, delete.\r\nUse `element_id` in `video`/`image` with `--element_ids` for reusable subject consistency.\r\n\r\n| Parameter | Description |\r\n| --- | --- |\r\n| `--action create` | Create subject; requires `--name` (<=20), `--description` (<=100), `--ref_type` |\r\n| `--ref_type` | `image_refer` (requires `--frontal_image`) / `video_refer` (requires `--video`) |\r\n| `--frontal_image` | Front reference image (`image_refer`) |\r\n| `--refer_images` | Other reference images (comma-separated, 1–3) |\r\n| `--video` | Reference video (`video_refer`) |\r\n| `--action query --task_id <id>` | Query creation task |\r\n| `--action list` | List custom subjects |\r\n| `--action list-presets` | List preset subjects |\r\n| `--action delete --element_id <id>` | Delete subject |\r\n\r\n### account (resource & quota inquiry, optional credential setup)\r\n\r\n| Flag | Purpose |\r\n| --- | --- |\r\n| `--costs` (default) | Read-only quota/resource packs via `GET /account/costs`. |\r\n| `--bind-url` | Device bind with polling; prints URL for manual open; optional `--force`. |\r\n| `--import-env` | Read `KLING_ACCESS_KEY_ID` + `KLING_SECRET_ACCESS_KEY` and persist. |\r\n| `--import-credentials` | Persist keys from `--access_key_id` + `--secret_access_key`. |\r\n| `--configure` | Interactive key input and save credentials. |\r\n\r\nAll bind/account files persist under storage root (`~/.config/kling` by default, or `KLING_STORAGE_ROOT`).\r\n\r\n`--costs` query params:\r\n\r\n| Query param (API) | CLI | Default |\r\n| --- | --- | --- |\r\n| `start_time` (required, Unix ms) | `--start_time` | if omitted: `end_time - days` |\r\n| `end_time` (required, Unix ms) | `--end_time` | if omitted: now |\r\n| — | `--days` | 30 (only when `--start_time` omitted) |\r\n| `resource_pack_name` (optional) | `--resource_pack_name` | — |\r\n\r\nRun `node {baseDir}/scripts/kling.mjs account --help` for details.\r\nRun `node {baseDir}/scripts/kling.mjs video --help`, `image --help`, or `element --help` for full params.\r\n\r\n## Route & model (CLI: `kling.mjs` + flags -> default `model_name`)\r\n\r\nAgents call `node {baseDir}/scripts/kling.mjs <video|image|element|account>` with flags.\r\n`--model` sets `model_name` for selected route and must be exact canonical spelling.\r\nIf `--model` is omitted, route defaults apply.\r\nCLI guardrails reject incompatible model/route and invalid `sound` combinations before submit.\r\n\r\n### Routing decision tree (must follow)\r\n\r\n1. Choose subcommand from intent: `video` / `image` / `element` / `account`.\r\n2. Determine route triggers:\r\n   - any Omni trigger -> Omni route\r\n   - otherwise -> basic route\r\n3. Validate model-route compatibility:\r\n   - Omni route accepts only Omni-capable canonical models\r\n   - basic route rejects Omni-only models\r\n4. Validate strict parameter combos (`sound`, `multi_shot`, frame rules, ref limits).\r\n5. If uncertain, run `--help` or ask user; never guess-submit.\r\n\r\n### Video (`video` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-video API route):\r\n- `--element_ids`\r\n- `--video`\r\n- comma in `--image`\r\n- `--image` + `--aspect_ratio`\r\n- explicit `--model kling-v3-omni` or `--model kling-video-o1`\r\n\r\nOtherwise:\r\n- basic text2video (T2V): no `--image`\r\n- basic image2video (I2V): single `--image` (optional `--image_tail`)\r\n\r\n`--multi_shot` does not force Omni; storyboard mode still follows the same routing triggers above.\r\n\r\n| Video routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic T2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Basic I2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-video-o1` (explicit) |\r\n\r\n### Image (`image` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-image API route):\r\n- explicit `--model kling-v3-omni` or `--model kling-image-o1`\r\n- `--element_ids`\r\n- `--result_type series`\r\n- `--resolution 4k`\r\n- `--aspect_ratio auto`\r\n- comma in `--image`\r\n\r\nElse -> basic generations route (text-to-image / image-to-image).\r\n\r\n| Image routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic | `kling-v3` | `kling-v3` by default; use canonical basic-route models supported by current CLI (`image --help`) |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-image-o1` (explicit) |\r\n\r\n### Model catalog (by name)\r\n\r\nCommon aliases (understanding only; do not pass aliases to `--model`):\r\n- `omni3`, `omni v3`, `视频O3`, `O3`, `o3`, `图片O3` -> `kling-v3-omni`\r\n- `o1`, `omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\n`--model` input rule: pass only canonical names from this table.\r\n\r\n| Model | Valid on | Notes |\r\n| --- | --- | --- |\r\n| `kling-v2-6` | Basic T2V / I2V only | Not Omni video. |\r\n| `kling-v3` | Basic video / basic image | Default for basic routes. |\r\n| `kling-v3-omni` | Omni video / Omni image | Default for Omni routes. With `--video`, `sound` must be `off`. |\r\n| `kling-video-o1` | Omni video only | No `sound`. |\r\n| `kling-image-o1` | Omni image only | Optional explicit Omni-image model. |\r\n\r\nPrinciple:\r\n- Set task flags first (`--image`, `--element_ids`, `--video`, `--multi_shot`, ...).\r\n- Omit `--model` to use route defaults.\r\n- If `--model` is explicit, it must match route implied by flags.\r\n\r\n## When to use Omni; element vs image reference\r\n\r\nWhich route: follow **Route & model** triggers.\r\nPrefer Omni when you need multi-image composition, images + elements, 4K/series modes, or edit-style instructions.\r\nUse prompt placeholders `<<<...>>>` for Omni media/subject references.\r\n\r\nPrefer plain image reference for simple tasks.\r\nCreate element first only when user explicitly wants reusable subject consistency across outputs.\r\n\r\n## Prompt template syntax (video / image Omni)\r\n\r\nIn Omni, pass media/subjects by flags; reference in `--prompt` with placeholders:\r\n- `<<<image_1>>>` -> first `--image` (`<<<image_2>>>`, ...)\r\n- `<<<element_1>>>` -> first `--element_ids` (`<<<element_2>>>`, ...)\r\n- `<<<video_1>>>` -> `--video` clip (`video` subcommand only)\r\n\r\n## Notes\r\n\r\n- Timing: video ~1–5+ min; image ~20–60 s; subject creation ~30 s–2 min.\r\n- Retention: platform may remove assets after ~30 days; save outputs locally.\r\n\r\n## Reference\r\n\r\n- Official developer docs (CN): https://app.klingai.com/cn/dev/document-api\r\n- Official developer docs (Global): https://kling.ai/document-api/quickStart/productIntroduction/overview\r\n- API endpoint quick map in this package: `reference.md`\n\nFile v1.1.0:README.md\n\n# Kling AI\r\n\r\nVideo generation, image generation, and subject management.\r\n\r\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\r\n- **Subcommands**:\r\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\r\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\r\n  - `element`: subject CRUD\r\n  - `account`: quota query and credential bind/import\r\n- Choose by user intent; if ambiguous, ask the user first.\r\n\r\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\r\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview).\n\nFile v1.1.0:_meta.json\n\n{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"1.1.0\",\n  \"publishedAt\": 1775744696609\n}\n\nFile v1.1.0:reference.md\n\n# Kling AI — API reference\n\n\n| Subcommand | Endpoints                                                                                                                                                            |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `video`    | `POST/GET /v1/videos/text2video`, `POST/GET /v1/videos/image2video`, `POST/GET /v1/videos/omni-video`                                                                |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image`                                                                                                  |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-elements`                                     |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\n\nAuth and polling notes:\n\n- Business APIs (`/v1/...` + `/account/costs`) use Bearer token (JWT from `~/.config/kling/.credentials`, or session `KLING_TOKEN`).\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- Submit APIs return `task_id`; polling uses `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read result URLs from `task_result`/`output`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial docs (use as primary source; paths may vary by locale):\n\n- [Developer docs home (CN)](https://app.klingai.com/cn/dev/document-api)\n- [Developer docs home (Global)](https://kling.ai/document-api/quickStart/productIntroduction/overview)\n- Use the navigation from the Global/CN docs home to open model pages for video/image/omni in the current site structure.\n\nFile v1.1.0:skill-card.md\n\n## Description:\n\nOfficial Kling AI Skill for calling Kling AI video generation, image generation, subject management, and account quota inquiry workflows.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[klingai-dev](https://clawhub.ai/user/klingai-dev)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nDevelopers and external users use this skill to submit and monitor Kling AI video and image generation tasks, manage reusable subjects, and check account quota or resource packs.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: The skill can send Kling credentials and user-selected media to a configurable API host.\n\nMitigation: Install only when comfortable with that access, keep KLING_API_BASE and KLING_BIND_BASE unset unless using a trusted endpoint, and submit only media intended for Kling AI processing.\n\nRisk: Saved credentials may persist under ~/.config/kling or KLING_STORAGE_ROOT.\n\nMitigation: Review the configured storage location after binding or importing credentials and remove saved credentials when they are no longer needed.\n\nRisk: Subject deletion has no extra confirmation step.\n\nMitigation: Check the target subject ID before issuing delete operations.\n\n## Reference(s):\n\n- [Kling AI developer documentation (CN)](https://app.klingai.com/cn/dev/document-api)\n- [Kling AI developer documentation (Global)](https://kling.ai/document-api/quickStart/productIntroduction/overview)\n- [Kling AI ClawHub skill page](https://clawhub.ai/klingai-dev/skills/klingai)\n- [API reference](reference.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, guidance]\n\n**Output Format:** [Markdown with inline shell commands and local file paths]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [May include task IDs, downloaded media paths, status updates, quota details, and fallback URLs when returned by the service.]\n\n## Skill Version(s):\n\n1.1.0 (source: frontmatter and server-resolved release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment.\n\nArchive v1.0.9: 13 files, 45866 bytes\n\nFiles: README.md (755b), reference.md (2209b), scripts/account.mjs (10931b), scripts/element.mjs (8287b), scripts/image.mjs (12254b), scripts/kling.mjs (2662b), scripts/shared/args.mjs (7415b), scripts/shared/auth.mjs (15874b), scripts/shared/client.mjs (24273b), scripts/shared/task.mjs (3808b), scripts/video.mjs (25365b), SKILL.md (21268b), _meta.json (126b)\n\nFile v1.0.9:SKILL.md\n\n---\r\nname: klingai\r\nversion: \"1.0.9\r\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\r\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_TOKEN\",\"homepage\":\"https://app.klingai.com/cn/dev/document-api\"}}\r\n---\r\n\r\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\r\n\r\n# Kling AI\r\n\r\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\r\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\r\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\r\n\r\n## Invocation\r\n\r\nFrom repository root:\r\n\r\n```bash\r\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\r\n```\r\n\r\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\r\n\r\n## Routing priority (OpenClaw)\r\n\r\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\r\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\r\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\r\n\r\n## Intent routing (required)\r\n\r\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\r\n\r\n| User intent | Subcommand |\r\n| --- | --- |\r\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\r\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\r\n| Subject / element (create, manage, list, presets, delete) | `element` |\r\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\r\n| Credential setup (bind/import) | `account` with `--bind-url` / `--import-env` / `--import-credentials` |\r\n\r\nSelection rules:\r\n- Video-related -> `video`\r\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\r\n- Image-only -> `image`\r\n- Subject CRUD -> `element`\r\n- Quota/balance/resource packs -> `account` (default `--costs`)\r\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\r\n- Create subject first -> `element`\r\n\r\nForce skill conditions (any hit -> use this skill):\r\n- multi-image input (>=2 images)\r\n- Omni/frame control (`first_frame`/`end_frame`/`image_types`)\r\n- reference video (`--video` + `feature`/`base`) or video editing\r\n- subject/element reuse (`--element_ids`)\r\n- storyboard/multi-shot (`--multi_shot`, 分镜)\r\n- image series (`--result_type series`/`--series_amount`, 组图)\r\n- extension parameter gaps or ambiguous/unclear parameter intent\r\n\r\nModel name strict rule:\r\n- `--model` must be canonical lowercase/hyphen names only: `kling-v3`, `kling-v3-omni`, `kling-video-o1`, `kling-image-o1`.\r\n- Do not pass aliases as CLI values.\r\n- Alias disambiguation: `视频O3`/`图片O3` -> `kling-v3-omni`; only `o1`/`omni1` map to O1 models by intent.\r\n\r\nWhen ambiguous (for example video vs image, or v3-omni vs o1), ask user first, then submit.\r\n\r\n## Preflight checklist (mandatory before submit)\r\n\r\nBefore any billable submit, pass all checks below. If any check fails, stop and ask user or run `--help`.\r\n\r\n1. Subcommand is confirmed: `video` / `image` / `element` / `account`.\r\n2. Route is confirmed by flags: basic vs Omni (from **Route & model**).\r\n3. `--model` is canonical (no alias values like `o3`, `omni3`).\r\n4. All params come from this SKILL.md or subcommand `--help`; no undocumented flags.\r\n5. No conflicting combinations (for example `--multi_shot` + `--image_tail`, `--video` + `--sound on`).\r\n6. Query mode and submit mode are not mixed.\r\n\r\n## Anti-fabrication policy (no guessing)\r\n\r\n- Do not invent model names, enums, ranges, defaults, request fields, or hidden flags.\r\n- Do not infer unsupported values from older/other skills.\r\n- If value is uncertain, verify with `node {baseDir}/scripts/kling.mjs <subcommand> --help`.\r\n- If user intent is uncertain, ask first; do not submit trial jobs.\r\n- If user uses alias words, map to canonical names and pass canonical only.\r\n\r\n## Cost and submission rules\r\n\r\n- Every submit is charged; do not submit speculatively.\r\n- Confirm intent first when unclear.\r\n- On timeout/failure/unexpected result, ask user whether to wait or retry.\r\n- Do not auto-resubmit or silently change intent/parameters.\r\n\r\n## Agent loop & results\r\n\r\n- Entry: only `node {baseDir}/scripts/kling.mjs` with `video`/`image`/`element`/`account`.\r\n- Default flow: submit -> poll (~10s interval) -> download to `--output_dir`.\r\n- Keep user updated on long runs (`submitted -> processing -> succeed/failed`).\r\n- `--no-wait` flow (video/image): submit -> get `task_id` -> query by same subcommand `--task_id <id>` -> add `--download` when succeeded.\r\n- Query mode strictness: when using `--task_id`, do not mix submit-only flags (`--prompt`, `--multi_shot`, `--image`, `--element_ids`, `--video`).\r\n- Never print secrets (`KLING_TOKEN`, `access_key_id`, `secret_access_key`).\r\n\r\nPresenting results:\r\n- Always return task id + local path(s).\r\n- If stdout includes an URL, include markdown link as fallback.\r\n\r\n## Prerequisites\r\n\r\n- Runtime: Node.js 18+, no extra packages.\r\n- Credential priority: `KLING_TOKEN` (session only) -> stored AK/SK in `.credentials` (JWT per request).\r\n- `KLING_TOKEN` is session-only override: not read from env files, and never persisted by `--bind-url`, `--import-env`, `--import-credentials`, or `--configure`.\r\n- Permission/auth errors: use bind/rebind flow only; report cause; rebind only after user confirmation.\r\n- Storage root: default `~/.config/kling`, optional `KLING_STORAGE_ROOT`.\r\n- No token and no AK/SK: CLI auto-starts bind flow.\r\n- `account --bind-url`: init -> verify -> print URL (manual open) -> poll.\r\n- Bind/auth failures: do not silently switch API base or rewrite network params.\r\n- Forced rebind (requires user confirmation):\r\n  - `node {baseDir}/scripts/kling.mjs account --bind-url --force`\r\n- Manual import fallback:\r\n  - `node {baseDir}/scripts/kling.mjs account --import-env`\r\n  - `node {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"`\r\n  - `node {baseDir}/scripts/kling.mjs account --configure`\r\n- Mask secret values in user-facing text.\r\n- Optional behavior (API base, media roots): check subcommand `--help`.\r\n\r\n## Quick start\r\n\r\n```bash\r\n# Show help\r\nnode {baseDir}/scripts/kling.mjs --help\r\n\r\n# Video\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\r\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type customize --multi_prompt '[{\"index\":1,\"prompt\":\"Sunrise\",\"duration\":\"5\"}]'\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type intelligence --prompt \"A story in three beats: arrival, conflict, resolution\"\r\n\r\n# Image\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\r\n\r\n# Subject / element\r\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg\r\nnode {baseDir}/scripts/kling.mjs element --action list\r\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\r\n\r\n# Account\r\nnode {baseDir}/scripts/kling.mjs account --help\r\nnode {baseDir}/scripts/kling.mjs account\r\nnode {baseDir}/scripts/kling.mjs account --days 90\r\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\r\nnode {baseDir}/scripts/kling.mjs account --bind-url\r\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\r\nnode {baseDir}/scripts/kling.mjs account --import-env\r\nnode {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"\r\nnode {baseDir}/scripts/kling.mjs account --configure\r\n\r\n# Query existing task\r\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\r\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\r\n```\r\n\r\n## Core parameters by subcommand\r\n\r\nDo not invent values/ranges/enums/defaults. If unsure, check:\r\n`node {baseDir}/scripts/kling.mjs <subcommand> --help`\r\n\r\n### video (video generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--prompt` | Non-multi-shot text2video/Omni requires non-empty prompt. With `--multi_shot`, follow `--shot_type` rules. | — |\r\n| `--image` | Basic i2v: single image. Omni: image list (comma-separated). With `--aspect_ratio`, route to Omni video. | — |\r\n| `--image_types` | Omni only. Per-image type list aligned with `--image`: `first_frame` / `end_frame` / empty. | — |\r\n| `--duration` | 3–15 seconds. | 5 |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--mode` | `pro` (1080P) / `std` (720P). | pro |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1`. With `--image`, routes to Omni. | 16:9 |\r\n| `--sound` | `on` / `off`. `kling-v3` and `kling-v3-omni` support sound; `kling-video-o1` does not. With `--video`, must be `off`. | off |\r\n| `--image_tail` | Last-frame image. | — |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--video` | Omni reference clip: public http(s) URL only. | — |\r\n| `--video_refer_type` | `feature` (reference) / `base` (edit clip). | base |\r\n| `--keep_original_sound` | Omni-only, with `--video`: `yes` / `no`. | — |\r\n| `--multi_shot` | Enable multi-shot for storyboard/multi-beat generation across text2video, image2video, and omni-video routes (same core rules). | false |\r\n| `--shot_type` | `customize` / `intelligence` (required with `--multi_shot`; CLI default `customize`). | — |\r\n| `--multi_prompt` | For `shot_type=customize` only. | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download` for download. | — |\r\n\r\nModel alias reminder:\r\n- `omni3`/`omni v3`/`o3`/`video o3`/`image o3`/`视频O3`/`图片O3` -> `kling-v3-omni`\r\n- `o1`/`omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\nMulti-shot (`--multi_shot`) rules (text2video / image2video / omni-video share the same request semantics):\r\n- `multi_shot=false`: `shot_type` and `multi_prompt` ignored.\r\n- `multi_shot=true`: `--shot_type` required (`customize` default); do not use `--image_tail`.\r\n- `shot_type=customize`: `--multi_prompt` required (JSON array, 1–6 shots, per-shot `index`/`prompt`/`duration`, durations sum to `--duration`).\r\n- `shot_type=intelligence`: non-empty `--prompt` required; do not pass `--multi_prompt`.\r\n\r\nOmni `image_list` rules (video):\r\n- `image_url` cannot be empty (URL or Base64).\r\n- `type` is intent-driven: `first_frame` / `end_frame` only when user asks frame control.\r\n- `--image_tail` requires `--image`.\r\n- With `--video`: max 4 images. Without `--video`: max 7.\r\n- `kling-video-o1`: when image count > 2, no `end_frame`.\r\n- Frame generation cannot combine with `--video_refer_type base`.\r\n\r\nOmni `element_list` rules (video):\r\n- `element_id` cannot be empty.\r\n- Frame generation supports up to 3 subjects.\r\n- First+last frame with `kling-video-o1`: subjects unsupported.\r\n- With `--video`: `image_count + element_count <= 4`; otherwise `<= 7`.\r\n- With `--video`, video-role subjects are not supported by API; CLI cannot pre-validate subject role from `element_id` alone.\r\n\r\nOmni `video_list` rules (video):\r\n- Max one video URL.\r\n- `--video_refer_type`: `feature` / `base` (default `base`).\r\n- `--keep_original_sound`: `yes` / `no`.\r\n- If `refer_type=base`, do not define first/end frame (`first_frame`/`end_frame`/`--image_tail`).\r\n- When `--video` is used, `--sound` must be `off`.\r\n\r\nCompact examples:\r\n\r\n```bash\r\n# explicit frame marking by intent\r\nnode {baseDir}/scripts/kling.mjs video --model kling-v3-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,,end_frame --prompt \"...\"\r\n\r\n# with reference video: image count <= 4\r\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --image a.jpg,b.jpg --prompt \"...\"\r\n```\r\n\r\n### image (image generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--prompt` | Image prompt (required). | — |\r\n| `--image` | Basic: single image. Omni: image list (comma-separated). | — |\r\n| `--resolution` | `1k` / `2k` / `4k`; `4k` routes to Omni. | 1k |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1` / `auto` (`auto` Omni only). | basic: `16:9`; Omni: `auto` |\r\n| `--n` | Result count 1–9 (`result_type=single`). | 1 |\r\n| `--negative_prompt` | Basic API only. | — |\r\n| `--result_type` | `single` / `series` (`series` is Omni and i2i-only). | single |\r\n| `--series_amount` | 2–9 for `result_type=series`. | 4 |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download`. | — |\r\n\r\nNotes:\r\n- `n` and `series_amount` apply to different modes.\r\n- `series` is i2i-only, so `--result_type series` requires `--image`.\r\n\r\nOmni refs rules (image):\r\n- `image` cannot be empty (URL or Base64).\r\n- `element_id` cannot be empty.\r\n- `image_count + element_count <= 10`.\r\n\r\n### element (subject management)\r\n\r\nManage custom subjects: create from image/video, query task, list custom/preset, delete.\r\nUse `element_id` in `video`/`image` with `--element_ids` for reusable subject consistency.\r\n\r\n| Parameter | Description |\r\n| --- | --- |\r\n| `--action create` | Create subject; requires `--name` (<=20), `--description` (<=100), `--ref_type` |\r\n| `--ref_type` | `image_refer` (requires `--frontal_image`) / `video_refer` (requires `--video`) |\r\n| `--frontal_image` | Front reference image (`image_refer`) |\r\n| `--refer_images` | Other reference images (comma-separated, 1–3) |\r\n| `--video` | Reference video (`video_refer`) |\r\n| `--action query --task_id <id>` | Query creation task |\r\n| `--action list` | List custom subjects |\r\n| `--action list-presets` | List preset subjects |\r\n| `--action delete --element_id <id>` | Delete subject |\r\n\r\n### account (resource & quota inquiry, optional credential setup)\r\n\r\n| Flag | Purpose |\r\n| --- | --- |\r\n| `--costs` (default) | Read-only quota/resource packs via `GET /account/costs`. |\r\n| `--bind-url` | Device bind with polling; prints URL for manual open; optional `--force`. |\r\n| `--import-env` | Read `KLING_ACCESS_KEY_ID` + `KLING_SECRET_ACCESS_KEY` and persist. |\r\n| `--import-credentials` | Persist keys from `--access_key_id` + `--secret_access_key`. |\r\n| `--configure` | Interactive key input and save credentials. |\r\n\r\nAll bind/account files persist under storage root (`~/.config/kling` by default, or `KLING_STORAGE_ROOT`).\r\n\r\n`--costs` query params:\r\n\r\n| Query param (API) | CLI | Default |\r\n| --- | --- | --- |\r\n| `start_time` (required, Unix ms) | `--start_time` | if omitted: `end_time - days` |\r\n| `end_time` (required, Unix ms) | `--end_time` | if omitted: now |\r\n| — | `--days` | 30 (only when `--start_time` omitted) |\r\n| `resource_pack_name` (optional) | `--resource_pack_name` | — |\r\n\r\nRun `node {baseDir}/scripts/kling.mjs account --help` for details.\r\nRun `node {baseDir}/scripts/kling.mjs video --help`, `image --help`, or `element --help` for full params.\r\n\r\n## Route & model (CLI: `kling.mjs` + flags -> default `model_name`)\r\n\r\nAgents call `node {baseDir}/scripts/kling.mjs <video|image|element|account>` with flags.\r\n`--model` sets `model_name` for selected route and must be exact canonical spelling.\r\nIf `--model` is omitted, route defaults apply.\r\nCLI guardrails reject incompatible model/route and invalid `sound` combinations before submit.\r\n\r\n### Routing decision tree (must follow)\r\n\r\n1. Choose subcommand from intent: `video` / `image` / `element` / `account`.\r\n2. Determine route triggers:\r\n   - any Omni trigger -> Omni route\r\n   - otherwise -> basic route\r\n3. Validate model-route compatibility:\r\n   - Omni route accepts only Omni-capable canonical models\r\n   - basic route rejects Omni-only models\r\n4. Validate strict parameter combos (`sound`, `multi_shot`, frame rules, ref limits).\r\n5. If uncertain, run `--help` or ask user; never guess-submit.\r\n\r\n### Video (`video` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-video API route):\r\n- `--element_ids`\r\n- `--video`\r\n- comma in `--image`\r\n- `--image` + `--aspect_ratio`\r\n- explicit `--model kling-v3-omni` or `--model kling-video-o1`\r\n\r\nOtherwise:\r\n- basic text2video (T2V): no `--image`\r\n- basic image2video (I2V): single `--image` (optional `--image_tail`)\r\n\r\n`--multi_shot` does not force Omni; storyboard mode still follows the same routing triggers above.\r\n\r\n| Video routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic T2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Basic I2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-video-o1` (explicit) |\r\n\r\n### Image (`image` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-image API route):\r\n- explicit `--model kling-v3-omni` or `--model kling-image-o1`\r\n- `--element_ids`\r\n- `--result_type series`\r\n- `--resolution 4k`\r\n- `--aspect_ratio auto`\r\n- comma in `--image`\r\n\r\nElse -> basic generations route (text-to-image / image-to-image).\r\n\r\n| Image routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic | `kling-v3` | `kling-v3` by default; use canonical basic-route models supported by current CLI (`image --help`) |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-image-o1` (explicit) |\r\n\r\n### Model catalog (by name)\r\n\r\nCommon aliases (understanding only; do not pass aliases to `--model`):\r\n- `omni3`, `omni v3`, `视频O3`, `O3`, `o3`, `图片O3` -> `kling-v3-omni`\r\n- `o1`, `omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\n`--model` input rule: pass only canonical names from this table.\r\n\r\n| Model | Valid on | Notes |\r\n| --- | --- | --- |\r\n| `kling-v2-6` | Basic T2V / I2V only | Not Omni video. |\r\n| `kling-v3` | Basic video / basic image | Default for basic routes. |\r\n| `kling-v3-omni` | Omni video / Omni image | Default for Omni routes. With `--video`, `sound` must be `off`. |\r\n| `kling-video-o1` | Omni video only | No `sound`. |\r\n| `kling-image-o1` | Omni image only | Optional explicit Omni-image model. |\r\n\r\nPrinciple:\r\n- Set task flags first (`--image`, `--element_ids`, `--video`, `--multi_shot`, ...).\r\n- Omit `--model` to use route defaults.\r\n- If `--model` is explicit, it must match route implied by flags.\r\n\r\n## When to use Omni; element vs image reference\r\n\r\nWhich route: follow **Route & model** triggers.\r\nPrefer Omni when you need multi-image composition, images + elements, 4K/series modes, or edit-style instructions.\r\nUse prompt placeholders `<<<...>>>` for Omni media/subject references.\r\n\r\nPrefer plain image reference for simple tasks.\r\nCreate element first only when user explicitly wants reusable subject consistency across outputs.\r\n\r\n## Prompt template syntax (video / image Omni)\r\n\r\nIn Omni, pass media/subjects by flags; reference in `--prompt` with placeholders:\r\n- `<<<image_1>>>` -> first `--image` (`<<<image_2>>>`, ...)\r\n- `<<<element_1>>>` -> first `--element_ids` (`<<<element_2>>>`, ...)\r\n- `<<<video_1>>>` -> `--video` clip (`video` subcommand only)\r\n\r\n## Notes\r\n\r\n- Timing: video ~1–5+ min; image ~20–60 s; subject creation ~30 s–2 min.\r\n- Retention: platform may remove assets after ~30 days; save outputs locally.\r\n\r\n## Reference\r\n\r\n- Official developer docs (CN): https://app.klingai.com/cn/dev/document-api\r\n- Official developer docs (Global): https://kling.ai/document-api/quickStart/productIntroduction/overview\r\n- API endpoint quick map in this package: `reference.md`\n\nFile v1.0.9:README.md\n\n# Kling AI\r\n\r\nVideo generation, image generation, and subject management.\r\n\r\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\r\n- **Subcommands**:\r\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\r\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\r\n  - `element`: subject CRUD\r\n  - `account`: quota query and credential bind/import\r\n- Choose by user intent; if ambiguous, ask the user first.\r\n\r\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\r\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview).\n\nFile v1.0.9:_meta.json\n\n{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"1.0.9\",\n  \"publishedAt\": 1775744072029\n}\n\nFile v1.0.9:reference.md\n\n# Kling AI — API reference\n\n\n| Subcommand | Endpoints                                                                                                                                                            |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `video`    | `POST/GET /v1/videos/text2video`, `POST/GET /v1/videos/image2video`, `POST/GET /v1/videos/omni-video`                                                                |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image`                                                                                                  |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-elements`                                     |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\n\nAuth and polling notes:\n\n- Business APIs (`/v1/...` + `/account/costs`) use Bearer token (JWT from `~/.config/kling/.credentials`, or session `KLING_TOKEN`).\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- Submit APIs return `task_id`; polling uses `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read result URLs from `task_result`/`output`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial docs (use as primary source; paths may vary by locale):\n\n- [Developer docs home (CN)](https://app.klingai.com/cn/dev/document-api)\n- [Developer docs home (Global)](https://kling.ai/document-api/quickStart/productIntroduction/overview)\n- Use the navigation from the Global/CN docs home to open model pages for video/image/omni in the current site structure.\n\nArchive v1.0.8: 13 files, 46633 bytes\n\nFiles: README.md (755b), reference.md (2209b), scripts/account.mjs (11780b), scripts/element.mjs (8287b), scripts/image.mjs (12254b), scripts/kling.mjs (2691b), scripts/shared/args.mjs (7415b), scripts/shared/auth.mjs (15874b), scripts/shared/client.mjs (26169b), scripts/shared/task.mjs (3808b), scripts/video.mjs (25365b), SKILL.md (21557b), _meta.json (126b)\n\nFile v1.0.8:SKILL.md\n\n---\r\nname: klingai\r\nversion: \"1.0.8\r\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\r\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_TOKEN\",\"homepage\":\"https://app.klingai.com/cn/dev/document-api\"}}\r\n---\r\n\r\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\r\n\r\n# Kling AI\r\n\r\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\r\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\r\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\r\n\r\n## Invocation\r\n\r\nFrom repository root:\r\n\r\n```bash\r\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\r\n```\r\n\r\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\r\n\r\n## Routing priority (OpenClaw)\r\n\r\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\r\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\r\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\r\n\r\n## Intent routing (required)\r\n\r\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\r\n\r\n| User intent | Subcommand |\r\n| --- | --- |\r\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\r\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\r\n| Subject / element (create, manage, list, presets, delete) | `element` |\r\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\r\n| Credential setup (bind/import) | `account` with `--bind` / `--bind-url` / `--import-env` / `--import-credentials` |\r\n\r\nSelection rules:\r\n- Video-related -> `video`\r\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\r\n- Image-only -> `image`\r\n- Subject CRUD -> `element`\r\n- Quota/balance/resource packs -> `account` (default `--costs`)\r\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\r\n- Create subject first -> `element`\r\n\r\nForce skill conditions (any hit -> use this skill):\r\n- multi-image input (>=2 images)\r\n- Omni/frame control (`first_frame`/`end_frame`/`image_types`)\r\n- reference video (`--video` + `feature`/`base`) or video editing\r\n- subject/element reuse (`--element_ids`)\r\n- storyboard/multi-shot (`--multi_shot`, 分镜)\r\n- image series (`--result_type series`/`--series_amount`, 组图)\r\n- extension parameter gaps or ambiguous/unclear parameter intent\r\n\r\nModel name strict rule:\r\n- `--model` must be canonical lowercase/hyphen names only: `kling-v3`, `kling-v3-omni`, `kling-video-o1`, `kling-image-o1`.\r\n- Do not pass aliases as CLI values.\r\n- Alias disambiguation: `视频O3`/`图片O3` -> `kling-v3-omni`; only `o1`/`omni1` map to O1 models by intent.\r\n\r\nWhen ambiguous (for example video vs image, or v3-omni vs o1), ask user first, then submit.\r\n\r\n## Preflight checklist (mandatory before submit)\r\n\r\nBefore any billable submit, pass all checks below. If any check fails, stop and ask user or run `--help`.\r\n\r\n1. Subcommand is confirmed: `video` / `image` / `element` / `account`.\r\n2. Route is confirmed by flags: basic vs Omni (from **Route & model**).\r\n3. `--model` is canonical (no alias values like `o3`, `omni3`).\r\n4. All params come from this SKILL.md or subcommand `--help`; no undocumented flags.\r\n5. No conflicting combinations (for example `--multi_shot` + `--image_tail`, `--video` + `--sound on`).\r\n6. Query mode and submit mode are not mixed.\r\n\r\n## Anti-fabrication policy (no guessing)\r\n\r\n- Do not invent model names, enums, ranges, defaults, request fields, or hidden flags.\r\n- Do not infer unsupported values from older/other skills.\r\n- If value is uncertain, verify with `node {baseDir}/scripts/kling.mjs <subcommand> --help`.\r\n- If user intent is uncertain, ask first; do not submit trial jobs.\r\n- If user uses alias words, map to canonical names and pass canonical only.\r\n\r\n## Cost and submission rules\r\n\r\n- Every submit is charged; do not submit speculatively.\r\n- Confirm intent first when unclear.\r\n- On timeout/failure/unexpected result, ask user whether to wait or retry.\r\n- Do not auto-resubmit or silently change intent/parameters.\r\n\r\n## Agent loop & results\r\n\r\n- Entry: only `node {baseDir}/scripts/kling.mjs` with `video`/`image`/`element`/`account`.\r\n- Default flow: submit -> poll (~10s interval) -> download to `--output_dir`.\r\n- Keep user updated on long runs (`submitted -> processing -> succeed/failed`).\r\n- `--no-wait` flow (video/image): submit -> get `task_id` -> query by same subcommand `--task_id <id>` -> add `--download` when succeeded.\r\n- Query mode strictness: when using `--task_id`, do not mix submit-only flags (`--prompt`, `--multi_shot`, `--image`, `--element_ids`, `--video`).\r\n- Never print secrets (`KLING_TOKEN`, `access_key_id`, `secret_access_key`).\r\n\r\nPresenting results:\r\n- Always return task id + local path(s).\r\n- If stdout includes an URL, include markdown link as fallback.\r\n\r\n## Prerequisites\r\n\r\n- Runtime: Node.js 18+, no extra packages.\r\n- Credential priority: `KLING_TOKEN` (session only) -> stored AK/SK in `.credentials` (JWT per request).\r\n- `KLING_TOKEN` is session-only override: not read from env files, and never persisted by `--bind`, `--import-env`, `--import-credentials`, or `--configure`.\r\n- Permission/auth errors: use bind/rebind flow only; report cause; rebind only after user confirmation.\r\n- Storage root: default `~/.config/kling`, optional `KLING_STORAGE_ROOT`.\r\n- No token and no AK/SK: CLI auto-starts bind flow.\r\n- `account --bind`: init -> verify -> auto-open browser -> poll.\r\n- `account --bind-url`: init -> verify -> print URL (manual open) -> poll.\r\n- Bind/auth failures: do not silently switch API base or rewrite network params.\r\n- Forced rebind (requires user confirmation):\r\n  - `node {baseDir}/scripts/kling.mjs account --bind --force`\r\n  - `node {baseDir}/scripts/kling.mjs account --bind-url --force`\r\n- Manual import fallback:\r\n  - `node {baseDir}/scripts/kling.mjs account --import-env`\r\n  - `node {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"`\r\n  - `node {baseDir}/scripts/kling.mjs account --configure`\r\n- Mask secret values in user-facing text.\r\n- Optional behavior (API base, media roots): check subcommand `--help`.\r\n\r\n## Quick start\r\n\r\n```bash\r\n# Show help\r\nnode {baseDir}/scripts/kling.mjs --help\r\n\r\n# Video\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\r\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type customize --multi_prompt '[{\"index\":1,\"prompt\":\"Sunrise\",\"duration\":\"5\"}]'\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type intelligence --prompt \"A story in three beats: arrival, conflict, resolution\"\r\n\r\n# Image\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\r\n\r\n# Subject / element\r\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg\r\nnode {baseDir}/scripts/kling.mjs element --action list\r\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\r\n\r\n# Account\r\nnode {baseDir}/scripts/kling.mjs account --help\r\nnode {baseDir}/scripts/kling.mjs account\r\nnode {baseDir}/scripts/kling.mjs account --days 90\r\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\r\nnode {baseDir}/scripts/kling.mjs account --bind\r\nnode {baseDir}/scripts/kling.mjs account --bind-url\r\nnode {baseDir}/scripts/kling.mjs account --bind --force\r\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\r\nnode {baseDir}/scripts/kling.mjs account --import-env\r\nnode {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"\r\nnode {baseDir}/scripts/kling.mjs account --configure\r\n\r\n# Query existing task\r\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\r\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\r\n```\r\n\r\n## Core parameters by subcommand\r\n\r\nDo not invent values/ranges/enums/defaults. If unsure, check:\r\n`node {baseDir}/scripts/kling.mjs <subcommand> --help`\r\n\r\n### video (video generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--prompt` | Non-multi-shot text2video/Omni requires non-empty prompt. With `--multi_shot`, follow `--shot_type` rules. | — |\r\n| `--image` | Basic i2v: single image. Omni: image list (comma-separated). With `--aspect_ratio`, route to Omni video. | — |\r\n| `--image_types` | Omni only. Per-image type list aligned with `--image`: `first_frame` / `end_frame` / empty. | — |\r\n| `--duration` | 3–15 seconds. | 5 |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--mode` | `pro` (1080P) / `std` (720P). | pro |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1`. With `--image`, routes to Omni. | 16:9 |\r\n| `--sound` | `on` / `off`. `kling-v3` and `kling-v3-omni` support sound; `kling-video-o1` does not. With `--video`, must be `off`. | off |\r\n| `--image_tail` | Last-frame image. | — |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--video` | Omni reference clip: public http(s) URL only. | — |\r\n| `--video_refer_type` | `feature` (reference) / `base` (edit clip). | base |\r\n| `--keep_original_sound` | Omni-only, with `--video`: `yes` / `no`. | — |\r\n| `--multi_shot` | Enable multi-shot for storyboard/multi-beat generation across text2video, image2video, and omni-video routes (same core rules). | false |\r\n| `--shot_type` | `customize` / `intelligence` (required with `--multi_shot`; CLI default `customize`). | — |\r\n| `--multi_prompt` | For `shot_type=customize` only. | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download` for download. | — |\r\n\r\nModel alias reminder:\r\n- `omni3`/`omni v3`/`o3`/`video o3`/`image o3`/`视频O3`/`图片O3` -> `kling-v3-omni`\r\n- `o1`/`omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\nMulti-shot (`--multi_shot`) rules (text2video / image2video / omni-video share the same request semantics):\r\n- `multi_shot=false`: `shot_type` and `multi_prompt` ignored.\r\n- `multi_shot=true`: `--shot_type` required (`customize` default); do not use `--image_tail`.\r\n- `shot_type=customize`: `--multi_prompt` required (JSON array, 1–6 shots, per-shot `index`/`prompt`/`duration`, durations sum to `--duration`).\r\n- `shot_type=intelligence`: non-empty `--prompt` required; do not pass `--multi_prompt`.\r\n\r\nOmni `image_list` rules (video):\r\n- `image_url` cannot be empty (URL or Base64).\r\n- `type` is intent-driven: `first_frame` / `end_frame` only when user asks frame control.\r\n- `--image_tail` requires `--image`.\r\n- With `--video`: max 4 images. Without `--video`: max 7.\r\n- `kling-video-o1`: when image count > 2, no `end_frame`.\r\n- Frame generation cannot combine with `--video_refer_type base`.\r\n\r\nOmni `element_list` rules (video):\r\n- `element_id` cannot be empty.\r\n- Frame generation supports up to 3 subjects.\r\n- First+last frame with `kling-video-o1`: subjects unsupported.\r\n- With `--video`: `image_count + element_count <= 4`; otherwise `<= 7`.\r\n- With `--video`, video-role subjects are not supported by API; CLI cannot pre-validate subject role from `element_id` alone.\r\n\r\nOmni `video_list` rules (video):\r\n- Max one video URL.\r\n- `--video_refer_type`: `feature` / `base` (default `base`).\r\n- `--keep_original_sound`: `yes` / `no`.\r\n- If `refer_type=base`, do not define first/end frame (`first_frame`/`end_frame`/`--image_tail`).\r\n- When `--video` is used, `--sound` must be `off`.\r\n\r\nCompact examples:\r\n\r\n```bash\r\n# explicit frame marking by intent\r\nnode {baseDir}/scripts/kling.mjs video --model kling-v3-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,,end_frame --prompt \"...\"\r\n\r\n# with reference video: image count <= 4\r\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --image a.jpg,b.jpg --prompt \"...\"\r\n```\r\n\r\n### image (image generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--prompt` | Image prompt (required). | — |\r\n| `--image` | Basic: single image. Omni: image list (comma-separated). | — |\r\n| `--resolution` | `1k` / `2k` / `4k`; `4k` routes to Omni. | 1k |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1` / `auto` (`auto` Omni only). | basic: `16:9`; Omni: `auto` |\r\n| `--n` | Result count 1–9 (`result_type=single`). | 1 |\r\n| `--negative_prompt` | Basic API only. | — |\r\n| `--result_type` | `single` / `series` (`series` is Omni and i2i-only). | single |\r\n| `--series_amount` | 2–9 for `result_type=series`. | 4 |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download`. | — |\r\n\r\nNotes:\r\n- `n` and `series_amount` apply to different modes.\r\n- `series` is i2i-only, so `--result_type series` requires `--image`.\r\n\r\nOmni refs rules (image):\r\n- `image` cannot be empty (URL or Base64).\r\n- `element_id` cannot be empty.\r\n- `image_count + element_count <= 10`.\r\n\r\n### element (subject management)\r\n\r\nManage custom subjects: create from image/video, query task, list custom/preset, delete.\r\nUse `element_id` in `video`/`image` with `--element_ids` for reusable subject consistency.\r\n\r\n| Parameter | Description |\r\n| --- | --- |\r\n| `--action create` | Create subject; requires `--name` (<=20), `--description` (<=100), `--ref_type` |\r\n| `--ref_type` | `image_refer` (requires `--frontal_image`) / `video_refer` (requires `--video`) |\r\n| `--frontal_image` | Front reference image (`image_refer`) |\r\n| `--refer_images` | Other reference images (comma-separated, 1–3) |\r\n| `--video` | Reference video (`video_refer`) |\r\n| `--action query --task_id <id>` | Query creation task |\r\n| `--action list` | List custom subjects |\r\n| `--action list-presets` | List preset subjects |\r\n| `--action delete --element_id <id>` | Delete subject |\r\n\r\n### account (resource & quota inquiry, optional bind)\r\n\r\n| Flag | Purpose |\r\n| --- | --- |\r\n| `--costs` (default) | Read-only quota/resource packs via `GET /account/costs`. |\r\n| `--bind` | Device bind with polling; auto-open browser; optional `--force`. |\r\n| `--bind-url` | Bind without browser auto-open; optional `--force`. |\r\n| `--import-env` | Read `KLING_ACCESS_KEY_ID` + `KLING_SECRET_ACCESS_KEY` and persist. |\r\n| `--import-credentials` | Persist keys from `--access_key_id` + `--secret_access_key`. |\r\n| `--configure` | Interactive key input and save credentials. |\r\n\r\nAll bind/account files persist under storage root (`~/.config/kling` by default, or `KLING_STORAGE_ROOT`).\r\n\r\n`--costs` query params:\r\n\r\n| Query param (API) | CLI | Default |\r\n| --- | --- | --- |\r\n| `start_time` (required, Unix ms) | `--start_time` | if omitted: `end_time - days` |\r\n| `end_time` (required, Unix ms) | `--end_time` | if omitted: now |\r\n| — | `--days` | 30 (only when `--start_time` omitted) |\r\n| `resource_pack_name` (optional) | `--resource_pack_name` | — |\r\n\r\nRun `node {baseDir}/scripts/kling.mjs account --help` for details.\r\nRun `node {baseDir}/scripts/kling.mjs video --help`, `image --help`, or `element --help` for full params.\r\n\r\n## Route & model (CLI: `kling.mjs` + flags -> default `model_name`)\r\n\r\nAgents call `node {baseDir}/scripts/kling.mjs <video|image|element|account>` with flags.\r\n`--model` sets `model_name` for selected route and must be exact canonical spelling.\r\nIf `--model` is omitted, route defaults apply.\r\nCLI guardrails reject incompatible model/route and invalid `sound` combinations before submit.\r\n\r\n### Routing decision tree (must follow)\r\n\r\n1. Choose subcommand from intent: `video` / `image` / `element` / `account`.\r\n2. Determine route triggers:\r\n   - any Omni trigger -> Omni route\r\n   - otherwise -> basic route\r\n3. Validate model-route compatibility:\r\n   - Omni route accepts only Omni-capable canonical models\r\n   - basic route rejects Omni-only models\r\n4. Validate strict parameter combos (`sound`, `multi_shot`, frame rules, ref limits).\r\n5. If uncertain, run `--help` or ask user; never guess-submit.\r\n\r\n### Video (`video` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-video API route):\r\n- `--element_ids`\r\n- `--video`\r\n- comma in `--image`\r\n- `--image` + `--aspect_ratio`\r\n- explicit `--model kling-v3-omni` or `--model kling-video-o1`\r\n\r\nOtherwise:\r\n- basic text2video (T2V): no `--image`\r\n- basic image2video (I2V): single `--image` (optional `--image_tail`)\r\n\r\n`--multi_shot` does not force Omni; storyboard mode still follows the same routing triggers above.\r\n\r\n| Video routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic T2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Basic I2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-video-o1` (explicit) |\r\n\r\n### Image (`image` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-image API route):\r\n- explicit `--model kling-v3-omni` or `--model kling-image-o1`\r\n- `--element_ids`\r\n- `--result_type series`\r\n- `--resolution 4k`\r\n- `--aspect_ratio auto`\r\n- comma in `--image`\r\n\r\nElse -> basic generations route (text-to-image / image-to-image).\r\n\r\n| Image routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic | `kling-v3` | `kling-v3` by default; use canonical basic-route models supported by current CLI (`image --help`) |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-image-o1` (explicit) |\r\n\r\n### Model catalog (by name)\r\n\r\nCommon aliases (understanding only; do not pass aliases to `--model`):\r\n- `omni3`, `omni v3`, `视频O3`, `O3`, `o3`, `图片O3` -> `kling-v3-omni`\r\n- `o1`, `omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\n`--model` input rule: pass only canonical names from this table.\r\n\r\n| Model | Valid on | Notes |\r\n| --- | --- | --- |\r\n| `kling-v2-6` | Basic T2V / I2V only | Not Omni video. |\r\n| `kling-v3` | Basic video / basic image | Default for basic routes. |\r\n| `kling-v3-omni` | Omni video / Omni image | Default for Omni routes. With `--video`, `sound` must be `off`. |\r\n| `kling-video-o1` | Omni video only | No `sound`. |\r\n| `kling-image-o1` | Omni image only | Optional explicit Omni-image model. |\r\n\r\nPrinciple:\r\n- Set task flags first (`--image`, `--element_ids`, `--video`, `--multi_shot`, ...).\r\n- Omit `--model` to use route defaults.\r\n- If `--model` is explicit, it must match route implied by flags.\r\n\r\n## When to use Omni; element vs image reference\r\n\r\nWhich route: follow **Route & model** triggers.\r\nPrefer Omni when you need multi-image composition, images + elements, 4K/series modes, or edit-style instructions.\r\nUse prompt placeholders `<<<...>>>` for Omni media/subject references.\r\n\r\nPrefer plain image reference for simple tasks.\r\nCreate element first only when user explicitly wants reusable subject consistency across outputs.\r\n\r\n## Prompt template syntax (video / image Omni)\r\n\r\nIn Omni, pass media/subjects by flags; reference in `--prompt` with placeholders:\r\n- `<<<image_1>>>` -> first `--image` (`<<<image_2>>>`, ...)\r\n- `<<<element_1>>>` -> first `--element_ids` (`<<<element_2>>>`, ...)\r\n- `<<<video_1>>>` -> `--video` clip (`video` subcommand only)\r\n\r\n## Notes\r\n\r\n- Timing: video ~1–5+ min; image ~20–60 s; subject creation ~30 s–2 min.\r\n- Retention: platform may remove assets after ~30 days; save outputs locally.\r\n\r\n## Reference\r\n\r\n- Official developer docs (CN): https://app.klingai.com/cn/dev/document-api\r\n- Official developer docs (Global): https://kling.ai/document-api/quickStart/productIntroduction/overview\r\n- API endpoint quick map in this package: `reference.md`\n\nFile v1.0.8:README.md\n\n# Kling AI\r\n\r\nVideo generation, image generation, and subject management.\r\n\r\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\r\n- **Subcommands**:\r\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\r\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\r\n  - `element`: subject CRUD\r\n  - `account`: quota query and credential bind/import\r\n- Choose by user intent; if ambiguous, ask the user first.\r\n\r\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\r\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview).\n\nFile v1.0.8:_meta.json\n\n{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"1.0.8\",\n  \"publishedAt\": 1775711928082\n}\n\nFile v1.0.8:reference.md\n\n# Kling AI — API reference\n\n\n| Subcommand | Endpoints                                                                                                                                                            |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `video`    | `POST/GET /v1/videos/text2video`, `POST/GET /v1/videos/image2video`, `POST/GET /v1/videos/omni-video`                                                                |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image`                                                                                                  |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-elements`                                     |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\n\nAuth and polling notes:\n\n- Business APIs (`/v1/...` + `/account/costs`) use Bearer token (JWT from `~/.config/kling/.credentials`, or session `KLING_TOKEN`).\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- Submit APIs return `task_id`; polling uses `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read result URLs from `task_result`/`output`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial docs (use as primary source; paths may vary by locale):\n\n- [Developer docs home (CN)](https://app.klingai.com/cn/dev/document-api)\n- [Developer docs home (Global)](https://kling.ai/document-api/quickStart/productIntroduction/overview)\n- Use the navigation from the Global/CN docs home to open model pages for video/image/omni in the current site structure.\n\nArchive v1.0.7: 13 files, 46953 bytes\n\nFiles: README.md (755b), reference.md (2209b), scripts/account.mjs (11780b), scripts/element.mjs (8287b), scripts/image.mjs (12254b), scripts/kling.mjs (2690b), scripts/shared/args.mjs (7415b), scripts/shared/auth.mjs (15874b), scripts/shared/client.mjs (27074b), scripts/shared/task.mjs (3808b), scripts/video.mjs (25365b), SKILL.md (21558b), _meta.json (126b)\n\nFile v1.0.7:SKILL.md\n\n---\r\nname: klingai\r\nversion: \"1.0.7\"\r\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\r\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_TOKEN\",\"homepage\":\"https://app.klingai.com/cn/dev/document-api\"}}\r\n---\r\n\r\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\r\n\r\n# Kling AI\r\n\r\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\r\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\r\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\r\n\r\n## Invocation\r\n\r\nFrom repository root:\r\n\r\n```bash\r\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\r\n```\r\n\r\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\r\n\r\n## Routing priority (OpenClaw)\r\n\r\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\r\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\r\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\r\n\r\n## Intent routing (required)\r\n\r\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\r\n\r\n| User intent | Subcommand |\r\n| --- | --- |\r\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\r\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\r\n| Subject / element (create, manage, list, presets, delete) | `element` |\r\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\r\n| Credential setup (bind/import) | `account` with `--bind` / `--bind-url` / `--import-env` / `--import-credentials` |\r\n\r\nSelection rules:\r\n- Video-related -> `video`\r\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\r\n- Image-only -> `image`\r\n- Subject CRUD -> `element`\r\n- Quota/balance/resource packs -> `account` (default `--costs`)\r\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\r\n- Create subject first -> `element`\r\n\r\nForce skill conditions (any hit -> use this skill):\r\n- multi-image input (>=2 images)\r\n- Omni/frame control (`first_frame`/`end_frame`/`image_types`)\r\n- reference video (`--video` + `feature`/`base`) or video editing\r\n- subject/element reuse (`--element_ids`)\r\n- storyboard/multi-shot (`--multi_shot`, 分镜)\r\n- image series (`--result_type series`/`--series_amount`, 组图)\r\n- extension parameter gaps or ambiguous/unclear parameter intent\r\n\r\nModel name strict rule:\r\n- `--model` must be canonical lowercase/hyphen names only: `kling-v3`, `kling-v3-omni`, `kling-video-o1`, `kling-image-o1`.\r\n- Do not pass aliases as CLI values.\r\n- Alias disambiguation: `视频O3`/`图片O3` -> `kling-v3-omni`; only `o1`/`omni1` map to O1 models by intent.\r\n\r\nWhen ambiguous (for example video vs image, or v3-omni vs o1), ask user first, then submit.\r\n\r\n## Preflight checklist (mandatory before submit)\r\n\r\nBefore any billable submit, pass all checks below. If any check fails, stop and ask user or run `--help`.\r\n\r\n1. Subcommand is confirmed: `video` / `image` / `element` / `account`.\r\n2. Route is confirmed by flags: basic vs Omni (from **Route & model**).\r\n3. `--model` is canonical (no alias values like `o3`, `omni3`).\r\n4. All params come from this SKILL.md or subcommand `--help`; no undocumented flags.\r\n5. No conflicting combinations (for example `--multi_shot` + `--image_tail`, `--video` + `--sound on`).\r\n6. Query mode and submit mode are not mixed.\r\n\r\n## Anti-fabrication policy (no guessing)\r\n\r\n- Do not invent model names, enums, ranges, defaults, request fields, or hidden flags.\r\n- Do not infer unsupported values from older/other skills.\r\n- If value is uncertain, verify with `node {baseDir}/scripts/kling.mjs <subcommand> --help`.\r\n- If user intent is uncertain, ask first; do not submit trial jobs.\r\n- If user uses alias words, map to canonical names and pass canonical only.\r\n\r\n## Cost and submission rules\r\n\r\n- Every submit is charged; do not submit speculatively.\r\n- Confirm intent first when unclear.\r\n- On timeout/failure/unexpected result, ask user whether to wait or retry.\r\n- Do not auto-resubmit or silently change intent/parameters.\r\n\r\n## Agent loop & results\r\n\r\n- Entry: only `node {baseDir}/scripts/kling.mjs` with `video`/`image`/`element`/`account`.\r\n- Default flow: submit -> poll (~10s interval) -> download to `--output_dir`.\r\n- Keep user updated on long runs (`submitted -> processing -> succeed/failed`).\r\n- `--no-wait` flow (video/image): submit -> get `task_id` -> query by same subcommand `--task_id <id>` -> add `--download` when succeeded.\r\n- Query mode strictness: when using `--task_id`, do not mix submit-only flags (`--prompt`, `--multi_shot`, `--image`, `--element_ids`, `--video`).\r\n- Never print secrets (`KLING_TOKEN`, `access_key_id`, `secret_access_key`).\r\n\r\nPresenting results:\r\n- Always return task id + local path(s).\r\n- If stdout includes an URL, include markdown link as fallback.\r\n\r\n## Prerequisites\r\n\r\n- Runtime: Node.js 18+, no extra packages.\r\n- Credential priority: `KLING_TOKEN` (session only) -> stored AK/SK in `.credentials` (JWT per request).\r\n- `KLING_TOKEN` is session-only override: not read from env files, and never persisted by `--bind`, `--import-env`, `--import-credentials`, or `--configure`.\r\n- Permission/auth errors: use bind/rebind flow only; report cause; rebind only after user confirmation.\r\n- Storage root: default `~/.config/kling`, optional `KLING_STORAGE_ROOT`.\r\n- No token and no AK/SK: CLI auto-starts bind flow.\r\n- `account --bind`: init -> verify -> auto-open browser -> poll.\r\n- `account --bind-url`: init -> verify -> print URL (manual open) -> poll.\r\n- Bind/auth failures: do not silently switch API base or rewrite network params.\r\n- Forced rebind (requires user confirmation):\r\n  - `node {baseDir}/scripts/kling.mjs account --bind --force`\r\n  - `node {baseDir}/scripts/kling.mjs account --bind-url --force`\r\n- Manual import fallback:\r\n  - `node {baseDir}/scripts/kling.mjs account --import-env`\r\n  - `node {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"`\r\n  - `node {baseDir}/scripts/kling.mjs account --configure`\r\n- Mask secret values in user-facing text.\r\n- Optional behavior (API base, media roots): check subcommand `--help`.\r\n\r\n## Quick start\r\n\r\n```bash\r\n# Show help\r\nnode {baseDir}/scripts/kling.mjs --help\r\n\r\n# Video\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\r\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type customize --multi_prompt '[{\"index\":1,\"prompt\":\"Sunrise\",\"duration\":\"5\"}]'\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type intelligence --prompt \"A story in three beats: arrival, conflict, resolution\"\r\n\r\n# Image\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\r\n\r\n# Subject / element\r\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg\r\nnode {baseDir}/scripts/kling.mjs element --action list\r\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\r\n\r\n# Account\r\nnode {baseDir}/scripts/kling.mjs account --help\r\nnode {baseDir}/scripts/kling.mjs account\r\nnode {baseDir}/scripts/kling.mjs account --days 90\r\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\r\nnode {baseDir}/scripts/kling.mjs account --bind\r\nnode {baseDir}/scripts/kling.mjs account --bind-url\r\nnode {baseDir}/scripts/kling.mjs account --bind --force\r\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\r\nnode {baseDir}/scripts/kling.mjs account --import-env\r\nnode {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"\r\nnode {baseDir}/scripts/kling.mjs account --configure\r\n\r\n# Query existing task\r\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\r\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\r\n```\r\n\r\n## Core parameters by subcommand\r\n\r\nDo not invent values/ranges/enums/defaults. If unsure, check:\r\n`node {baseDir}/scripts/kling.mjs <subcommand> --help`\r\n\r\n### video (video generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--prompt` | Non-multi-shot text2video/Omni requires non-empty prompt. With `--multi_shot`, follow `--shot_type` rules. | — |\r\n| `--image` | Basic i2v: single image. Omni: image list (comma-separated). With `--aspect_ratio`, route to Omni video. | — |\r\n| `--image_types` | Omni only. Per-image type list aligned with `--image`: `first_frame` / `end_frame` / empty. | — |\r\n| `--duration` | 3–15 seconds. | 5 |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--mode` | `pro` (1080P) / `std` (720P). | pro |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1`. With `--image`, routes to Omni. | 16:9 |\r\n| `--sound` | `on` / `off`. `kling-v3` and `kling-v3-omni` support sound; `kling-video-o1` does not. With `--video`, must be `off`. | off |\r\n| `--image_tail` | Last-frame image. | — |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--video` | Omni reference clip: public http(s) URL only. | — |\r\n| `--video_refer_type` | `feature` (reference) / `base` (edit clip). | base |\r\n| `--keep_original_sound` | Omni-only, with `--video`: `yes` / `no`. | — |\r\n| `--multi_shot` | Enable multi-shot for storyboard/multi-beat generation across text2video, image2video, and omni-video routes (same core rules). | false |\r\n| `--shot_type` | `customize` / `intelligence` (required with `--multi_shot`; CLI default `customize`). | — |\r\n| `--multi_prompt` | For `shot_type=customize` only. | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download` for download. | — |\r\n\r\nModel alias reminder:\r\n- `omni3`/`omni v3`/`o3`/`video o3`/`image o3`/`视频O3`/`图片O3` -> `kling-v3-omni`\r\n- `o1`/`omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\nMulti-shot (`--multi_shot`) rules (text2video / image2video / omni-video share the same request semantics):\r\n- `multi_shot=false`: `shot_type` and `multi_prompt` ignored.\r\n- `multi_shot=true`: `--shot_type` required (`customize` default); do not use `--image_tail`.\r\n- `shot_type=customize`: `--multi_prompt` required (JSON array, 1–6 shots, per-shot `index`/`prompt`/`duration`, durations sum to `--duration`).\r\n- `shot_type=intelligence`: non-empty `--prompt` required; do not pass `--multi_prompt`.\r\n\r\nOmni `image_list` rules (video):\r\n- `image_url` cannot be empty (URL or Base64).\r\n- `type` is intent-driven: `first_frame` / `end_frame` only when user asks frame control.\r\n- `--image_tail` requires `--image`.\r\n- With `--video`: max 4 images. Without `--video`: max 7.\r\n- `kling-video-o1`: when image count > 2, no `end_frame`.\r\n- Frame generation cannot combine with `--video_refer_type base`.\r\n\r\nOmni `element_list` rules (video):\r\n- `element_id` cannot be empty.\r\n- Frame generation supports up to 3 subjects.\r\n- First+last frame with `kling-video-o1`: subjects unsupported.\r\n- With `--video`: `image_count + element_count <= 4`; otherwise `<= 7`.\r\n- With `--video`, video-role subjects are not supported by API; CLI cannot pre-validate subject role from `element_id` alone.\r\n\r\nOmni `video_list` rules (video):\r\n- Max one video URL.\r\n- `--video_refer_type`: `feature` / `base` (default `base`).\r\n- `--keep_original_sound`: `yes` / `no`.\r\n- If `refer_type=base`, do not define first/end frame (`first_frame`/`end_frame`/`--image_tail`).\r\n- When `--video` is used, `--sound` must be `off`.\r\n\r\nCompact examples:\r\n\r\n```bash\r\n# explicit frame marking by intent\r\nnode {baseDir}/scripts/kling.mjs video --model kling-v3-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,,end_frame --prompt \"...\"\r\n\r\n# with reference video: image count <= 4\r\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --image a.jpg,b.jpg --prompt \"...\"\r\n```\r\n\r\n### image (image generation)\r\n\r\n| Parameter | Description | Default |\r\n| --- | --- | --- |\r\n| `--model` | `model_name`; see **Route & model** and **Model catalog**. | route default |\r\n| `--prompt` | Image prompt (required). | — |\r\n| `--image` | Basic: single image. Omni: image list (comma-separated). | — |\r\n| `--resolution` | `1k` / `2k` / `4k`; `4k` routes to Omni. | 1k |\r\n| `--aspect_ratio` | `16:9` / `9:16` / `1:1` / `auto` (`auto` Omni only). | basic: `16:9`; Omni: `auto` |\r\n| `--n` | Result count 1–9 (`result_type=single`). | 1 |\r\n| `--negative_prompt` | Basic API only. | — |\r\n| `--result_type` | `single` / `series` (`series` is Omni and i2i-only). | single |\r\n| `--series_amount` | 2–9 for `result_type=series`. | 4 |\r\n| `--element_ids` | Subject IDs (comma-separated, Omni). | — |\r\n| `--output_dir` | Output directory. | `./output` |\r\n| `--task_id` | Query task id; pair with `--download`. | — |\r\n\r\nNotes:\r\n- `n` and `series_amount` apply to different modes.\r\n- `series` is i2i-only, so `--result_type series` requires `--image`.\r\n\r\nOmni refs rules (image):\r\n- `image` cannot be empty (URL or Base64).\r\n- `element_id` cannot be empty.\r\n- `image_count + element_count <= 10`.\r\n\r\n### element (subject management)\r\n\r\nManage custom subjects: create from image/video, query task, list custom/preset, delete.\r\nUse `element_id` in `video`/`image` with `--element_ids` for reusable subject consistency.\r\n\r\n| Parameter | Description |\r\n| --- | --- |\r\n| `--action create` | Create subject; requires `--name` (<=20), `--description` (<=100), `--ref_type` |\r\n| `--ref_type` | `image_refer` (requires `--frontal_image`) / `video_refer` (requires `--video`) |\r\n| `--frontal_image` | Front reference image (`image_refer`) |\r\n| `--refer_images` | Other reference images (comma-separated, 1–3) |\r\n| `--video` | Reference video (`video_refer`) |\r\n| `--action query --task_id <id>` | Query creation task |\r\n| `--action list` | List custom subjects |\r\n| `--action list-presets` | List preset subjects |\r\n| `--action delete --element_id <id>` | Delete subject |\r\n\r\n### account (resource & quota inquiry, optional bind)\r\n\r\n| Flag | Purpose |\r\n| --- | --- |\r\n| `--costs` (default) | Read-only quota/resource packs via `GET /account/costs`. |\r\n| `--bind` | Device bind with polling; auto-open browser; optional `--force`. |\r\n| `--bind-url` | Bind without browser auto-open; optional `--force`. |\r\n| `--import-env` | Read `KLING_ACCESS_KEY_ID` + `KLING_SECRET_ACCESS_KEY` and persist. |\r\n| `--import-credentials` | Persist keys from `--access_key_id` + `--secret_access_key`. |\r\n| `--configure` | Interactive key input and save credentials. |\r\n\r\nAll bind/account files persist under storage root (`~/.config/kling` by default, or `KLING_STORAGE_ROOT`).\r\n\r\n`--costs` query params:\r\n\r\n| Query param (API) | CLI | Default |\r\n| --- | --- | --- |\r\n| `start_time` (required, Unix ms) | `--start_time` | if omitted: `end_time - days` |\r\n| `end_time` (required, Unix ms) | `--end_time` | if omitted: now |\r\n| — | `--days` | 30 (only when `--start_time` omitted) |\r\n| `resource_pack_name` (optional) | `--resource_pack_name` | — |\r\n\r\nRun `node {baseDir}/scripts/kling.mjs account --help` for details.\r\nRun `node {baseDir}/scripts/kling.mjs video --help`, `image --help`, or `element --help` for full params.\r\n\r\n## Route & model (CLI: `kling.mjs` + flags -> default `model_name`)\r\n\r\nAgents call `node {baseDir}/scripts/kling.mjs <video|image|element|account>` with flags.\r\n`--model` sets `model_name` for selected route and must be exact canonical spelling.\r\nIf `--model` is omitted, route defaults apply.\r\nCLI guardrails reject incompatible model/route and invalid `sound` combinations before submit.\r\n\r\n### Routing decision tree (must follow)\r\n\r\n1. Choose subcommand from intent: `video` / `image` / `element` / `account`.\r\n2. Determine route triggers:\r\n   - any Omni trigger -> Omni route\r\n   - otherwise -> basic route\r\n3. Validate model-route compatibility:\r\n   - Omni route accepts only Omni-capable canonical models\r\n   - basic route rejects Omni-only models\r\n4. Validate strict parameter combos (`sound`, `multi_shot`, frame rules, ref limits).\r\n5. If uncertain, run `--help` or ask user; never guess-submit.\r\n\r\n### Video (`video` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-video API route):\r\n- `--element_ids`\r\n- `--video`\r\n- comma in `--image`\r\n- `--image` + `--aspect_ratio`\r\n- explicit `--model kling-v3-omni` or `--model kling-video-o1`\r\n\r\nOtherwise:\r\n- basic text2video (T2V): no `--image`\r\n- basic image2video (I2V): single `--image` (optional `--image_tail`)\r\n\r\n`--multi_shot` does not force Omni; storyboard mode still follows the same routing triggers above.\r\n\r\n| Video routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic T2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Basic I2V | `kling-v3` | `kling-v2-6`, `kling-v3` |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-video-o1` (explicit) |\r\n\r\n### Image (`image` subcommand)\r\n\r\nOmni routing triggers (any of these -> omni-image API route):\r\n- explicit `--model kling-v3-omni` or `--model kling-image-o1`\r\n- `--element_ids`\r\n- `--result_type series`\r\n- `--resolution 4k`\r\n- `--aspect_ratio auto`\r\n- comma in `--image`\r\n\r\nElse -> basic generations route (text-to-image / image-to-image).\r\n\r\n| Image routing (CLI) | Default if `--model` omitted | Allowed `--model` (examples) |\r\n| --- | --- | --- |\r\n| Basic | `kling-v3` | `kling-v3` by default; use canonical basic-route models supported by current CLI (`image --help`) |\r\n| Omni | `kling-v3-omni` | `kling-v3-omni` (default), `kling-image-o1` (explicit) |\r\n\r\n### Model catalog (by name)\r\n\r\nCommon aliases (understanding only; do not pass aliases to `--model`):\r\n- `omni3`, `omni v3`, `视频O3`, `O3`, `o3`, `图片O3` -> `kling-v3-omni`\r\n- `o1`, `omni1` -> `kling-video-o1` or `kling-image-o1` by intent\r\n\r\n`--model` input rule: pass only canonical names from this table.\r\n\r\n| Model | Valid on | Notes |\r\n| --- | --- | --- |\r\n| `kling-v2-6` | Basic T2V / I2V only | Not Omni video. |\r\n| `kling-v3` | Basic video / basic image | Default for basic routes. |\r\n| `kling-v3-omni` | Omni video / Omni image | Default for Omni routes. With `--video`, `sound` must be `off`. |\r\n| `kling-video-o1` | Omni video only | No `sound`. |\r\n| `kling-image-o1` | Omni image only | Optional explicit Omni-image model. |\r\n\r\nPrinciple:\r\n- Set task flags first (`--image`, `--element_ids`, `--video`, `--multi_shot`, ...).\r\n- Omit `--model` to use route defaults.\r\n- If `--model` is explicit, it must match route implied by flags.\r\n\r\n## When to use Omni; element vs image reference\r\n\r\nWhich route: follow **Route & model** triggers.\r\nPrefer Omni when you need multi-image composition, images + elements, 4K/series modes, or edit-style instructions.\r\nUse prompt placeholders `<<<...>>>` for Omni media/subject references.\r\n\r\nPrefer plain image reference for simple tasks.\r\nCreate element first only when user explicitly wants reusable subject consistency across outputs.\r\n\r\n## Prompt template syntax (video / image Omni)\r\n\r\nIn Omni, pass media/subjects by flags; reference in `--prompt` with placeholders:\r\n- `<<<image_1>>>` -> first `--image` (`<<<image_2>>>`, ...)\r\n- `<<<element_1>>>` -> first `--element_ids` (`<<<element_2>>>`, ...)\r\n- `<<<video_1>>>` -> `--video` clip (`video` subcommand only)\r\n\r\n## Notes\r\n\r\n- Timing: video ~1–5+ min; image ~20–60 s; subject creation ~30 s–2 min.\r\n- Retention: platform may remove assets after ~30 days; save outputs locally.\r\n\r\n## Reference\r\n\r\n- Official developer docs (CN): https://app.klingai.com/cn/dev/document-api\r\n- Official developer docs (Global): https://kling.ai/document-api/quickStart/productIntroduction/overview\r\n- API endpoint quick map in this package: `reference.md`\n\nFile v1.0.7:README.md\n\n# Kling AI\r\n\r\nVideo generation, image generation, and subject management.\r\n\r\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\r\n- **Subcommands**:\r\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\r\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\r\n  - `element`: subject CRUD\r\n  - `account`: quota query and credential bind/import\r\n- Choose by user intent; if ambiguous, ask the user first.\r\n\r\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\r\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview).\n\nFile v1.0.7:_meta.json\n\n{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"1.0.7\",\n  \"publishedAt\": 1775710518964\n}\n\nFile v1.0.7:reference.md\n\n# Kling AI — API reference\n\n\n| Subcommand | Endpoints                                                                                                                                                            |\n| ---------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `video`    | `POST/GET /v1/videos/text2video`, `POST/GET /v1/videos/image2video`, `POST/GET /v1/videos/omni-video`                                                                |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image`                                                                                                  |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-elements`                                     |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\n\nAuth and polling notes:\n\n- Business APIs (`/v1/...` + `/account/costs`) use Bearer token (JWT from `~/.config/kling/.credentials`, or session `KLING_TOKEN`).\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- Submit APIs return `task_id`; polling uses `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read result URLs from `task_result`/`output`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial docs (use as primary source; paths may vary by locale):\n\n- [Developer docs home (CN)](https://app.klingai.com/cn/dev/document-api)\n- [Developer docs home (Global)](https://kling.ai/document-api/quickStart/productIntroduction/overview)\n- Use the navigation from the Global/CN docs home to open model pages for video/image/omni in the current site structure.\n\nArchive v1.0.6: 13 files, 39546 bytes\n\nFiles: README.md (392b), reference.md (1308b), scripts/account.mjs (6627b), scripts/element.mjs (8187b), scripts/image.mjs (12156b), scripts/kling.mjs (2647b), scripts/shared/args.mjs (7553b), scripts/shared/auth.mjs (14394b), scripts/shared/client.mjs (5442b), scripts/shared/task.mjs (3808b), scripts/video.mjs (25267b), SKILL.md (23709b), _meta.json (126b)\n\nFile v1.0.6:SKILL.md\n\n---\r\nname: klingai\r\nversion: \"1.0.6\"\r\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"\"分镜\", \"4K\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"subject\", \"character\", \"element\", \"storyboard\", \"quota\", \"balance\".\r\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_TOKEN\",\"homepage\":\"https://app.klingai.com/cn/dev/document-api\"}}\r\n---\r\n\r\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\r\n\r\n# Kling AI\r\n\r\nVideo generation, image generation, subject management, and (read-only) account resource / quota inquiry. Invoke with subcommand **`video`** | **`image`** | **`element`** | **`account`** according to user intent. Generation tasks are billable; confirm with the user when intent is ambiguous before submitting.\r\n\r\n## Invocation\r\n\r\nFrom repository root:\r\n\r\n```bash\r\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\r\n```\r\n\r\nIn examples below, `{baseDir}` means the skill directory (e.g. `skills/klingai`); replace with that path or run from that directory.\r\n\r\n## Intent routing (required)\r\n\r\n**Choose the subcommand from user intent** (which product area to call). **Which HTTP API and default `model_name` apply** is determined in **Route & model** — do not infer API from intent alone.\r\n\r\n| User intent | Subcommand |\r\n| --- | --- |\r\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\r\n| Image (text-to-image, image-to-image, 4K, series, picture, AI drawing) | `image` |\r\n| Subject / element (create, manage, list, presets, delete) | `element` |\r\n| Account resources, resource packs, remaining quota / balance (read-only query) | `account` |\r\n\r\n**Selection rules:** Video-related → **`video`**; image-only → **`image`**; subject CRUD → **`element`**; **quota / balance / resource packs / remaining credits** (no generation) → **`account`**. To *use* an existing subject in a video or image, use **`video`** or **`image`** with `--element_ids`; to create the subject, use **`element`** first.\r\n\r\n**Model name strict rule:** `--model` must use canonical names exactly (lowercase + hyphens), such as `kling-v3`, `kling-v3-omni`, `kling-video-o1`, `kling-image-o1`. Do **not** pass alias words or makeup name. see **Model catalog**.\r\n\r\n**When ambiguous:** e.g. “generate something with Kling” (video or image?) or “use new model” (v3-omni or video-o1?) or “generate a character” (new subject vs character image) → ask the user, then call with the chosen subcommand. **Billing, confirmation, retries, queues:** **Cost and submission rules**.\r\n\r\n## Cost and submission rules\r\n\r\n- **Every submit is charged.** Treat submissions seriously; do not submit speculatively or “to see what happens.”\r\n- **Confirm intent first.** Only submit after the task is clear. If the user’s intent is vague or ambiguous, ask and confirm before calling the script.\r\n- **Queue and failures.** Queues can be long. On timeout, failure, or any unexpected outcome, **ask the user** whether to continue waiting or to retry. **Do not** automatically resubmit, and **do not** change the user’s intent and retry without explicit confirmation.\r\n\r\n## Agent loop & results\r\n\r\n- **Entry:** Only **`node {baseDir}/scripts/kling.mjs`** (`video` | `image` | `element` | `account`); don’t call other files under `scripts/` directly.\r\n- **Default (wait on):** Submit → poll ~**10 s** → download to **`--output_dir`**. Stdout includes **`task_id`**, **`Status / 状态`**, **`Saved / 已保存`**, **`✓ Done / 完成: <path>`** — surface the useful lines to the user.\r\n- **Do not block or hang the conversation** in silence: keep the user informed of status (submitted → processing → succeed/failed). On long runs or when polling manually (`--no-wait` / `--task_id`), give brief updates in the user’s language so they know work is still in progress.\r\n- **`--no-wait`** (video/image): get **`task_id`**, then same subcommand **`--task_id <id>`**; add **`--download`** when finished. Query-only may print **`Video URL / 视频链接:`** (video).\r\n- **Secrets:** Never print **`KLING_TOKEN`**, `access_key_id`, or `secret_access_key` in chat.\r\n\r\n**Presenting to the user:** Always give **task id** + **local path(s)** after success. If stdout has an **http(s) URL**, add a markdown **`[label](url)`** (optional `![…](url)` or `<video>`); many clients need the link as fallback.\r\n\r\n## Prerequisites\r\n\r\n- Node.js 18+; no other dependencies.\r\n- **Authentication priority**: use stored AK/SK credentials first (`~/.config/kling/.credentials`, or `KLING_STORAGE_ROOT/.credentials`); if missing, use `KLING_TOKEN` (shell/process env first, then `kling.env` injection).\r\n- **`KLING_TOKEN` source priority**: shell/process environment first, then `<storageRoot>/kling.env` or `~/.config/kling/kling.env` injection.\r\n- **Initialize credentials** (when local file is not ready): use `account --configure` / `account --import-env` / `account --import-credentials`.\r\n- **Config file**: env is read from `<storageRoot>/kling.env` and `~/.config/kling/kling.env` (for keys like `KLING_TOKEN`, `KLING_API_BASE`); probe result is written to `<storageRoot>/kling.env`.\r\n- **Get AK/SK**: [Kling Console (CN)](https://app.klingai.com/cn/dev/console/application) / [Kling Console (Global)](https://app.klingai.com/global/dev/console/application)\r\n\r\n## Quick start\r\n\r\n```bash\r\n# Show help\r\nnode {baseDir}/scripts/kling.mjs --help\r\n\r\n# Video\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\r\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\r\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type customize --multi_prompt '[{\"index\":1,\"prompt\":\"Sunrise\",\"duration\":\"5\"}]'\r\nnode {baseDir}/scripts/kling.mjs video --multi_shot --shot_type intelligence --prompt \"A story in three beats: arrival, conflict, resolution\"\r\n\r\n# Image\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\r\nnode {baseDir}/scripts/kling.mjs image --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\r\n\r\n# Subject / element\r\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg\r\nnode {baseDir}/scripts/kling.mjs element --action list\r\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\r\n\r\n# Account — resource packs list & remaining quota (GET /account/costs; defaults: last 30 days)\r\nnode {baseDir}/scripts/kling.mjs account\r\nnode {baseDir}/scripts/kling.mjs account --days 90\r\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\r\nnode {baseDir}/scripts/kling.mjs account --configure\r\nnode {baseDir}/scripts/kling.mjs account --import-env\r\nnode {baseDir}/scripts/kling.mjs account --import-credentials --access_key_id \"<AK>\" --secret_access_key \"<SK>\"\r\n\r\n# Query existing task (use same subcommand as when you submitted)\r\nnode {baseDir}/scripts/kling.mjs video --task_id <id> --download\r\nnode {baseDir}/scripts/kling.mjs image --task_id <id> --download\r\n```\r\n\r\n\nArchive v1.0.5: 12 files, 24561 bytes\n\nFiles: README.md (392b), reference.md (579b), scripts/element.mjs (8126b), scripts/image.mjs (8158b), scripts/kling.mjs (2388b), scripts/shared/args.mjs (6358b), scripts/shared/auth.mjs (6999b), scripts/shared/client.mjs (4127b), scripts/shared/task.mjs (3808b), scripts/video.mjs (9625b), SKILL.md (11491b), _meta.json (126b)\n\nArchive v1.0.4: 12 files, 24146 bytes\n\nFiles: README.md (392b), reference.md (579b), scripts/element.mjs (8126b), scripts/image.mjs (8158b), scripts/kling.mjs (2388b), scripts/shared/args.mjs (5707b), scripts/shared/auth.mjs (6999b), scripts/shared/client.mjs (3864b), scripts/shared/task.mjs (3808b), scripts/video.mjs (9596b), SKILL.md (11370b), _meta.json (126b)\n\nArchive v1.0.3: 12 files, 23768 bytes\n\nFiles: README.md (392b), reference.md (579b), scripts/element.mjs (8126b), scripts/image.mjs (8158b), scripts/kling.mjs (2388b), scripts/shared/args.mjs (5707b), scripts/shared/auth.mjs (6999b), scripts/shared/client.mjs (3864b), scripts/shared/task.mjs (3808b), scripts/video.mjs (9596b), SKILL.md (10488b), _meta.json (126b)\n\nArchive v1.0.2: 12 files, 24102 bytes\n\nFiles: README.md (392b), reference.md (579b), scripts/element.mjs (8126b), scripts/image.mjs (8158b), scripts/kling.mjs (2388b), scripts/shared/args.mjs (5707b), scripts/shared/auth.mjs (6869b), scripts/shared/client.mjs (4989b), scripts/shared/task.mjs (3808b), scripts/video.mjs (9596b), SKILL.md (10488b), _meta.json (126b)","readmeExcerpt":"Skill: Kling AI Owner: klingai-dev Summary: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生 Tags: latest:2.0.0 Version history: v2.0.0 | 2026-09-23T12:10:53.034Z | use","codeSnippets":[],"executableExamples":[{"language":"bash","snippet":"node skills/klingai/scripts/kling.mjs <video|image|element|account> [options]"},{"language":"bash","snippet":"# Show help\nnode {baseDir}/scripts/kling.mjs --help\n\n# Video\nnode {baseDir}/scripts/kling.mjs video --prompt \"A cat running on the grass\" --output_dir ./output\nnode {baseDir}/scripts/kling.mjs video --image ./photo.jpg --prompt \"Wind blowing hair\"\nnode {baseDir}/scripts/kling.mjs video --prompt \"Match motion of <<<video_1>>>\" --video \"https://...\" --video_refer_type feature\nnode {baseDir}/scripts/kling.mjs video --prompt \"Change background to ...\" --video \"https://...\" --video_refer_type base\nnode {baseDir}/scripts/kling.mjs video --multi_shot true --prompt \"镜头 1, 5, Sunrise over the hills; 镜头 2, 5, Conflict in the valley;\"\nnode {baseDir}/scripts/kling.mjs video --prompt \"A story in three beats: arrival, conflict, resolution\"\n\n# Image\nnode {baseDir}/scripts/kling.mjs image --prompt \"An orange cat on a windowsill\"\nnode {baseDir}/scripts/kling.mjs image --prompt \"Mountain sunset\" --resolution 4k\nnode {baseDir}/scripts/kling.mjs image --model kling-image-o1 --prompt \"<<<element_1>>> on the beach\" --element_ids 123456\nnode {baseDir}/scripts/kling.mjs image --prompt \"Character on the beach\" --element_ids 123456\n\n# Subject / element\nnode {baseDir}/scripts/kling.mjs element --action create --name \"Character A\" --description \"A girl in red\" --ref_type image_refer --frontal_image ./front.jpg --refer_images ./side.jpg\nnode {baseDir}/scripts/kling.mjs element --action list\nnode {baseDir}/scripts/kling.mjs element --action query --task_id <id>\n\n# Account\nnode {baseDir}/scripts/kling.mjs account --help\nnode {baseDir}/scripts/kling.mjs account\nnode {baseDir}/scripts/kling.mjs account --days 90\nnode {baseDir}/scripts/kling.mjs account --resource_pack_name \"My resource pack\"\nnode {baseDir}/scripts/kling.mjs account --bind-url\nnode {baseDir}/scripts/kling.mjs account --bind-url --force\nnode {baseDir}/scripts/kling.mjs account --import-env\nnode {baseDir}/scripts/kling.mjs account --import-credentials --api_key \"<API_KEY>\"\nnode {baseDir}/scripts/kling.mjs account --configure\n\n# Query "},{"language":"bash","snippet":"# explicit frame marking by intent\nnode {baseDir}/scripts/kling.mjs video --model kling-3.0-omni --image a.jpg,b.jpg,c.jpg --image_types first_frame,refer_image,last_frame --prompt \"...\"\n\n# with reference video: image count <= 4\nnode {baseDir}/scripts/kling.mjs video --video \"https://...\" --video_refer_type feature --audio off --image a.jpg,b.jpg --prompt \"...\""}],"parameters":null,"dependencies":[],"permissions":[],"extractedFiles":[{"path":"SKILL.md","content":"---\nname: klingai\nversion: \"2.0.0\"\ndescription: Official Kling AI Skill. Call Kling AI for video generation, image generation, subject management, and account quota inquiry. Use subcommand video / image / element / account by user intent. Use when the user mentions \"Kling\", \"可灵\", \"文生视频\", \"图生视频\", \"参考视频\", \"视频编辑\", \"文生图\", \"图生图\", \"AI 画图\", \"视频生成\", \"图片生成\", \"主体\", \"角色\", \"多镜头\", \"分镜\", \"多图\", \"两张图\", \"首尾帧\", \"组图\", \"余额\", \"资源包\", \"余量\", \"配额\", \"text-to-video\", \"image-to-video\", \"reference video\", \"video editing\", \"text-to-image\", \"multi-shot\", \"omni\", \"4K\", \"subject\", \"character\", \"element\", \"storyboard\", \"series\", \"quota\", \"balance\".\nmetadata: {\"openclaw\":{\"emoji\":\"🎬\",\"requires\":{\"bins\":[\"node\"]},\"primaryEnv\":\"KLING_API_KEY\",\"homepage\":\"https://klingai.com/document-api/\"}}\n---\n\n> **Language**: Respond in the user's language (detect from their message). Use it for explanations, confirmations, errors, and follow-ups. CLI output is bilingual (English / Chinese); present results in the user's language.\n\n# Kling AI\n\nVideo generation, image generation, subject management, and (read-only) account resource/quota inquiry.\nInvoke with subcommand `video` | `image` | `element` | `account` by user intent.\nGeneration tasks are billable; confirm with the user when intent is ambiguous before submitting.\n\n## Invocation\n\nFrom repository root:\n\n```bash\nnode skills/klingai/scripts/kling.mjs <video|image|element|account> [options]\n```\n\nIn examples below, `{baseDir}` means the skill directory (for example `skills/klingai`).\n\n## Routing priority (OpenClaw)\n\n- For Kling/可灵 requests with complex generation requirements, default to this skill (`node {baseDir}/scripts/kling.mjs ...`).\n- Extension (video-generation tool) is allowed only for simple, unambiguous, low-parameter basics: text-to-video or single-image image-to-video.\n- Do not use trial-and-error routing (\"try extension first, then fallback to skill\") unless the user explicitly asks for that flow.\n\n## Intent routing (required)\n\nChoose subcommand from user intent first. HTTP API path and default `model_name` are determined by **Route & model**.\n\n| User intent | Subcommand |\n| --- | --- |\n| Video (t2v, i2v, multi-shot, Omni ref/edit clip via `feature`/`base`, subject-in-video, animation) | `video` |\n| Image (text-to-image, image-to-image, 4K, series, AI drawing) | `image` |\n| Subject / element (create, manage, list, presets, delete) | `element` |\n| Account resources, packs, remaining quota / balance (read-only) | `account` (`--costs`, default) |\n| Credential setup (bind/import) | `account` with `--bind-url` / `--import-env` / `--import-credentials` |\n\nSelection rules:\n- Video-related -> `video`\n- For simple, unambiguous basic t2v or single-image i2v, extension may be used; for other video cases, prefer this skill.\n- Image-only -> `image`\n- Subject CRUD -> `element`\n- Quota/balance/resource packs -> `account` (default `--costs`)\n- Use existing subject in generation -> `video`/`image` + `--element_ids`\n- Create subject first -> `elemen"},{"path":"README.md","content":"# Kling AI\n\nVideo generation, image generation, and subject management.\n\n- **Command**: `node scripts/kling.mjs <video|image|element|account> [options]`\n- **Subcommands**:\n  - `video`: video generation (text-to-video, image-to-video, omni-video, multi-shot)\n  - `image`: image generation (text-to-image, image-to-image, omni-image, 4K/series)\n  - `element`: subject CRUD\n  - `account`: quota query and credential bind/import\n- Choose by user intent; if ambiguous, ask the user first.\n\nSee [SKILL.md](SKILL.md) for full routing/parameters and [reference.md](reference.md) for endpoint mapping.\nOfficial docs: [CN](https://app.klingai.com/cn/dev/document-api) / [Global](https://kling.ai/document-api/quickStart/productIntroduction/overview)."},{"path":"_meta.json","content":"{\n  \"ownerId\": \"kn7bczybw3dwrwf452ghdtzty582nxj0\",\n  \"slug\": \"klingai\",\n  \"version\": \"2.0.0\",\n  \"publishedAt\": 1790165453034\n}"},{"path":"reference.md","content":"# Kling AI — API reference\n\nOfficial source: [klingai.com/document-api/llms.txt](https://klingai.com/document-api/llms.txt)\n\n| Subcommand | Endpoints |\n| ---------- | --------- |\n| `video`    | `POST /text-to-video/kling-3.0` (`kling-3.0-turbo` / `kling-2.6` / `kling-2.5-turbo`); `POST /image-to-video/kling-3.0` (same model suffixes); `POST /omni-video/kling-3.0-omni`; `POST /omni-video/kling-o1`; query `GET /tasks?task_ids=` |\n| `image`    | `POST/GET /v1/images/generations`, `POST/GET /v1/images/omni-image` |\n| `element`  | `POST/GET /v1/general/advanced-custom-elements`, `GET /v1/general/advanced-presets-elements`, `POST /v1/general/delete-advanced-elements` |\n| `account`  | `GET /account/costs` (quota/resource packs); bind flow (no Bearer, bind base): `POST /console/api/auth/skill/init-sessions`, `POST /console/api/auth/skill/exchange` |\n\nAuth and polling notes:\n\n- Official: path-encoded models (all `video` submit paths above) are **new API** and require `Authorization: Bearer <API Key>`. See [authentication](https://klingai.com/document-api/api/get-started/authentication.md).\n- Official: `/v1/...` image and element paths are **old API** (`model_name` in body); API Key Bearer works.\n- Current script: process env `KLING_API_KEY` is sent as Bearer as-is. Else `api_key` in `~/.config/kling/.credentials` is sent as Bearer (**no JWT**). `account --bind` writes that API Key from exchange `ISSUED`. `KLING_TOKEN` is not recognized.\n- Bind APIs (`/console/api/auth/skill/...`) are device-bind endpoints and do not use Bearer.\n- New video submit returns `data.id` + `data.status` (`submitted` / `processing` / `succeeded` / `failed`). Poll `GET /tasks?task_ids=` and read `outputs[].url`.\n- Image/element `/v1` submit still returns `task_id`; poll `GET {submit_path}/{task_id}` until `succeed`/`failed`, then read `task_result`.\n\nAccount mode mapping:\n\n- `account --costs`: remote call to `GET /account/costs`\n- `account --bind` / `account --bind-url`: remote bind calls (`init-sessions` + `exchange`)\n- `account --import-env` / `--import-credentials` / `--configure`: local credential operations only (no business API submit)\n\n## Model docs\n\nOfficial pages (primary source):\n\n- [Docs index](https://klingai.com/document-api/llms.txt)\n- [Video capability map](https://klingai.com/document-api/guides/capability-map/video.md)\n- [Image capability map](https://klingai.com/document-api/guides/capability-map/image.md)\n- [Kling 3.0 T2V](https://klingai.com/document-api/api/video/3-0-omni/text-to-video.md)\n- [Kling 3.0 I2V](https://klingai.com/document-api/api/video/3-0-omni/image-to-video.md)\n- [Kling 3.0 Omni video](https://klingai.com/document-api/api/video/3-0-omni/video-omni.md)\n- [Kling 3.0 Turbo T2V](https://klingai.com/document-api/api/video/3-0-turbo/text-to-video.md)\n- [Kling 3.0 Turbo I2V](https://klingai.com/document-api/api/video/3-0-turbo/image-to-video.md)\n- [Kling O1 video](https://klingai.com/document-api/api/video/o1/video-omni.md)\n- [Kling 2.6 T2V](https://k"},{"path":"skill-card.md","content":"## Description:\n\nCalls Kling AI for video generation, image generation, subject management, and account quota inquiry.\n\nThis skill is ready for commercial/non-commercial use.\n\n## Publisher:\n\n[klingai-dev](https://clawhub.ai/user/klingai-dev)\n\n### License/Terms of Use:\n\nMIT-0\n\n## Use Case:\n\nExternal users and developers use this skill to turn Kling AI generation, subject-management, and quota requests into validated CLI actions. It helps agents choose the correct video, image, element, or account workflow before submitting billable Kling API tasks.\n\n### Deployment Geography for Use:\n\nGlobal\n\n## Known Risks and Mitigations:\n\nRisk: Prompts and selected media are sent to Kling AI for generation and subject workflows.\n\nMitigation: Submit only prompts and media that are appropriate to share with Kling AI, and confirm ambiguous generation intent before starting billable tasks.\n\nRisk: Kling API keys may be persisted under the Kling storage root when bind, import, or configure flows are used.\n\nMitigation: Prefer session-only KLING_API_KEY for non-persistent use, or protect and periodically review the local Kling credentials storage.\n\nRisk: Subject deletion is explicit but not separately confirmed by the skill.\n\nMitigation: Review delete commands and subject identifiers carefully before execution.\n\nRisk: Generated assets may be removed by the platform after a retention period.\n\nMitigation: Download and retain needed outputs locally after successful generation.\n\n## Reference(s):\n\n- [ClawHub Skill Page](https://clawhub.ai/klingai-dev/skills/klingai)\n- [Kling AI API Documentation](https://klingai.com/document-api/)\n- [Kling AI Docs Index](https://klingai.com/document-api/llms.txt)\n- [Kling API Authentication](https://klingai.com/document-api/api/get-started/authentication.md)\n- [Video Capability Map](https://klingai.com/document-api/guides/capability-map/video.md)\n- [Image Capability Map](https://klingai.com/document-api/guides/capability-map/image.md)\n- [Kling Elements API](https://klingai.com/document-api/api/video/3-0-omni/elements.md)\n- [Account Usage API](https://klingai.com/document-api/api/assets/account-usage.md)\n\n## Skill Output:\n\n**Output Type(s):** [text, markdown, shell commands, configuration, files, guidance]\n\n**Output Format:** [Markdown guidance with shell commands; CLI runs print task status and local output paths.]\n\n**Output Parameters:** [1D]\n\n**Other Properties Related to Output:** [Generated media can be downloaded to the selected output directory; account and subject commands may print status, quota, or task identifiers.]\n\n## Skill Version(s):\n\n2.0.0 (source: frontmatter and server release metadata)\n\n## Ethical Considerations:\n\nUsers should evaluate whether this skill is appropriate for their environment, review any generated or modified files before relying on them, and apply their organization's safety, security, and compliance requirements before deployment."}],"languages":[],"docsSourceLabel":"CLAWHUB","editorialOverview":null,"editorialQuality":{"score":100,"threshold":65,"status":"thin","wordCount":1825,"uniquenessScore":39,"reasons":["uniqueness-below-45"]}},"media":{"evidence":{"source":"no-media","verified":false,"confidence":"low","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":"No screenshots, media assets, or demo links are available."},"primaryImageUrl":null,"mediaAssetCount":0,"assets":[],"demoUrl":null},"ownerResources":{"evidence":{"source":"unclaimed","verified":false,"confidence":"low","updatedAt":"2026-10-09T04:37:23.518Z","emptyReason":"This page has not been claimed by the agent owner."},"hasCustomPage":false,"customPageUpdatedAt":null,"customLinks":[],"structuredLinks":{"docsUrl":null,"demoUrl":null,"supportUrl":null,"pricingUrl":null,"statusUrl":null},"customPage":null},"relatedAgents":{"evidence":{"source":"protocol-neighbors","verified":false,"confidence":"medium","updatedAt":"2026-10-09T17:49:47.411Z","emptyReason":null},"items":[{"id":"b917f68a-ebff-438e-84f8-3f4b2494c0bc","entityType":"agent","canonicalPath":"/agent/activepieces-activepieces","slug":"activepieces-activepieces","name":"activepieces","description":"AI Agents & MCPs & AI Workflow Automation • (~400 MCP servers for AI agents) • AI Automation / AI Agent with MCPs • AI Workflows & AI Agents • MCPs for AI Agents","url":"https://github.com/activepieces/activepieces","homepage":"https://www.activepieces.com","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-15T02:22:12.426Z","createdAt":"2026-02-25T03:38:12.412Z","downloads":null},{"id":"5cb26759-3a39-483f-94cf-276a98c13bb8","entityType":"agent","canonicalPath":"/agent/cherryhq-cherry-studio","slug":"cherryhq-cherry-studio","name":"cherry-studio","description":"AI productivity studio with smart chat, autonomous agents, and 300+ assistants. Unified access to frontier LLMs","url":"https://github.com/CherryHQ/cherry-studio","homepage":"https://cherry-ai.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-11T14:38:40.986Z","createdAt":"2026-02-25T03:38:19.379Z","downloads":null},{"id":"8ebccd8e-3863-4187-8355-c3f14e1f9edf","entityType":"agent","canonicalPath":"/agent/iofficeai-aionui","slug":"iofficeai-aionui","name":"AionUi","description":"Free, local, open-source 24/7 Cowork app and OpenClaw for Gemini CLI, Claude Code, Codex, OpenCode, Qwen Code, Goose CLI, Auggie, and more | 🌟 Star if you like it!","url":"https://github.com/iOfficeAI/AionUi","homepage":"https://www.aionui.com","source":"GITHUB_REPOS","protocols":["MCP","OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-04-10T18:48:31.762Z","createdAt":"2026-02-25T03:38:16.584Z","downloads":null},{"id":"6f6582d0-5d76-4f0f-b81d-86520247950b","entityType":"agent","canonicalPath":"/agent/copilotkit-copilotkit","slug":"copilotkit-copilotkit","name":"CopilotKit","description":"The Frontend for Agents & Generative UI. React + Angular","url":"https://github.com/CopilotKit/CopilotKit","homepage":"https://docs.copilotkit.ai","source":"GITHUB_REPOS","protocols":["OPENCLAW"],"capabilities":[],"safetyScore":100,"overallRank":70,"updatedAt":"2026-03-25T09:50:57.846Z","createdAt":"2026-02-25T03:39:14.617Z","downloads":null}],"links":{"hub":"/agent","source":"/agent/source/clawhub","protocols":[{"label":"OpenClaw","href":"/agent/protocol/openclew"}]}}}