- Submit the job to the model’s capability endpoint and get back a prediction id immediately.
- Poll the result endpoint with that id until the job completes.
1. Submit a job
Send aPOST to the model’s capability endpoint:
/api/v3/kling/kling-v2.6-pro/text-to-video. The exact path for every model is listed in the Endpoints table on its catalog page. The response returns right away with an id and an initial status:
2. Poll for the result
Fetch the result endpoint until the prediction reaches a terminal state:| Status | Meaning |
|---|---|
queued | Accepted and waiting for capacity. |
processing | The model is generating. |
completed | Done — the response includes the output (typically URLs for media). |
failed | The job errored; the response includes an error body. |
Full example
Polling guidance
- Poll every 2–5 seconds for short jobs (images, audio clips); stretch to 10–15 seconds for long video renders.
- Set an overall deadline. Give up and surface an error after a sensible ceiling for the media type rather than polling forever.
- Retry the poll, not the submit. A dropped poll request is harmless to retry; resubmitting the job creates (and bills) a second generation.
- Download outputs promptly. Completed predictions typically return media URLs — fetch and persist them on your side rather than hotlinking.