# Kling 3.0 API Complete API reference for Kling 3.0 video generation models by Kuaishou. ## Model Variants This API supports four model variants: | Model | ID | Tier | Description | |-------|-----|------|-------------| | **Kling 3.0 Std Text to Video** | `kling-v3.0-std-text-to-video` | Standard | Text-to-video generation at standard quality | | **Kling 3.0 Std Image to Video** | `kling-v3.0-std-image-to-video` | Standard | Image-to-video animation at standard quality | | **Kling 3.0 Pro Text to Video** | `kling-v3.0-pro-text-to-video` | Pro | Text-to-video generation at pro quality | | **Kling 3.0 Pro Image to Video** | `kling-v3.0-pro-image-to-video` | Pro | Image-to-video animation at pro quality | ## Quick Comparison | Feature | Std | Pro | |---------|-----|-----| | Quality | Standard | Highest | | Generation Speed | Faster | Slower | | Aspect Ratios | 16:9, 9:16, 1:1 | 16:9, 9:16, 1:1 | | Duration Range | 3-15 seconds | 3-15 seconds | | Feature | Text to Video | Image to Video | |---------|---------------|----------------| | Input | Text prompt | Image + Text prompt | | Start Frame | Not supported | Required | | End Frame | Not supported | Not supported | | Audio | Optional | Optional | ### Supported Aspect Ratios | Ratio | Description | |-------|-------------| | `16:9` | Landscape (widescreen) | | `9:16` | Portrait (vertical) | | `1:1` | Square | ## Kling 3.0 Text to Video (Std & Pro) ### Endpoint ``` POST /api/v1/video/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | `"kling-v3.0-std-text-to-video"` or `"kling-v3.0-pro-text-to-video"` | | `prompt` | string | Video generation prompt | | `duration` | number | Video duration in seconds (3-15) | | `aspect_ratio` | string | Video aspect ratio: `"16:9"`, `"9:16"`, or `"1:1"` | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `sound` | boolean | Generate ambient sound for the video | | `guidance_scale` | number | Prompt adherence strength, float between 0 and 1 | | `negative_prompt` | string | Elements to exclude from the generated video | ### Example Request **Std Version:** ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'kling-v3.0-std-text-to-video', prompt: 'A fox running through a snowy forest at dusk', duration: 5, aspect_ratio: '16:9' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` **Pro Version:** ```javascript { model_name: 'kling-v3.0-pro-text-to-video', prompt: 'A fox running through a snowy forest at dusk', duration: 5, aspect_ratio: '16:9' } ``` ## Kling 3.0 Image to Video (Std & Pro) ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | `"kling-v3.0-std-image-to-video"` or `"kling-v3.0-pro-image-to-video"` | | `prompt` | string | Video generation prompt | | `duration` | number | Video duration in seconds (3-15) | | `aspect_ratio` | string | Video aspect ratio: `"16:9"`, `"9:16"`, or `"1:1"` | | `image_url` | string | The first frame of the video | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `sound` | boolean | Generate ambient sound for the video | | `guidance_scale` | number | Prompt adherence strength, float between 0 and 1 | | `negative_prompt` | string | Elements to exclude from the generated video | ### Example Request **Std Version:** ```javascript const response = await fetch('https://api.flaq.ai/api/v1/video/task', { method: 'POST', headers: { 'Authorization': 'Bearer YOUR_API_KEY', 'Content-Type': 'application/json' }, body: JSON.stringify({ model_name: 'kling-v3.0-std-image-to-video', image_url: 'https://example.com/image.jpg', prompt: 'Gentle breeze, leaves rustling, slow camera pull back', duration: 5, aspect_ratio: '16:9' }) }); const { data } = await response.json(); const taskId = data.task_id; ``` **Pro Version:** ```javascript { model_name: 'kling-v3.0-pro-image-to-video', image_url: 'https://example.com/image.jpg', prompt: 'Gentle breeze, leaves rustling, slow camera pull back', duration: 5, aspect_ratio: '16:9' } ``` ## Response Format ### Initial Response ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` ### Polling Response Poll `GET /api/v1/video/{taskId}` to check status: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "succeed", "task_status_msg": null, "task_result": { "credit": 0.2, "videos": [ { "url": "https://example.com/generated-video.mp4" } ] } } } ``` ### Status Values - `submitted`: Task accepted and waiting to be processed - `processing`: Video generation in progress - `succeed`: Video generation completed - `failed`: Video generation failed ## Processing Time - **Std Version**: ~2-4 minutes depending on duration - **Pro Version**: ~3-6 minutes depending on duration Poll every 5-10 seconds. Longer videos (10-15 seconds) may take additional time. ## Best Practices 1. **Describe Motion Clearly**: Include camera movements and subject actions in the prompt for more dynamic results 2. **Use Negative Prompts**: Exclude unwanted elements (e.g., `"blurry, low quality, watermark"`) to improve output 3. **Guidance Scale**: Lower values (0.3-0.5) allow more creative freedom; higher values (0.7-1.0) follow the prompt more strictly 4. **Image Quality**: For image-to-video, use sharp, well-lit input images for best motion quality 5. **Duration**: Start with shorter durations (3-5 seconds) to iterate quickly, then increase for final output 6. **Tier Selection**: Use Std for faster iteration and Pro for final production-quality videos