Authorization: Bearer $MIXROUTE_API_KEY and send JSON. The model ID belongs in the URL, not a body model field. Do not add /v1 or wrap the request in metadata.
Supported Models
Use full identifiers available to your account. Endpoints and models must match:
kling-3.0-omni and kling-o1 use omni-video, not the standard text/image endpoints. Motion control uses kling-3.0 or kling-2.6, not a separate motion model.
Workflow
- Select the endpoint and submit its native body.
- Check both HTTP status and JSON
code;code=0means the request succeeded. - Store submission
data.idand query one gateway task ID at a time. - After
succeeded, readurlfromtype=videoentries indata[0].outputs. - Never send your MixRoute Key to the result CDN. A submission timeout does not prove no task was created; do not retry POST automatically.
Common Options
Defaults and Parameter Structure
The gateway fills missingsettings.resolution with 720p and missing settings.duration with 5, except for motion control. Text-to-video defaults to 16:9. Image-to-video, Omni and motion control place prompts in a contents item of type prompt; only text-to-video uses root prompt. Explicitly set billing-sensitive fields, especially 1080p for 2.6 native audio.
Names and enum values are case-sensitive. Out-of-range values are not silently changed to another specification; each model still has its own constraints. Element and voice IDs must be accessible to the routed upstream account; assets in a personal Kling account are not automatically shared.
Billing
The following base rates are USD per generated second. Final charges depend on current Model Marketplace pricing, your account group multiplier and the console bill; resource-package or account-specific discounts are not included.
Submission reserves quota; completion settles against actual fractional seconds in
outputs[].duration, not only the requested integer duration. Motion control reserves 15 seconds and adjusts up or down to actual output duration. Failed or timed-out tasks release reserved quota. Optional native billing is upstream information, not proof of final MixRoute charges. Unsupported tiers are not free tiers.
For task states, errors and a complete polling example, see Query Kling Task.