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

# Kling 4.0 — 文生视频

> 使用快手 Kling 4.0 从文本提示词生成 3–30 秒、720p 或 1080p 视频，按实际生成的视频秒数计费。

| | |
| - | - |
| **模型 ID** | `kuaishou/kling-v4-t2v` |
| **系列** | `kling-v4` |
| **任务** | `text-to-video` |
| **模态** | 视频 |
| **上游** | Kuaishou Kling 4.0 |

> [!NOTE]
>
> Kling 4.0 按实际生成的视频秒数计费，每秒费率由分辨率决定。提交时会按该请求可能产生的
> 最高费用从余额中预扣；最终按实际时长结算，且不会超过预扣金额。生成失败不收费。
> 当前每秒费率请见[定价页](https://vibetoken.cn/pricing)。

Kling 4.0 系列还包括：[多关键帧图生视频](https://docs.vibetoken.cn/zh/kuaishou-kling-v4-api/image-to-video.md)
与[参考生视频及视频编辑](https://docs.vibetoken.cn/zh/kuaishou-kling-v4-api/reference-to-video.md)。

## Endpoint

```http theme={null}
POST https://vibetoken.cn/v1/videos/generations
```

异步接口 — 返回 `{id, status: "pending"}`；轮询
`GET /v1/videos/generations/{id}` 直到状态为 `success` 或 `failed`。

## 参数

**prompt** `string` *required*

描述目标视频的文本提示词。最多 26000 个字符。

**resolution** `"720p" | "1080p"` (default: "1080p")

输出分辨率。每档各有独立的每秒费率。

**aspect\_ratio** `"16:9" | "9:16" | "1:1" | "21:9"` (default: "16:9")

生成视频的宽高比。

**duration** `integer`

片段时长（秒），取值范围 `[3, 30]`。省略时由 Kling 根据提示词决定时长：此时预扣按最长
片段（30 秒）计算，实际扣费按生成的时长结算。

该模型不支持的选项不会转发给它。

## 示例

```bash theme={null}
curl https://vibetoken.cn/v1/videos/generations \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "kuaishou/kling-v4-t2v",
    "prompt": "一只纸船顺着被雨水浸湿的城市街边水沟漂流，低机位跟拍",
    "resolution": "1080p",
    "aspect_ratio": "16:9",
    "duration": 10
  }'
```

```json theme={null}
{ "id": "task_abc123…", "status": "pending", "model": "kuaishou/kling-v4-t2v" }
```

轮询直到进入终态：

```bash theme={null}
curl https://vibetoken.cn/v1/videos/generations/task_abc123… \
  -H "Authorization: Bearer $VIBETOKEN_API_KEY"
```

```json theme={null}
{
  "id": "task_abc123…",
  "status": "success",
  "data": [{ "url": "https://…mp4" }]
}
```


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