API Version 3.0

Kling API Documentation

The Kling 3 API allows you to integrate hyper-realistic AI video generation directly into your applications. Generate cinema-quality videos programmatically with our RESTful API.

Fast Integration

Production-ready in minutes with our SDK libraries

Enterprise Security

SOC 2 Type II certified infrastructure

99.9% Uptime

Global infrastructure with automatic failover

Authentication

The Kling API uses API keys for authentication. Include your API key in the Authorization header with the Bearer scheme.

Authentication Header
Authorization: Bearer YOUR_API_KEY_HERE

Getting Your API Key

Create a free account and navigate to your dashboard to generate your API key. Keep it secure and never expose it in client-side code.

Quick Start

Get up and running with a simple video generation in under 5 minutes.

Install the SDK

npm
npm install @kling/api-client

Generate Your First Video

JavaScript
import { KlingClient } from '@kling/api-client';

const kling = new KlingClient({
  apiKey: process.env.KLING_API_KEY
});

const video = await kling.generate({
  prompt: "A serene mountain landscape at golden hour",
  model: "kling-3",
  duration: 5,
  resolution: "1080p"
});

console.log('Video URL:', video.url);

Generate Video

POST /v1/generate

Create a new video generation job. This is an asynchronous operation that returns a job ID.

Request Body

Parameter Type Description
prompt string Description of the video scene *
model string Model version (default: "kling-3")
duration integer Video length in seconds (5-120)
resolution string "720p", "1080p", "4k"
fps integer Frames per second (24, 30, 60)
Example Request
curl -X POST https://api.klinggenerator.com/v1/generate \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic shot of waves crashing on a beach",
    "model": "kling-3",
    "duration": 10,
    "resolution": "1080p",
    "fps": 30
  }'
Response (200 OK)
{
  "job_id": "job_abc123xyz789",
  "status": "processing",
  "created_at": "2025-02-14T10:30:00Z",
  "estimated_completion": "2025-02-14T10:32:00Z"
}

Check Status

GET /v1/jobs/{job_id}

Check the status of a video generation job.

Response
{
  "job_id": "job_abc123xyz789",
  "status": "completed",
  "progress": 100,
  "video_url": "https://cdn.klinggenerator.com/videos/abc123.mp4",
  "thumbnail_url": "https://cdn.klinggenerator.com/thumbs/abc123.jpg",
  "duration": 10,
  "resolution": "1080p",
  "created_at": "2025-02-14T10:30:00Z",
  "completed_at": "2025-02-14T10:31:45Z"
}

Available Models

kling-3

RECOMMENDED
10B+

Latest generation model with physics-perfect motion coherence and native 4K support.

Max Duration: 120 seconds
Max Resolution: 4K (3840×2160)

kling-2

LEGACY
5B

Previous generation model. Still available for compatibility.

Max Duration: 60 seconds
Max Resolution: 1080p

Error Codes

Code Description
401 Unauthorized - Invalid or missing API key
402 Payment Required - Insufficient credits
429 Rate Limit Exceeded - Too many requests
500 Internal Server Error - Contact support

Rate Limits

Free Tier
10
requests / day
Pro Tier
1,000
requests / day
Enterprise
Custom
contact sales

Rate Limit Headers

Check X-RateLimit-Remaining header in responses to monitor your usage.

Ready to Build?

Get your API key and start generating videos in minutes.