# Kling 2.6 Motion Control API Complete API reference for Kling 2.6 Motion Control video generation by Kuaishou. ## Model Variants This API supports one model variant: | Model | ID | Description | |-------|-----|-------------| | **Kling 2.6 Motion Control** | `kling-2.6-motion-control` | Video generation using a text prompt, one reference image, and one reference video | ## Kling 2.6 Motion Control ### Endpoint ``` POST /api/v1/video/task ``` ### Request Parameters #### Required | Parameter | Type | Description | |-----------|------|-------------| | `model_name` | string | Must be `"kling-2.6-motion-control"` | | `prompt` | string | Video generation prompt, up to 5000 characters | | `images` | string[] | Exactly one reference image URL. Supports `.jpg`, `.jpeg`, and `.png`; file size must not exceed 50 MB. Width and height must each be at least 300 px, with an image aspect ratio between 1:2.5 and 2.5:1 | | `videos` | string[] | Exactly one reference video URL. Supports `.mp4` and `.mov`; file size must not exceed 100 MB. Width and height must each be between 340 and 3850 px, inclusive. Duration must be at least 3 seconds; the maximum depends on `character_orientation` | | `character_orientation` | string | Required with no default. `"image"`: follows the character's orientation in the reference image; reference video must be 3-10 seconds. `"video"`: follows the character's orientation in the reference video; reference video must be 3-30 seconds. Both duration ranges include their endpoints | | `resolution` | string | Output resolution: `"720p"` or `"1080p"`. Required with no default | #### Optional | Parameter | Type | Description | |-----------|------|-------------| | `keep_original_sound` | boolean | Whether to retain the reference video's original sound. Accepts `true` or `false`; defaults to `true` | Output duration follows the source video. The `duration` parameter is not supported. Output aspect ratio is determined by the input media, and `aspect_ratio` is not supported. The upstream provider has not specified which input determines the output aspect ratio or the exact selection rule. Billing is based on the source video's duration rounded to the nearest whole second and the selected output resolution. For example, 5.4 seconds is billed as 5 seconds, and 5.5 seconds as 6 seconds. ### Example Request Replace the example media URLs with your own files that meet the requirements above. ```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-2.6-motion-control', prompt: 'Animate the character in the reference image using the dance movements from the reference video', images: ['https://example.com/character.jpg'], videos: ['https://example.com/dance-reference.mp4'], character_orientation: 'video', resolution: '720p', keep_original_sound: true }) }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Response Format ### Initial Response Returns a `task_id` for polling: ```json { "code": 0, "message": "success", "data": { "task_id": "{task_id}", "response_url": "https://api.flaq.ai/api/v1/video/{task_id}", "task_status": "submitted" } } ``` Poll with `GET /api/v1/video/{task_id}` to check status and retrieve the generated video. ### Status Values - `submitted`: Task accepted and waiting to be processed - `processing`: Video generation in progress - `succeed`: Video generation completed - `failed`: Video generation failed ## Best Practices 1. **Reference Media**: Supply exactly one image and one video, checking their formats, sizes, and dimensions before submitting 2. **Orientation**: Recheck the reference video's duration when switching `character_orientation`, especially when selecting `"image"` 3. **Original Sound**: Set `keep_original_sound` to `false` to disable retention of the reference video's original sound; omitting it retains the sound