Kling Official Direct API
Use this skill for OpenMontage tools with
provider="kling_official"
. This is not the fal.ai Kling gateway. Official Kling uses
, optional
, and
Authorization: Bearer <KLING_API_KEY>
.
Provider Split
- uses fal.ai, , fal.ai queue URLs, and .
- uses Kling official API, , official task protocols, and
provider="kling_official"
.
- uses the same official auth and task protocol for image generation.
- uses the official audio TTS endpoint and stays in the existing capability.
- and use official avatar/lip-sync endpoints and stay in the existing capability. They do not replace local or .
Never silently switch between these paths. If the selected provider is unavailable, surface the blocker and ask before substituting.
Auth And Endpoint
Default base URL:
text
https://api-singapore.klingai.com
Users may override it with
, for example for a regional endpoint. All requests send JSON and:
text
Authorization: Bearer <KLING_API_KEY>
Task Protocols
Classic APIs:
- Create ID path:
- Statuses: , , ,
- Result paths:
data.task_result.videos[]
, data.task_result.images[]
, data.task_result.audios[]
Turbo APIs:
- Create ID path:
- Poll path:
- Statuses: , , ,
- Result path:
Keep the parsers separate. Do not write a fuzzy parser that guesses between
and
or between
and
.
Omni References
Video Omni and Image Omni stay inside the existing provider tools through
.
Do not create selector-level Omni operations.
Video Omni accepts official reference structures:
- with and optional such as or .
- with , official values such as or , and optional .
- with official values.
- Structured ; do not split natural language into shots automatically.
Local image references may be normalized through
. Local video paths must not be silently uploaded through fal.ai; ask for or require a reachable URL.
Image Omni accepts
with official
values. Prompt placeholders such as
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.
Capability Boundaries
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.
- Do not add or capabilities from inside a provider implementation.
- Do not let video effects enter the ordinary selector path.
- Do not disguise short sound effects as long background music unless a pipeline explicitly consumes that shape and the tool's / says so.
Video Parameters
Use
for OpenMontage semantics:
Use
for official protocol choice:
Important constraints:
- Official video provider input schema must not expose top-level ; use or .
- Classic image-to-video accepts or a local path converted to raw base64 in official field .
- Turbo image-to-video requires a URL first frame. Do not upload local files through fal.ai as a fallback.
- Send only where the current schema supports it: Classic text-to-video, Turbo text-to-video, and Video Omni.
- Default paid path should avoid , native sound, or batch behavior unless explicitly selected.
Image Parameters
Generation/edit path:
- is required and should stay under the official 2500 character limit.
- passes through as official .
- is converted to raw base64 and sent as official .
- can be or .
Omni path:
- Put references in using official values.
- Use prompt placeholders such as only when the prompt needs to bind a specific reference image.
TTS Parameters
Require an explicit
unless an official account-specific default has been verified. Do not hard-code a made-up voice. Download every returned audio item, set
to the first local file, and include
,
,
,
, and non-zero
.
Avatar Parameters
uses
/v1/videos/avatar/image2video
and accepts:
- avatar image via URL or local path converted to raw base64
- or
- optional
- , such as or
Keep it separate from local
. Pipelines that want Kling avatar output must list and choose it explicitly.
Lip Sync Parameters
POST /v1/videos/identify-face
with or ; read faces from
POST /v1/videos/advanced-lip-sync
with and one item containing , or , and the sound start/end/insert times
Local video paths must not be silently uploaded through fal.ai or any other provider. If multiple faces are returned and the user did not pass
or
, stop and return the face list for confirmation unless
was explicitly set. If auto-selecting, record the selection reason and selected face in the result/artifact.
Audio Effects And Video Effects
Official Kling audio effects (
,
) and video effects (
) are intentionally not default OpenMontage selector tools. Record the non-mapping reason in docs/tests instead of registering tools that current pipelines might misuse.
Elements Helper
Elements are an internal Kling Official helper, not a new OpenMontage tool capability.
Use
to normalize
element_list[].element_id
, optionally query read-only element endpoints, and record element metadata when queried. Do not create or delete elements from the default provider path.
Account Usage Helper
Account Usage is diagnostic only. Use
for low-frequency
checks, with local cache and throttle protection. Do not call it before every generation and do not put it in selectors or production pipeline stages.
For
or
, surface that the account or resource pack is exhausted and include an account-usage diagnostic hint.
Callback Notes
Providers may accept
, but polling remains the default execution mode.
- Classic and Omni paths pass at the top level.
- Turbo paths pass it as .
- Successful results should record , , the , and .
- Validate callback URLs before sending; only absolute or URLs should pass.
Error Handling
Surface official
,
, and
whenever available.
Do not retry:
- Auth failures: -
- Balance/resource-pack exhaustion: ,
- Permission/model access:
- Parameter errors: ,
- Safety policy:
Limited retry is acceptable for:
- request too fast
- concurrency/resource-pack slot limit
- , , server/maintenance/backlog errors
For
, explain that the account hit a concurrency or resource-pack slot limit.
Cost Governance
Official Kling is a paid remote API. Provider tools must return non-zero conservative estimates from
and include
on successful paid results. Treat estimates as low-confidence until account usage reconciliation is implemented.
High-cost Omni inputs such as multiple references, element IDs,
,
, and
must increase or flag the cost estimate.
Prompt Notes
For video, start from the universal OpenMontage video prompt skeleton: subject, subject motion, scene, spatial framing, and camera. Kling tends to respond well to clear temporal action order, camera movement verbs, and concise negative prompts. For reference workflows, state what should stay consistent from the reference and what should change.