Kling 4.0kling-4.ai Docs
Kling 4.0kling-4.ai Docs
Homepage

Getting Started

Overview

API Reference

X (Twitter)

Poll & List Jobs

Fetch a single job, list your recent jobs, or refresh all active jobs — and how job status moves from queued to completed.

Job lifecycle

Every job moves through these statuses:

StatusMeaning
queuedAccepted; waiting for a render slot.
processingRendering — progress climbs from 0 to 100.
completedDone. resultUrl and thumbnailUrl are set.
failedSomething went wrong; errorMessage says what.
cancelledThe job was cancelled before completing.

Fetch one job

GET /api/ai-video/jobs/{id}
curl 'https://kling-4.ai/api/ai-video/jobs/0b6c2f6e-6d5f-4a4e-9d3e-7c9a1f2b8d41' \
  -H 'x-api-key: YOUR_API_KEY'

Returns { "job": … } with the same shape as job creation. This endpoint refreshes the job from the render pipeline on every call, so it's the one to poll. Every 10–15 seconds is a sensible interval; renders typically take a few minutes.

Unknown or someone-else's job IDs return 404 JOB_NOT_FOUND.

List your jobs

GET /api/ai-video/jobs
curl 'https://kling-4.ai/api/ai-video/jobs' \
  -H 'x-api-key: YOUR_API_KEY'

Returns { "jobs": [...] } — your 50 most recent jobs, newest first. This reads from our database without hitting the render pipeline, so it's cheap to call but may lag a refresh behind reality for jobs that are still rendering.

Sync all active jobs

POST /api/ai-video/jobs/sync
curl -X POST 'https://kling-4.ai/api/ai-video/jobs/sync' \
  -H 'x-api-key: YOUR_API_KEY'

Refreshes every queued/processing job you own against the render pipeline in one call and returns the updated list. Useful when your app resumes after being offline and you don't want to poll each job individually.

Result URLs expire

resultUrl points at our CDN, but the link is time-limited — the expiry timestamp is in resultExpiresAt. Treat the URL as a pickup window, not permanent storage:

if (job.status === 'completed' && job.resultUrl) {
  const video = await fetch(job.resultUrl);
  await fs.promises.writeFile(`out/${job.id}.mp4`, Buffer.from(await video.arrayBuffer()));
}

Download the file into your own storage as soon as the job completes. The job record itself (prompt, parameters, status history) stays in your history either way.

Table of Contents

Job lifecycle
Fetch one job
List your jobs
Sync all active jobs
Result URLs expire