> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# API

> API reference for Kling: every `kling.api.*` operation with input and output types.

Every `kling.api.*` operation is listed below with parameter shapes and return types from the plugin Zod schemas.

> [!NOTE]
>
> **New to Corsair?** See [API access](/concepts/api), [authentication](/concepts/auth), and [error handling](/concepts/error-handling).

## Image Generation

### create

`imageGeneration.create`

Create a text-to-image or image-to-image task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.imageGeneration.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model_name` | `kling-v2-1 \| kling-v3` | No | — |
| `prompt` | `string` | Yes | — |
| `negative_prompt` | `string` | No | — |
| `image` | `string` | No | — |
| `image_reference` | `subject \| face` | No | — |
| `image_fidelity` | `number` | No | — |
| `human_fidelity` | `number` | No | — |
| `element_list` | `object[]` | No | — |
| `resolution` | `1k \| 2k` | No | — |
| `n` | `number` | No | — |
| `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9` | No | — |
| `watermark_info` | `object` | No | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **element\_list full type**
>
> ```ts theme={null}
> {
>   element_id: number
> }[]
> ```

> **watermark\_info full type**
>
> ```ts theme={null}
> {
>   enabled: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`imageGeneration.get`

Fetch an image generation task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.imageGeneration.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`imageGeneration.list`

List image generation tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.imageGeneration.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Image To Video

### create

`imageToVideo.create`

Create an image-to-video generation task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.imageToVideo.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `kling-2.5-turbo \| kling-2.6 \| kling-3.0 \| kling-3.0-turbo` | Yes | — |
| `contents` | `object[]` | Yes | — |
| `settings` | `object` | No | — |
| `options` | `object` | No | — |

> **contents full type**
>
> ```ts theme={null}
> {
>   type: string,
>   text?: string,
>   url?: string,
>   id?: string,
>   voice_id?: string,
>   element_id?: string
> }[]
> ```

> **settings full type**
>
> ```ts theme={null}
> {
>   resolution?: string,
>   aspect_ratio?: string,
>   duration?: number,
>   audio?: string,
>   multi_shot?: boolean
> }
> ```

> **options full type**
>
> ```ts theme={null}
> {
>   callback_url?: string,
>   external_task_id?: string,
>   watermark_info?: {
>     enabled: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`imageToVideo.get`

Fetch an image-to-video task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.imageToVideo.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

### list

`imageToVideo.list`

List image-to-video and other video tasks by cursor

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.imageToVideo.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_time` | `string \| number` | No | — |
| `end_time` | `string \| number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `filters` | `object[]` | No | — |

> **filters full type**
>
> ```ts theme={null}
> {
>   key: status | product_type,
>   values: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   result: {
>     id?: string,
>     task_id?: string,
>     status?: string,
>     task_status?: string,
>     message?: string,
>     task_status_msg?: string,
>     create_time?: number,
>     update_time?: number,
>     created_at?: number,
>     updated_at?: number,
>     external_id?: string,
>     outputs?: {
>       type: string,
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string,
>       group_id?: string,
>       mp3_url?: string,
>       wav_url?: string,
>       mp3_duration?: string,
>       wav_duration?: string,
>       name?: string,
>       owned_by?: string,
>       status?: string
>     }[],
>     billing?: {
>       charge_type?: string,
>       cash_type?: string,
>       amount?: string,
>       currency?: string,
>       package_type?: string,
>       list_price?: string
>     }[],
>     final_unit_deduction?: string,
>     final_balance_deduction?: {
>       quota?: string,
>       list_price?: string
>     },
>     watermark_info?: {
>       enabled: boolean
>     },
>     task_info?: {
>       external_task_id?: string
>     },
>     task_result?: {
>       images?: {
>         index?: number,
>         url?: string,
>         watermark_url?: string
>       }[],
>       videos?: {
>         id?: string,
>         url?: string,
>         watermark_url?: string,
>         duration?: string
>       }[]
>     }
>   }[],
>   count?: number,
>   next_cursor?: string,
>   has_more?: boolean
> }
> ```

***

## Lip Sync

### create

`lipSync.create`

Create a lip-sync task for a detected face

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.lipSync.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `session_id` | `string` | Yes | — |
| `face_choose` | `object[]` | Yes | — |
| `watermark_info` | `object` | No | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **face\_choose full type**
>
> ```ts theme={null}
> {
>   face_id: string,
>   audio_id?: string,
>   sound_file?: string,
>   sound_start_time: number,
>   sound_end_time: number,
>   sound_insert_time: number,
>   sound_volume?: number,
>   original_audio_volume?: number
> }[]
> ```

> **watermark\_info full type**
>
> ```ts theme={null}
> {
>   enabled: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### detectFace

`lipSync.detectFace`

Identify faces in a video for lip-sync processing

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.lipSync.detectFace({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `video_id` | `string` | No | — |
| `video_url` | `string` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   session_id: string,
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   face_data?: {
>     face_id?: string,
>     face_image?: string,
>     start_time?: number,
>     end_time?: number
>   }[]
> }
> ```

***

### get

`lipSync.get`

Fetch a lip-sync task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.lipSync.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`lipSync.list`

List lip-sync tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.lipSync.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Motion Control

### create

`motionControl.create`

Create a motion-control task from a motion reference

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.motionControl.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `kling-2.6 \| kling-3.0` | Yes | — |
| `contents` | `object[]` | Yes | — |
| `settings` | `object` | Yes | — |
| `options` | `object` | No | — |

> **contents full type**
>
> ```ts theme={null}
> {
>   type: string,
>   text?: string,
>   url?: string,
>   id?: string,
>   voice_id?: string,
>   element_id?: string
> }[]
> ```

> **settings full type**
>
> ```ts theme={null}
> {
>   character_orientation: image | video,
>   resolution?: string,
>   aspect_ratio?: string,
>   duration?: number,
>   audio?: string,
>   multi_shot?: boolean
> }
> ```

> **options full type**
>
> ```ts theme={null}
> {
>   callback_url?: string,
>   external_task_id?: string,
>   watermark_info?: {
>     enabled: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`motionControl.get`

Fetch a motion-control task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.motionControl.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

### list

`motionControl.list`

List motion-control and other video tasks by cursor

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.motionControl.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_time` | `string \| number` | No | — |
| `end_time` | `string \| number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `filters` | `object[]` | No | — |

> **filters full type**
>
> ```ts theme={null}
> {
>   key: status | product_type,
>   values: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   result: {
>     id?: string,
>     task_id?: string,
>     status?: string,
>     task_status?: string,
>     message?: string,
>     task_status_msg?: string,
>     create_time?: number,
>     update_time?: number,
>     created_at?: number,
>     updated_at?: number,
>     external_id?: string,
>     outputs?: {
>       type: string,
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string,
>       group_id?: string,
>       mp3_url?: string,
>       wav_url?: string,
>       mp3_duration?: string,
>       wav_duration?: string,
>       name?: string,
>       owned_by?: string,
>       status?: string
>     }[],
>     billing?: {
>       charge_type?: string,
>       cash_type?: string,
>       amount?: string,
>       currency?: string,
>       package_type?: string,
>       list_price?: string
>     }[],
>     final_unit_deduction?: string,
>     final_balance_deduction?: {
>       quota?: string,
>       list_price?: string
>     },
>     watermark_info?: {
>       enabled: boolean
>     },
>     task_info?: {
>       external_task_id?: string
>     },
>     task_result?: {
>       images?: {
>         index?: number,
>         url?: string,
>         watermark_url?: string
>       }[],
>       videos?: {
>         id?: string,
>         url?: string,
>         watermark_url?: string,
>         duration?: string
>       }[]
>     }
>   }[],
>   count?: number,
>   next_cursor?: string,
>   has_more?: boolean
> }
> ```

***

## Multi Image To Image

### create

`multiImageToImage.create`

Create a multi-image (subject, scene, style) task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.multiImageToImage.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model_name` | `kling-v2-1` | No | — |
| `prompt` | `string` | No | — |
| `subject_image_list` | `object[]` | Yes | — |
| `scene_image` | `string` | No | — |
| `style_image` | `string` | No | — |
| `n` | `number` | No | — |
| `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9` | No | — |
| `watermark_info` | `object` | No | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **subject\_image\_list full type**
>
> ```ts theme={null}
> {
>   subject_image: string
> }[]
> ```

> **watermark\_info full type**
>
> ```ts theme={null}
> {
>   enabled: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`multiImageToImage.get`

Fetch a multi-image task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.multiImageToImage.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`multiImageToImage.list`

List multi-image tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.multiImageToImage.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Omni Image

### create

`omniImage.create`

Create an omni-image generation task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.omniImage.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model_name` | `kling-image-o1 \| kling-v3-omni` | No | — |
| `prompt` | `string` | Yes | — |
| `image_list` | `object[]` | No | — |
| `element_list` | `object[]` | No | — |
| `resolution` | `1k \| 2k \| 4k` | No | — |
| `result_type` | `single \| series` | No | — |
| `n` | `number` | No | — |
| `series_amount` | `number \| auto` | No | — |
| `aspect_ratio` | `16:9 \| 9:16 \| 1:1 \| 4:3 \| 3:4 \| 3:2 \| 2:3 \| 21:9 \| auto` | No | — |
| `watermark_info` | `object` | No | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **image\_list full type**
>
> ```ts theme={null}
> {
>   image: string
> }[]
> ```

> **element\_list full type**
>
> ```ts theme={null}
> {
>   element_id: number
> }[]
> ```

> **watermark\_info full type**
>
> ```ts theme={null}
> {
>   enabled: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`omniImage.get`

Fetch an omni-image task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.omniImage.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`omniImage.list`

List omni-image tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.omniImage.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Omni Video

### create

`omniVideo.create`

Create an omni-video generation task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.omniVideo.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `kling-3.0-omni \| kling-o1` | Yes | — |
| `contents` | `object[]` | Yes | — |
| `settings` | `object` | No | — |
| `options` | `object` | No | — |

> **contents full type**
>
> ```ts theme={null}
> {
>   type: string,
>   text?: string,
>   url?: string,
>   id?: string,
>   voice_id?: string,
>   element_id?: string
> }[]
> ```

> **settings full type**
>
> ```ts theme={null}
> {
>   resolution?: string,
>   aspect_ratio?: string,
>   duration?: number,
>   audio?: string,
>   multi_shot?: boolean
> }
> ```

> **options full type**
>
> ```ts theme={null}
> {
>   callback_url?: string,
>   external_task_id?: string,
>   watermark_info?: {
>     enabled: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`omniVideo.get`

Fetch an omni-video task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.omniVideo.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

### list

`omniVideo.list`

List omni-video and other video tasks by cursor

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.omniVideo.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_time` | `string \| number` | No | — |
| `end_time` | `string \| number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `filters` | `object[]` | No | — |

> **filters full type**
>
> ```ts theme={null}
> {
>   key: status | product_type,
>   values: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   result: {
>     id?: string,
>     task_id?: string,
>     status?: string,
>     task_status?: string,
>     message?: string,
>     task_status_msg?: string,
>     create_time?: number,
>     update_time?: number,
>     created_at?: number,
>     updated_at?: number,
>     external_id?: string,
>     outputs?: {
>       type: string,
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string,
>       group_id?: string,
>       mp3_url?: string,
>       wav_url?: string,
>       mp3_duration?: string,
>       wav_duration?: string,
>       name?: string,
>       owned_by?: string,
>       status?: string
>     }[],
>     billing?: {
>       charge_type?: string,
>       cash_type?: string,
>       amount?: string,
>       currency?: string,
>       package_type?: string,
>       list_price?: string
>     }[],
>     final_unit_deduction?: string,
>     final_balance_deduction?: {
>       quota?: string,
>       list_price?: string
>     },
>     watermark_info?: {
>       enabled: boolean
>     },
>     task_info?: {
>       external_task_id?: string
>     },
>     task_result?: {
>       images?: {
>         index?: number,
>         url?: string,
>         watermark_url?: string
>       }[],
>       videos?: {
>         id?: string,
>         url?: string,
>         watermark_url?: string,
>         duration?: string
>       }[]
>     }
>   }[],
>   count?: number,
>   next_cursor?: string,
>   has_more?: boolean
> }
> ```

***

## Outpainting

### create

`outpainting.create`

Create an image outpainting (expand) task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.outpainting.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `image` | `string` | Yes | — |
| `up_expansion_ratio` | `number` | Yes | — |
| `down_expansion_ratio` | `number` | Yes | — |
| `left_expansion_ratio` | `number` | Yes | — |
| `right_expansion_ratio` | `number` | Yes | — |
| `prompt` | `string` | No | — |
| `n` | `number` | No | — |
| `watermark_info` | `object` | No | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **watermark\_info full type**
>
> ```ts theme={null}
> {
>   enabled: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`outpainting.get`

Fetch an outpainting task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.outpainting.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`outpainting.list`

List outpainting tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.outpainting.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Text To Video

### create

`textToVideo.create`

Create a text-to-video generation task

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.textToVideo.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `model` | `kling-2.5-turbo \| kling-2.6 \| kling-3.0 \| kling-3.0-turbo` | Yes | — |
| `prompt` | `string` | Yes | — |
| `settings` | `object` | No | — |
| `options` | `object` | No | — |

> **settings full type**
>
> ```ts theme={null}
> {
>   resolution?: string,
>   aspect_ratio?: string,
>   duration?: number,
>   audio?: string,
>   multi_shot?: boolean
> }
> ```

> **options full type**
>
> ```ts theme={null}
> {
>   callback_url?: string,
>   external_task_id?: string,
>   watermark_info?: {
>     enabled: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`textToVideo.get`

Fetch a text-to-video task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.textToVideo.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

### list

`textToVideo.list`

List text-to-video and other video tasks by cursor

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.textToVideo.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_time` | `string \| number` | No | — |
| `end_time` | `string \| number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `filters` | `object[]` | No | — |

> **filters full type**
>
> ```ts theme={null}
> {
>   key: status | product_type,
>   values: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   result: {
>     id?: string,
>     task_id?: string,
>     status?: string,
>     task_status?: string,
>     message?: string,
>     task_status_msg?: string,
>     create_time?: number,
>     update_time?: number,
>     created_at?: number,
>     updated_at?: number,
>     external_id?: string,
>     outputs?: {
>       type: string,
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string,
>       group_id?: string,
>       mp3_url?: string,
>       wav_url?: string,
>       mp3_duration?: string,
>       wav_duration?: string,
>       name?: string,
>       owned_by?: string,
>       status?: string
>     }[],
>     billing?: {
>       charge_type?: string,
>       cash_type?: string,
>       amount?: string,
>       currency?: string,
>       package_type?: string,
>       list_price?: string
>     }[],
>     final_unit_deduction?: string,
>     final_balance_deduction?: {
>       quota?: string,
>       list_price?: string
>     },
>     watermark_info?: {
>       enabled: boolean
>     },
>     task_info?: {
>       external_task_id?: string
>     },
>     task_result?: {
>       images?: {
>         index?: number,
>         url?: string,
>         watermark_url?: string
>       }[],
>       videos?: {
>         id?: string,
>         url?: string,
>         watermark_url?: string,
>         duration?: string
>       }[]
>     }
>   }[],
>   count?: number,
>   next_cursor?: string,
>   has_more?: boolean
> }
> ```

***

## Video Effects

### create

`videoEffects.create`

Create a video effect task from a scene template

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.videoEffects.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `effect_scene` | `string` | Yes | — |
| `input` | `object` | Yes | — |
| `callback_url` | `string` | No | — |
| `external_task_id` | `string` | No | — |

> **input full type**
>
> ```ts theme={null}
> {
>   image?: string,
>   images?: string[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`videoEffects.get`

Fetch a video effect task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.videoEffects.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }
> ```

***

### list

`videoEffects.list`

List video effect tasks by page

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.videoEffects.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pageNum` | `number` | No | — |
| `pageSize` | `number` | No | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

## Virtual Try On

### create

`virtualTryOn.create`

Create a virtual try-on task for a product and person

**Risk:** `write`

```ts theme={null}
await corsair.kling.api.virtualTryOn.create({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `contents` | `object[]` | Yes | — |
| `settings` | `object` | No | — |
| `options` | `object` | No | — |

> **contents full type**
>
> ```ts theme={null}
> {
>   type: product_image | person_image,
>   url: string
> }[]
> ```

> **settings full type**
>
> ```ts theme={null}
> {
>   keep_face?: boolean,
>   keep_pose?: boolean,
>   keep_background?: boolean
> }
> ```

> **options full type**
>
> ```ts theme={null}
> {
>   callback_url?: string,
>   external_task_id?: string,
>   watermark?: {
>     enabled: boolean
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   task_info?: {
>     external_task_id?: string
>   }
> }
> ```

***

### get

`virtualTryOn.get`

Fetch a virtual try-on task by id

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.virtualTryOn.get({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `task_id` | `string` | Yes | — |

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object[]` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   id?: string,
>   task_id?: string,
>   status?: string,
>   task_status?: string,
>   message?: string,
>   task_status_msg?: string,
>   create_time?: number,
>   update_time?: number,
>   created_at?: number,
>   updated_at?: number,
>   external_id?: string,
>   outputs?: {
>     type: string,
>     id?: string,
>     url?: string,
>     watermark_url?: string,
>     duration?: string,
>     group_id?: string,
>     mp3_url?: string,
>     wav_url?: string,
>     mp3_duration?: string,
>     wav_duration?: string,
>     name?: string,
>     owned_by?: string,
>     status?: string
>   }[],
>   billing?: {
>     charge_type?: string,
>     cash_type?: string,
>     amount?: string,
>     currency?: string,
>     package_type?: string,
>     list_price?: string
>   }[],
>   final_unit_deduction?: string,
>   final_balance_deduction?: {
>     quota?: string,
>     list_price?: string
>   },
>   watermark_info?: {
>     enabled: boolean
>   },
>   task_info?: {
>     external_task_id?: string
>   },
>   task_result?: {
>     images?: {
>       index?: number,
>       url?: string,
>       watermark_url?: string
>     }[],
>     videos?: {
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string
>     }[]
>   }
> }[]
> ```

***

### list

`virtualTryOn.list`

List virtual try-on tasks by cursor

**Risk:** `read`

```ts theme={null}
await corsair.kling.api.virtualTryOn.list({});
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `start_time` | `string \| number` | No | — |
| `end_time` | `string \| number` | No | — |
| `cursor` | `string` | No | — |
| `limit` | `number` | No | — |
| `filters` | `object[]` | No | — |

> **filters full type**
>
> ```ts theme={null}
> {
>   key: status,
>   values: string[]
> }[]
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `code` | `number` | Yes | — |
| `message` | `string` | No | — |
| `request_id` | `string` | No | — |
| `data` | `object` | Yes | — |

> **data full type**
>
> ```ts theme={null}
> {
>   result: {
>     id?: string,
>     task_id?: string,
>     status?: string,
>     task_status?: string,
>     message?: string,
>     task_status_msg?: string,
>     create_time?: number,
>     update_time?: number,
>     created_at?: number,
>     updated_at?: number,
>     external_id?: string,
>     outputs?: {
>       type: string,
>       id?: string,
>       url?: string,
>       watermark_url?: string,
>       duration?: string,
>       group_id?: string,
>       mp3_url?: string,
>       wav_url?: string,
>       mp3_duration?: string,
>       wav_duration?: string,
>       name?: string,
>       owned_by?: string,
>       status?: string
>     }[],
>     billing?: {
>       charge_type?: string,
>       cash_type?: string,
>       amount?: string,
>       currency?: string,
>       package_type?: string,
>       list_price?: string
>     }[],
>     final_unit_deduction?: string,
>     final_balance_deduction?: {
>       quota?: string,
>       list_price?: string
>     },
>     watermark_info?: {
>       enabled: boolean
>     },
>     task_info?: {
>       external_task_id?: string
>     },
>     task_result?: {
>       images?: {
>         index?: number,
>         url?: string,
>         watermark_url?: string
>       }[],
>       videos?: {
>         id?: string,
>         url?: string,
>         watermark_url?: string,
>         duration?: string
>       }[]
>     }
>   }[],
>   count?: number,
>   next_cursor?: string,
>   has_more?: boolean
> }
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.