# Kling 2.6 Motion Control API

> Kling 2.6 Motion Control — high-quality AI video generation.

- **Provider**: Kling
- **Model id**: `kling-2-6-motion-control`
- **Modality**: video
- **Price**: 5.39–8.82 credits /sec

## Overview

Kling 2.6 Motion Control is called in two steps: create a generation task, then poll the task until the result is ready.

## Authentication

All requests require a Bearer Token in the request header:

```
Authorization: Bearer YOUR_API_KEY
```

## Create Task

`POST https://you.bot/api/v1/generate`

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| modelId | string | Yes | Model id: `kling-2-6-motion-control` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL we POST the finished task to. Signed with `X-Webhook-Signature` once you create a webhook signing key in Dashboard → Settings |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | No | A text description of the desired output. Maximum length is 2500 characters. Max 2500 characters. (example: A vintage motorcycle leans through a rain-slicked mountain bend, headlight streaking the wet asphalt as the camera tracks smoothly alongside in a controlled… — full value in the request example) |
| input_urls | string[] | Yes | Reference image. The characters, backgrounds, and other elements in the generated video are based on the reference image. Supports .jpg/.jpeg/.png, max 10MB, size needs to be greater than 300px, aspect ratio 2:5 to 5:2. (image URL) |
| video_urls | string[] | Yes | Reference video. The character actions in the generated video are consistent with the reference video. Supports .mp4/.mov, max 100MB, 3-30 seconds duration depending on character_orientation. (image URL) |
| character_orientation | string | Yes | Generate the orientation of the characters in the video. 'image': same orientation as the person in the picture (max 10s video). 'video': consistent with the orientation of the characters in the video (max 30s video). (options: image \| video) (default: video) |
| mode | string | Yes | Output resolution mode. Use 'std' for 720p or 'pro' for 1080p. (options: 720p \| 1080p) (default: 720p) |

### Request example

```json
{
  "modelId": "kling-2-6-motion-control",
  "input": {
    "prompt": "A vintage motorcycle leans through a rain-slicked mountain bend, headlight streaking the wet asphalt as the camera tracks smoothly alongside in a controlled pan.",
    "input_urls": [
      "https://you.bot/examples/grok-imagine-text-to-image.jpg"
    ],
    "video_urls": [
      "https://you.bot/examples/gemini-omni.mp4"
    ],
    "character_orientation": "video",
    "mode": "720p"
  }
}
```

### Response example

```json
{
  "taskId": "281e5b0…f39b9",
  "creditsCharged": 26.95
}
```

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=kling-2-6-motion-control`

When `state` is `success`, the output is in `resultUrls`: `{ "state": "success", "resultUrls": [ ... ] }`. (Text models return inline in the create response.)

## Error Codes

| Code | Description |
|------|-------------|
| 200 | Request successful |
| 400 | Invalid request parameters |
| 401 | Authentication failed — check API Key |
| 402 | Insufficient account balance |
| 403 | IP not allowed for this key, or the key is restricted to other models |
| 404 | Task not found, or it has expired |
| 409 | Duplicate request — an identical submit arrived moments ago. Nothing was charged; retry is safe |
| 413 | Payload too large — see the character and file-size limits for this model |
| 429 | Rate limit exceeded — retry after the Retry-After header |
| 500 | Internal server error |
| 504 | Upstream timed out — nothing was delivered; retry is safe |
