> ## 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 O1

> Kling O1 v2 Omni 生成、编辑和任务查询 API。

Kling O1 使用 v2 Omni Video 接口。模型由路径选择，提示词和参考素材放在 `contents` 中。

> [tab] Omni 生成或编辑
>
> ## 创建任务
>
> `POST /kling/v2/omni-video/kling-o1`
>
> ```bash cURL theme={null}
> curl --request POST \
>   --url https://www.anyfast.ai/kling/v2/omni-video/kling-o1 \
>   --header 'Authorization: Bearer YOUR_API_KEY' \
>   --header 'Content-Type: application/json' \
>   --data '{
>     "contents": [{"type": "prompt", "text": "一名旅行者穿过雨后的城市街道"}],
>     "settings": {"resolution": "720p", "aspect_ratio": "16:9", "duration": 3}
>   }'
> ```
>
> ## 请求体
>
> **contents** `object[]` *required*
>
> 包含一个 `prompt` 项，可选 `refer_image`、`feature_video`、`first_frame`、`last_frame` 或 `base_video` 项。
>
> **contents\[].type** `string` *required*
>
> 素材角色。为素材设置 ID 后，可在提示词中使用 `@id` 引用。
>
> **contents\[].text** `string`
>
> `prompt` 项的提示词。
>
> **contents\[].url** `string`
>
> 公开图片或视频 URL。
>
> **settings** `object`
>
> 输出分辨率、时长和画面比例。
>
> ## 创建响应
>
> ```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，多个 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`
>
> 结果类型。
>
> **data\[].outputs\[].url** `string`
>
> 临时生成媒体 URL。
>
> **data\[].outputs\[].duration** `string`
>
> 生成媒体时长，单位为秒。

## 工作流与参数说明

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

使用 `prompt`、`refer_image`、`feature_video`、`base_video`、`first_frame` 或 `last_frame`。

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

内容项的唯一 ID，在提示词中用 `@id` 引用。

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

公开 JPG、JPEG、PNG 图片地址，公开 MP4/MOV 视频地址，或支持的原始 Base64 图片内容。

**contents\[].refer\_type** `string`

视频项使用 `base` 编辑源视频，使用 `feature` 参考其内容、动作、风格或镜头移动。

**contents\[].keep\_original\_sound** `string`

源视频使用 `yes` 保留原音频，使用 `no` 丢弃。

**settings.duration** `integer`

输出时长 3–10 秒；`base_video` 编辑未设置时沿用源视频时长。

**settings.resolution** `string`

`720p` 或 `1080p`。

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

`16:9`、`9:16` 或 `1:1`；没有首帧或源视频决定构图时必须设置。

**settings.sound** `string`

Kling O1 不生成原生音频，应保持关闭；源视频音频由 `keep_original_sound` 控制。

### 引用与编辑规则

一次请求最多使用一个源视频。`base_video` 是视频编辑工作流，未设置时长时保持源视频时长；`feature_video` 用于新生成，可参考内容、动作、风格、镜头移动或镜头续接。首尾帧工作流必须提供首帧，尾帧不能单独使用，也不能与不兼容的元素引用组合。

图片支持 JPG、JPEG、PNG，宽高均至少 300 像素，宽高比为 1:2.5 至 2.5:1。视频使用可访问的 MP4/MOV 地址，至少 3 秒，分辨率 720–2160 像素、24–60 FPS，宽高比为 1:2.5 至 2.5:1。Kling O1 不提供多镜头和 4K 输出。


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