Kling v2.6 Image-to-Video
Kling v2.6 Image-to-Video animates reference images into video with synchronized native audio, including speech, sound effects, and ambient sound, in a single API request with first/last frame control at up to 1080p. Your use is subject to Kling AI's Terms & Privacy Policies.
View API reference- Price
- $0.04, Per secondLowest available configuration
import { experimental_generateVideo as generateVideo } from 'ai';
const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: 'A serene mountain lake at sunrise.'});Copy link to headingPlayground
Try out Kling v2.6 Image-to-Video by Kling AI. Usage is billed to your team at API rates. Free users (those who haven't made a payment) get $5 of credits every 30 days.
Your generated video will appear here.
Copy link to headingProviders
Route requests across multiple providers. Copy a provider slug to set your preference. Visit the docs for more info. Using a provider means you agree to their terms, listed under Legal.
| Provider |
|---|
Getting started
Generate videos with Kling v2.6 Image-to-Video using the experimental_generateVideo function from AI SDK 6 or later. AI Gateway handles routing and polls until the video is ready.
Install the AI SDK (pnpm add ai dotenv), create an API key from the API Keys page, and set it as AI_GATEWAY_API_KEY in your environment. Full setup is covered in the video generation quickstart.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, providerOptions: { klingai: { mode: 'std', }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Top-level parameters
Exercise the supported top-level parameters: prompt.image, prompt.text, and duration.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, duration: 5, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);| Parameter | Type | Required | Description |
|---|---|---|---|
prompt.image | string | Yes | URL of the image to animate. |
prompt.text | string | No | Description of the motion or animation. Max 2500 characters. |
duration | 5 | 10 | No | Video length in seconds. 5 or 10 seconds. |
resolution | string | No | Resolution ('1280x720', '1920x1080'). |
aspectRatio | string | No | Aspect ratio ('16:9', '9:16', '1:1'). |
generateAudio | boolean | No | Generate synchronized audio with the video. |
frameImages | Array<{ image: string | Buffer; frameType: 'first_frame' | 'last_frame' }> | No | First and last frames of the clip. A first_frame entry replaces prompt.image and wins when both are set, and adding a last_frame interpolates between the two. Video is not accepted and is ignored with a warning. |
inputReferences | Array<string | Buffer> | No | Reference images that the model combines into a new scene, which switches the call to reference-to-video. Images only — a video reference is ignored with a warning. Cannot be combined with prompt.image, frameImages, or imageTail. |
Input limits
| Input | Formats | Sources | Max count | Max size | Limits |
|---|---|---|---|---|---|
| Text | — | — | — | — | Up to 2500 characters |
| Image | jpg, jpeg, png | url, base64, buffer | 2 | 10 MB | ≥300px · aspect 2:5–5:2 |
Provider options
Load the always-compatible KlingAI options under providerOptions.klingai. The mutually exclusive feature controls — first/last frame (frameImages), reference-to-video (inputReferences), motion brush (dynamicMasks / staticMask), cameraControl, and voice/multi-shot — are shown in their own examples below.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/cat.png', text: 'The cat slowly turns its head and blinks', }, duration: 5, generateAudio: true, providerOptions: { klingai: { mode: 'pro', negativePrompt: 'blurry, low quality', watermarkEnabled: true, pollIntervalMs: 5000, pollTimeoutMs: 600000, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Pass KlingAI-specific options under providerOptions.klingai in your generateVideo call.
| Parameter | Type | Required | Description |
|---|---|---|---|
mode | 'std' | 'pro' | No | 'std' for standard quality. 'pro' for professional quality. Defaults to 'std'. |
negativePrompt | string | No | What to avoid in the video. Max 2500 characters. |
voiceList | array | No | Voice IDs for speech. Max 2 voices. Requires generateAudio: true. Cannot coexist with elementList. |
imageTail | string | Buffer | No | The last frame (ending image). Same format requirements as prompt.image. Legacy alternative to the top-level frameImages, used only when frameImages is omitted. |
cameraControl.type | string | No | Camera movement type: 'simple', 'down_back', 'forward_up', 'right_turn_forward', or 'left_turn_forward'. |
cameraControl.config | object | No | Movement configuration. Required when type is 'simple'. Set one of horizontal, vertical, pan, tilt, roll, or zoom in range [-10, 10] and leave the others at 0. |
staticMask | string | No | Mask image for areas that should remain static. |
dynamicMasks | array | No | Array of dynamic mask configurations (up to 6). Each has mask (image for areas that should move) and trajectories (motion path coordinates, 2-77 points for a 5s video). |
watermarkEnabled | boolean | No | Generate a watermarked result alongside the video. |
pollIntervalMs | number | No | How often to check task status. Defaults to 5000. |
pollTimeoutMs | number | No | Maximum wait time. Defaults to 600000 (10 minutes). |
Base64 image encoding
When passing an image as base64 (for example prompt.image), submit only the raw base64 string. Do not include a data:image/png;base64, prefix.
Mutually exclusive features
First/last frame (frameImages), reference-to-video (inputReferences), motion brush (dynamicMasks / staticMask), and camera control (cameraControl) cannot be combined. Use only one of these per request.
The top-level parameters win over their provider-option equivalents: a first_frame in frameImages overrides prompt.image, and a last_frame overrides providerOptions.klingai.imageTail.
Passing inputReferences switches the model to reference-to-video, which ignores prompt.image, frameImages, and imageTail.
voiceList cannot coexist with elementList.
Audio and voice
Set generateAudio: true to enable audio.
Reference voices in your prompt with the <<<voice_1>>> syntax, where the number matches the order of entries in voiceList. You can use up to 2 voices per video, and voice generation requires generateAudio: true.
First and last frame
Generate a video that transitions between a starting and ending image, interpolating the motion between the two. Pass both frames through the top-level frameImages, tagging one first_frame and one last_frame. Mutually exclusive with motion brush and camera control.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const firstFrame = fs.readFileSync('start.png'); const lastFrame = fs.readFileSync('end.png');
const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: 'Smooth transition between the two scenes', frameImages: [ { image: firstFrame, frameType: 'first_frame' }, { image: lastFrame, frameType: 'last_frame' }, ], providerOptions: { klingai: { mode: 'pro', }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Reference to video
Combine reference images into a brand-new scene described by your prompt. Passing inputReferences selects reference-to-video, so leave out prompt.image, frameImages, and imageTail — the references guide what the characters look like rather than becoming the video content.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: 'The two characters meet and walk together through a sunny park', inputReferences: [ 'https://example.com/character-1.png', 'https://example.com/character-2.png', ], aspectRatio: '16:9', duration: 5, providerOptions: { klingai: { mode: 'std', }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Camera control
Control camera movement during generation. Use a preset movement type or 'simple' with a config that sets one axis (others stay at 0).
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/landscape.png', text: 'A serene mountain landscape', }, providerOptions: { klingai: { mode: 'std', cameraControl: { type: 'simple', config: { zoom: 5, horizontal: 0, vertical: 0, pan: 0, tilt: 0, roll: 0, }, }, }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Motion brush
Control which parts of the image move and how using mask images. Mutually exclusive with first/last frame and camera control.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/scene.png', text: 'A ball bouncing across the scene', }, providerOptions: { klingai: { mode: 'std', dynamicMasks: [ { mask: 'https://example.com/ball-mask.png', trajectories: [ { x: 100, y: 200 }, { x: 200, y: 300 }, { x: 300, y: 200 }, { x: 400, y: 300 }, ], }, ], }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Voice generation
Add speech using voice IDs. Requires generateAudio: true. Reference voices in the prompt with the <<<voice_1>>> syntax.
import { experimental_generateVideo as generateVideo } from 'ai';import fs from 'node:fs';import 'dotenv/config';
async function main() { const result = await generateVideo({ model: 'klingai/kling-v2.6-i2v', prompt: { image: 'https://example.com/person.png', text: 'The person<<<voice_1>>> says: "Hello, welcome to my channel"', }, generateAudio: true, providerOptions: { klingai: { mode: 'std', voiceList: [{ voiceId: 'your_voice_id' }], }, }, });
// Save the generated video fs.writeFileSync('output.mp4', result.videos[0].uint8Array);
console.log('Video saved to output.mp4');}
main().catch(console.error);Copy link to headingAbout Kling v2.6 Image-to-Video
Kling v2.6 Image-to-Video is the first Kling image-to-video release with native audio generation. It eliminates the post-production step of aligning a separately rendered audio track to a silent clip. The audio layer covers three categories: natural speech in Chinese and English, action-synchronized sound effects, and environmental ambience. All audio renders in the same inference pass that produces the video frames.
The reference image grounds the visual output. The model animates the scene depicted in the provided image rather than generating visual content from scratch. First-frame and last-frame anchoring carry forward from prior versions. You can define both the opening and closing visual states, and the model fills in the motion path between those anchors. This works well for product reveals, character entrances, or controlled transitions where you've defined the start and end configurations photographically.
For content teams working on social media clips, product demos, or localized marketing materials, audio-video unification in v2.6 reduces pipeline stages per finished asset. A reference product photograph plus a text description produces a complete video with visuals and sound. No separate text-to-speech (TTS) or sound effects (SFX) processing step is needed.
The v2.6 generation also improves visual quality over v2.5, with better temporal consistency across frames and sharper rendering of complex scenes.
Copy link to headingWhat To Consider When Choosing a Provider
- Configuration: Audio generation supports Chinese and English speech synthesis. If you need other languages, confirm support before you ship.
- Zero Data Retention: Zero Data Retention is offered on a per-provider and model basis. See the documentation for details.
- Authentication: AI Gateway authenticates requests using an API key or OIDC token. You do not need to manage provider credentials directly.
Copy link to headingWhen to Use Kling v2.6 Image-to-Video
Best for
- Brand and product videos: Reference imagery anchors visuals and synchronized audio narration or ambient sound is required
- Localized short-form video: Chinese or English speech synthesis tied to existing photography
- Controlled transitions with audio: Animation between two defined visual states with audio accompaniment
- Advertising clips: Social media and ad content where audio-video sync is expected and a reference image defines the visual subject
Consider alternatives when
- Silent video preferred: You don't need audio output and prefer the lower cost of a silent tier, so V2.5 Turbo i2v is faster and cheaper
- Multi-shot sequences: You need narrative sequences with distinct scene changes, which later Kling versions support
- Text-driven visuals: A text description rather than a reference image should drive visual content, so use the t2v variant
Copy link to headingConclusion
Kling v2.6 Image-to-Video unifies image animation and audio generation in one inference call. If you used to pair silent AI video with separate audio, you drop a sync step. Teams animating reference imagery into full clips with sound get fewer handoffs than with silent tiers.
Copy link to headingFrequently Asked Questions
How does first/last frame anchoring work in Kling v2.6 Image-to-Video?
You supply images defining the opening frame, the closing frame, or both. The model generates motion and scene evolution between those endpoints. This suits controlled product reveals or transition sequences where you know the visual start and end states in advance.
What audio categories does v2.6 i2v generate?
Three types: natural speech synthesis in Chinese and English, action-relevant sound effects timed to on-screen events, and environmental ambient sound reinforcing the scene atmosphere. All three synchronize to the video output.
Is the audio produced in a separate processing step?
No. Audio generates in the same inference request as video. There's no separate TTS or SFX pipeline to coordinate. The finished output includes both video and audio.
What is the maximum video duration for Kling v2.6 Image-to-Video?
Outputs are available at five or 10 seconds, at up to 1080p resolution across 16:9, 9:16, and 1:1 aspect ratios.
How does v2.6 i2v differ from v2.5 Turbo i2v?
V2.6 adds native audio generation. V2.5 Turbo produces silent video and prioritizes fast generation at lower cost. V2.6 also includes visual quality improvements over the v2.5 generation.
Does the model require a text prompt in addition to the reference image?
A text prompt is optional but recommended. It guides the model's animation direction and audio synthesis toward your intended output.