$npx -y skills add calesthio/OpenMontage --skill kling-officialOfficial Kling direct API guidance for OpenMontage providers. Use before calling kling_official_video, kling_official_image, kling_tts, kling_avatar, or kling_lip_sync.
| 1 | # Kling Official Direct API |
| 2 | |
| 3 | Use this skill for OpenMontage tools with `provider="kling_official"`. This is not the fal.ai Kling gateway. Official Kling uses `KLING_API_KEY`, optional `KLING_API_BASE_URL`, and `Authorization: Bearer <KLING_API_KEY>`. |
| 4 | |
| 5 | ## Provider Split |
| 6 | |
| 7 | - `kling_video` uses fal.ai, `FAL_KEY`, fal.ai queue URLs, and `provider="kling"`. |
| 8 | - `kling_official_video` uses Kling official API, `KLING_API_KEY`, official task protocols, and `provider="kling_official"`. |
| 9 | - `kling_official_image` uses the same official auth and task protocol for image generation. |
| 10 | - `kling_tts` uses the official audio TTS endpoint and stays in the existing `tts` capability. |
| 11 | - `kling_avatar` and `kling_lip_sync` use official avatar/lip-sync endpoints and stay in the existing `avatar` capability. They do not replace local `talking_head` or `lip_sync`. |
| 12 | |
| 13 | Never silently switch between these paths. If the selected provider is unavailable, surface the blocker and ask before substituting. |
| 14 | |
| 15 | ## Auth And Endpoint |
| 16 | |
| 17 | Default base URL: |
| 18 | |
| 19 | ```text |
| 20 | https://api-singapore.klingai.com |
| 21 | ``` |
| 22 | |
| 23 | Users may override it with `KLING_API_BASE_URL`, for example for a regional endpoint. All requests send JSON and: |
| 24 | |
| 25 | ```text |
| 26 | Authorization: Bearer <KLING_API_KEY> |
| 27 | ``` |
| 28 | |
| 29 | ## Task Protocols |
| 30 | |
| 31 | Classic APIs: |
| 32 | |
| 33 | - Create ID path: `data.task_id` |
| 34 | - Statuses: `submitted`, `processing`, `succeed`, `failed` |
| 35 | - Result paths: `data.task_result.videos[]`, `data.task_result.images[]`, `data.task_result.audios[]` |
| 36 | |
| 37 | Turbo APIs: |
| 38 | |
| 39 | - Create ID path: `data.id` |
| 40 | - Poll path: `GET /tasks?task_ids=<id>` |
| 41 | - Statuses: `submitted`, `processing`, `succeeded`, `failed` |
| 42 | - Result path: `data[0].outputs[]` |
| 43 | |
| 44 | Keep the parsers separate. Do not write a fuzzy parser that guesses between `task_id` and `id` or between `succeed` and `succeeded`. |
| 45 | |
| 46 | ## Omni References |
| 47 | |
| 48 | Video Omni and Image Omni stay inside the existing provider tools through `api_family="omni"`. |
| 49 | Do not create selector-level Omni operations. |
| 50 | |
| 51 | Video Omni accepts official reference structures: |
| 52 | |
| 53 | - `image_list[]` with `image_url` and optional `type` such as `first_frame` or `end_frame`. |
| 54 | - `video_list[]` with `video_url`, official `refer_type` values such as `feature` or `base`, and optional `keep_original_sound`. |
| 55 | - `element_list[]` with official `element_id` values. |
| 56 | - Structured `multi_prompt[]`; do not split natural language into shots automatically. |
| 57 | |
| 58 | Local image references may be normalized through `tools/_kling/media.py`. Local video paths must not be silently uploaded through fal.ai; ask for or require a reachable URL. |
| 59 | |
| 60 | Image Omni accepts `image_list[]` with official `image` values. Prompt placeholders such as `<<<image_1>>>` must map stably to the provided image order. If the prompt already contains placeholders, validate that the referenced images exist and do not insert duplicates. |
| 61 | |
| 62 | ## Capability Boundaries |
| 63 | |
| 64 | TTS, avatar, and lip sync are provider additions to existing OpenMontage capabilities. Audio effects and video effects are official Kling endpoints, but they are not registered as default OpenMontage tools until a pipeline has a stable capability slot for them. |
| 65 | |
| 66 | - Do not add `sound_effects` or `video_effects` capabilities from inside a provider implementation. |
| 67 | - Do not let video effects enter the ordinary `video_generation` selector path. |
| 68 | - Do not disguise short sound effects as long background music unless a pipeline explicitly consumes that shape and the tool's `best_for` / `not_good_for` says so. |
| 69 | |
| 70 | ## Video Parameters |
| 71 | |
| 72 | Use `operation` for OpenMontage semantics: |
| 73 | |
| 74 | - `text_to_video` |
| 75 | - `image_to_video` |
| 76 | - `reference_to_video` |
| 77 | |
| 78 | Use `api_family` for official protocol choice: |
| 79 | |
| 80 | - `classic` |
| 81 | - `turbo` |
| 82 | - `omni` |
| 83 | |
| 84 | Important constraints: |
| 85 | |
| 86 | - Official video provider input schema must not expose top-level `image_url`; use `reference_image_url` or `reference_image_path`. |
| 87 | - Classic image-to-video accepts `reference_image_url` or a local path converted to raw base64 in official field `image`. |
| 88 | - Turbo image-to-video requires a URL first frame. Do not upload local files through fal.ai as a fallback. |
| 89 | - Send `aspect_ratio` only where the current schema supports it: Classic text-to-video, Turbo text-to-video, and Video Omni. |
| 90 | - Default paid path should avoid `4k`, native sound, or batch behavior unless explicitly selected. |
| 91 | |
| 92 | ## Image Parameters |
| 93 | |
| 94 | Use `api_family="generation"` for `/v1/images/generations` and `api_family="omni"` for `/v1/images/omni-image`. |
| 95 | |
| 96 | Generation/edit path: |
| 97 | |
| 98 | - `prompt` is required and should stay under the official 2500 character limit. |
| 99 | - `image_url` passes through as official `image`. |
| 100 | - `image_path` is converted to raw base64 and sent as official `image`. |
| 101 | - `image_reference` can be `subject` or `face`. |
| 102 | |
| 103 | Omni path: |
| 104 | |
| 105 | - Put references in `image_list[]` u |