Kling 3.0 API Tutorial: Text & Image to Video with Native Audio (Python + JavaScript)

Access Kling 3.0 via NexaAPI — cheaper than PiAPI, unified SDK with 50+ models, free tier available. Complete Python and JavaScript tutorial with working code examples.

Published: March 27, 202610 min read

What is Kling 3.0?

Kling 3.0 is Kuaishou's latest AI video generation model, featuring cinematic multi-shot control, enhanced subject consistency, native audio in 5 languages, and up to 15-second generation.

  • Multi-Shot AI Director — Cinematic camera control, film-like results
  • Enhanced Subject Consistency — Multi-image references, multi-character support
  • Native Audio in 5 Languages — Chinese, English, Japanese, Korean, Spanish
  • Native Text Rendering — Crisp text in video frames for ads
  • Up to 15 Seconds — Longer generation for complex sequences

Why Use NexaAPI for Kling 3.0?

ProviderNexaAPIPiAPIDirect Kling
Price/video~$0.01–0.05HigherN/A
Free tier✅ YesLimited creditsNo
Models available50+ (Kling, Veo 3, Wan, etc.)Kling onlyKling only
SDKPython + JSLimitedNo

Quick Start

pip install nexaapi

Python: Text-to-Video with Kling 3.0

from nexaapi import NexaAPI

client = NexaAPI(api_key='YOUR_API_KEY')

# Text-to-Video with Kling 3.0
response = client.video.generate(
    model='kling-3.0',
    prompt='A cinematic shot of a futuristic city at sunset, dramatic lighting, 4K quality',
    duration=5,  # seconds
    aspect_ratio='16:9',
    mode='standard'  # or 'pro' for higher quality
)
print(response.video_url)

# Image-to-Video with Kling 3.0
response_img = client.video.generate(
    model='kling-3.0',
    prompt='Gentle camera pan across the scene',
    image_url='https://example.com/your-image.jpg',
    duration=5,
    aspect_ratio='16:9'
)
print(response_img.video_url)

# With Native Audio
response_audio = client.video.generate(
    model='kling-3.0',
    prompt='Ocean waves crashing on a beach at golden hour',
    duration=5,
    native_audio=True,
    aspect_ratio='16:9'
)
print(response_audio.video_url)

JavaScript: Kling 3.0 Video Generation

import NexaAPI from 'nexaapi';

const client = new NexaAPI({ apiKey: 'YOUR_API_KEY' });

// Text-to-Video
async function generateVideo() {
  const response = await client.video.generate({
    model: 'kling-3.0',
    prompt: 'A cinematic shot of a futuristic city at sunset',
    duration: 5,
    aspectRatio: '16:9',
    mode: 'standard'
  });
  console.log('Video URL:', response.videoUrl);
}

// Image-to-Video
async function imageToVideo() {
  const response = await client.video.generate({
    model: 'kling-3.0',
    prompt: 'Gentle camera pan across the scene',
    imageUrl: 'https://example.com/your-image.jpg',
    duration: 5,
    aspectRatio: '16:9'
  });
  console.log('Video URL:', response.videoUrl);
}

// With Native Audio
async function videoWithAudio() {
  const response = await client.video.generate({
    model: 'kling-3.0',
    prompt: 'Ocean waves crashing on a beach at golden hour',
    duration: 5,
    nativeAudio: true,
    aspectRatio: '16:9'
  });
  console.log('Video URL:', response.videoUrl);
}

generateVideo();
imageToVideo();
videoWithAudio();

FAQ

Is NexaAPI cheaper than PiAPI for Kling 3.0?

Yes. NexaAPI offers significantly lower pricing with a free tier — PiAPI only offers limited credits.

How to use Kling 3.0 API for free?

Sign up at nexa-api.com for a free tier — no credit card required.

Does NexaAPI support Kling 3.0 native audio?

Yes! Set native_audio=True and audio_language to 'en', 'zh', 'ja', 'ko', or 'es'.

Get Started with Kling 3.0 API