Kling AI Provider Guide
Image-to-video generation via Kling AI
Overview
Kling AI generates cinematic video clips from an
input image + motion prompt. NeuroLink dispatches via
output: { mode: 'video' } with the video handler selecting Kling when
provider is "kling".
Key Facts
- Auth: JWT-signed bearer token
- Async: Task submission + polling
- Output: MP4
- Input: Image + prompt (image is required)
Quick Start
1. Get API Credentials
Sign up at https://kling.ai/ and grab the Access Key ID + Secret from the developer dashboard.
2. Configure
KLING_ACCESS_KEY=your-access-key
KLING_SECRET_KEY=your-secret-key
3. Generate a Video
import { NeuroLink } from "@juspay/neurolink";
import { readFileSync, writeFileSync } from "node:fs";
const ai = new NeuroLink();
const result = await ai.generate({
provider: "kling",
output: {
mode: "video",
video: { provider: "kling", resolution: "720p", length: 5 },
},
input: {
text: "Smooth camera dolly through the scene, cinematic colour grade",
images: [readFileSync("./input.jpg")],
},
});
if (result.video?.data) {
writeFileSync("./output.mp4", result.video.data);
}
CLI Usage
pnpm run cli generate "Camera pans left across the city" \
--image ./skyline.jpg \
--provider kling --videoOutput ./output.mp4
Configuration Reference
| Environment Variable | Required | Description |
|---|---|---|
KLING_ACCESS_KEY | Yes | Kling access key |
KLING_SECRET_KEY | Yes | Kling secret key |