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

# Kling 2.5-turbo

> Kling 2.5-turbo v2 文生视频、图生视频和任务查询 API。

Kling 2.5-turbo 使用模型专属的 v2 路径。不要发送 `model_name`、`mode` 或顶层字符串 `duration`。

> [tab] 文生视频
>
> ## 创建任务
>
> `POST /kling/v2/text-to-video/kling-2.5-turbo`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/text-to-video/kling-2.5-turbo \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "prompt": "一艘纸船穿过雨后的街道",
>     "settings": {"resolution": "720p", "duration": 5, "aspect_ratio": "16:9"}
>   }'
> ```
>
> ## 请求体
>
> **prompt** `string` *required*
>
> 视频描述。
>
> **settings** `object`
>
> 输出设置。
>
> **settings.resolution** `string`
>
> `720p` 或 `1080p`。
>
> **settings.duration** `integer`
>
> 数字类型的时长。使用 5 或 10 秒。
>
> **settings.aspect\_ratio** `string`
>
> `16:9`、`9:16` 或 `1:1`。
>
> ## 创建响应
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "request_id": "REQUEST_ID",
>   "data": {"id": "TASK_ID", "status": "submitted"}
> }
> ```
>
> **data.id** `string`
>
> 用于统一查询接口的系统任务 ID。
>
> **data.status** `string`
>
> `submitted`、`processing`、`succeeded` 或 `failed`。

> [tab] 图生视频
>
> ## 创建任务
>
> `POST /kling/v2/image-to-video/kling-2.5-turbo`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/image-to-video/kling-2.5-turbo \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "contents": [
>       {"type": "prompt", "text": "人物转身看向窗外"},
>       {"type": "first_frame", "url": "https://example.com/frame.png"}
>     ],
>     "settings": {"resolution": "720p", "duration": 5}
>   }'
> ```
>
> ## 请求体
>
> **contents** `object[]` *required*
>
> 包含 `prompt` 和 `first_frame` 项。模型和工作流支持时可添加中间帧或尾帧。
>
> **contents\[].type** `string` *required*
>
> 例如 `prompt`、`first_frame`、`middle_frame` 或 `last_frame`。
>
> **contents\[].text** `string`
>
> `prompt` 项的提示词。
>
> **contents\[].url** `string`
>
> 公开图片 URL 或受支持的 Base64 图片。
>
> ## 创建响应
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "request_id": "REQUEST_ID",
>   "data": {"id": "TASK_ID", "status": "submitted"}
> }
> ```
>
> **data.id** `string`
>
> 用于统一查询接口的系统任务 ID。
>
> **data.status** `string`
>
> 初始任务状态。

> [tab] 查询任务
>
> ## 查询任务
>
> `GET /kling/v2/tasks?task_ids=TASK_ID`
>
> ```bash cURL theme={null}
> curl --request GET \
>   --url 'https://www.anyfast.ai/kling/v2/tasks?task_ids=TASK_ID' \
>   --header 'Authorization: Bearer YOUR_API_KEY'
> ```
>
> **task\_ids** `string` *required*
>
> 一个或多个系统任务 ID，用逗号分隔。
>
> ```json 200 theme={null}
> {
>   "code": 0,
>   "message": "",
>   "data": [
>     {
>       "id": "TASK_ID",
>       "status": "succeeded",
>       "outputs": [{"type": "video", "url": "https://example.com/video.mp4", "duration": "5.041"}]
>     }
>   ]
> }
> ```
>
> **data\[].id** `string`
>
> 系统任务 ID。
>
> **data\[].status** `string`
>
> `submitted`、`processing`、`succeeded` 或 `failed`。
>
> **data\[].create\_time** `integer`
>
> 任务创建时间，Unix 毫秒时间戳。
>
> **data\[].update\_time** `integer`
>
> 任务更新时间，Unix 毫秒时间戳。
>
> **data\[].outputs** `object[]`
>
> 生成结果。
>
> **data\[].outputs\[].type** `string`
>
> 结果类型，通常为 `video`。
>
> **data\[].outputs\[].url** `string`
>
> 临时生成视频 URL。
>
> **data\[].outputs\[].duration** `string`
>
> 生成视频时长，单位为秒。

## 能力与参数说明

**negative\_prompt** `string`

需要避免的内容，最多 2,500 个字符。

**settings.resolution** `string`

`720p` 或 `1080p`。更高分辨率对应模型的专业输出模式。

**settings.duration** `integer`

支持 `5` 或 `10` 秒。

**settings.aspect\_ratio** `string`

支持 `16:9`、`9:16` 或 `1:1`。

**contents\[].type** `string`

图生视频使用 `prompt` 与 `first_frame`；所选工作流支持时可加入 `last_frame`。

**contents\[].url** `string`

公开 JPG、JPEG、PNG 地址或支持的原始 Base64 图片内容。

Kling 2.5 Turbo 支持文生视频和首帧图生视频。该模型不提供原生音频、指定音色、多镜头分镜、镜头控制或运动笔刷；尾帧只在支持的高分辨率工作流中可用，且不能与其他运动控制输入组合。


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