> ## 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 3.0 Omni

> 通过 AnyFast 升级后的 v2 Omni Video 接口调用 Kling 3.0 Omni。

Kling 3.0 Omni 使用模型专属的 v2 Omni Video 接口。提示词和参考素材放在 `contents` 中，不要发送 `model_name`、旧版 `image_list` 或 `video_list`。
`settings.resolution` 支持 `720p`、`1080p` 和 `4k` 输出。

## 能力

* 使用提示词文生视频。
* 使用图片、视频和主体参考素材。
* 使用 `base_video` 内容项编辑视频。
* 在模型支持时使用多镜头提示词和同步声音。

| 能力 | 接口 |
| - | - |
| Omni 生成或编辑 | `POST /kling/v2/omni-video/kling-3.0-omni` |
| 查询任务 | `GET /kling/v2/tasks?task_ids=TASK_ID` |

## 创建任务

```bash cURL theme={null}
curl --request POST \
  --url https://www.anyfast.ai/kling/v2/omni-video/kling-3.0-omni \
  --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}
  }'
```

需要素材时，将 `refer_image`、`feature_video`、`first_frame`、`last_frame` 或 `base_video` 添加到 `contents`，为素材设置 `id`，并在提示词中使用 `@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'
```

创建响应在 `data.id` 中返回系统任务 ID，查询成功后从 `data[].outputs[]` 读取媒体。

## 参考素材和组合规则

* `refer_image` 用于外观、场景或风格参考；`first_frame`、`middle_frame` 和 `last_frame` 用于关键帧约束。
* `feature_video` 用于动作、风格或运镜参考；`base_video` 用于编辑源视频，一次最多提供一个。
* 每项素材设置唯一 `id`，并在提示词中使用 `@id` 引用。`contents` 中必须保留提示词项。
* 图片支持 JPG、JPEG、PNG 以及公开 URL 或受支持的 Base64；视频使用可访问的 MP4 或 MOV URL。
* 没有首帧或源视频决定构图时，必须设置 `settings.aspect_ratio`。编辑源视频且省略 `settings.duration` 时，输出跟随源视频时长。
* 多镜头提示词使用 1–6 个镜头片段，镜头时长之和等于请求时长。编辑源视频不使用多镜头生成。

> [card] [Kling 3.0 Omni API 参考](https://docs.anyfast.ai/zh/api-reference/model-api/kling/kling-3.0-omni.md)
>
> 查看 v2 contents 和任务字段。


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