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

# kling-3.0-turbo 視頻生成

> 通過 ToAPIs 標準異步視頻接口接入官方 kling-3.0-turbo 視頻生成模型

> [!NOTE]
>
> **中國大陸用戶請注意：** 中國大陸用戶請使用 `https://toapis.cn` 作為接口地址（Base URL）。文檔示例中的 `https://toapis.com` 請替換為 `https://toapis.cn`。

* 異步任務接口，提交後返回任務 ID
* 使用新的官方 Kling Turbo 上游協議
* 支持文生視頻和圖生視頻，但圖生僅支持首幀
* `resolution` 支持 `720p` 和 `1080p`
* `duration` 支持 `3s`、`4s`、`5s`、`6s`、`7s`、`8s`、`9s`、`10s`、`11s`、`12s`、`13s`、`14s`、`15s`
* `aspect_ratio` 僅對文生視頻生效
* `watermark` 僅支持布爾開關，不支持自定義水印對象

> [!WARNING]
>
> 請傳入公網可訪問的圖片 URL。不要直接傳 base64 圖片數據；本地圖片請先使用 [上傳圖片接口](https://docs.toapis.com/docs/zh-Hant/api-reference/uploads/images.md) 獲取 URL。

## 認證

**Authorization** `string` *required*

所有接口均需要使用 Bearer Token 認證。

```
Authorization: Bearer YOUR_API_KEY
```

## 請求參數

**model** `string` *required*

視頻生成模型名稱，固定爲 `kling-3.0-turbo`。

**prompt** `string` *required*

視頻提示詞。對於圖生視頻，該字段會轉換爲 Kling Turbo `contents` 中的 `prompt` 項。

**reference\_images** `string[]`

可選輸入圖片。Kling Turbo 圖生視頻只會取第一張圖作爲 `first_frame`。

> [!WARNING]
>
> 當前接入不支持尾幀。多餘圖片不會作爲尾幀傳給上游。

**resolution** `string` (default: 720p)

視頻分辨率。

支持值：

* `720p`
* `1080p`

**duration** `integer` (default: 5)

視頻時長，單位秒。

支持值：`3`、`4`、`5`、`6`、`7`、`8`、`9`、`10`、`11`、`12`、`13`、`14`、`15`

**aspect\_ratio** `string` (default: 16:9)

文生視頻寬高比。

支持值：

* `16:9`
* `9:16`
* `1:1`

**watermark** `boolean` (default: false)

是否添加官方 Kling 水印。

## 示例

### 文生視頻

```json theme={null}
{
  "model": "kling-3.0-turbo",
  "prompt": "A cinematic shot of a red sports car driving through rain",
  "resolution": "720p",
  "duration": 5,
  "aspect_ratio": "16:9"
}
```

### 圖生視頻

```json theme={null}
{
  "model": "kling-3.0-turbo",
  "prompt": "Animate the character with subtle camera motion",
  "reference_images": ["https://example.com/first-frame.png"],
  "resolution": "1080p",
  "duration": 5,
  "watermark": true
}
```

> [!NOTE]
>
> 視頻生成爲異步任務。提交後使用 [獲取視頻任務狀態](https://docs.toapis.com/docs/zh-Hant/api-reference/tasks/video-status.md) 查詢進度和結果。


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