# Kling O3 API

> Kling 3.0 Omni — cinematic video with native sound, start/end frames and multi-shot prompting.

- **Provider**: Kuaishou
- **Model id**: `kling-o3-text-to-video`
- **Modality**: video
- **Price**: 6.69–33.46 credits /sec

## Overview

Kling O3 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-o3-text-to-video` |
| input | object | Yes | Input parameters object (see below) |
| callbackUrl | string | No | https URL to receive a signed webhook on completion |

### input object parameters

| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| prompt | string | Yes | Text value Max 2500 characters. (default: A paper boat drifts down a rain-swollen gutter at night, city lights breaking on the water, slow push-in.) |
| prefer_multi_shots | boolean | No | Smart storyboarding — let the model split the clip into shots. (true/false) (default: false) |
| customize_multi_shots | boolean | Yes | Generate multi-camera video. (true/false) (default: false) |
| multi_prompt | object[] | No | Up to 6 shots, each 1-12 seconds. Their durations must add up to Duration. (array of { prompt, duration }) |
| audio | boolean | No | The video contain audio (true/false) (default: true) |
| duration | number | Yes | Range 3-15 (default: 5) |
| resolution | string | Yes | Options: 720p | 1080p | 4K (default: 720p) |
| aspect_ratio | string | No | Options: 16:9 | 9:16 | 1:1 (default: 16:9) |

### Request example

```json
{
  "modelId": "kling-o3-text-to-video",
  "input": {
    "prefer_multi_shots": false,
    "customize_multi_shots": false,
    "audio": true,
    "duration": 5,
    "resolution": "720p",
    "aspect_ratio": "16:9"
  }
}
```

### Response example

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

## Query Task

`GET https://you.bot/api/v1/task/{taskId}?model=kling-o3-text-to-video`

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 |
| 422 | Parameter validation failed |
| 429 | Request rate limit exceeded |
| 500 | Internal server error |
