Get available credits
Shows the balance your API tasks spend from: `total` unexpired credits, the part `reserved` by videos still in progress (web app included), and what is left `available` for the next task.
/v1/creditsA secret key from Settings → API keys, sent as a Bearer token. Call the API with it from your own server only.
In: header
Response Body
curl "https://kling4.video/v1/credits" \ -H "Authorization: Bearer sk_sd_example"{
"total": 300,
"reserved": 15,
"available": 285
}{
"error": {
"code": "invalid_api_key",
"message": "The API key is invalid, expired, or revoked.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "rate_limit_exceeded",
"message": "API rate limit exceeded. Try again later.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}{
"error": {
"code": "internal_error",
"message": "The request could not be completed.",
"param": null,
"request_id": "req_2YgM6pg5oM2WkKpQ"
}
}Get a video task GET
Reads one video task on your account, including tasks started in the web app. Keep polling while `status` is `pending` or `processing`, waiting a little longer between calls as the render goes on. Once the task is `completed`, `output.video_url` links to the file that Kling4 stored for you.
Errors and retries
Every status and error code the Kling4 API returns, what each one means for your request, and how to retry without paying for the same video twice.