---
title: "Kling VIDEO 3.0"
url: "/docs/kling-3"
base_url:
  - "https://api.o1key.com"  # 主地址
auth: "Authorization: Bearer <API Key>"
endpoints:
  - "POST /text-to-video/kling-3.0"
  - "POST /image-to-video/kling-3.0"
  - "POST /omni-video/kling-3.0-omni"
  - "POST /motion-control/kling-3.0"
---

# Kling VIDEO 3.0

可灵 3.0 文生视频、图生视频、3.0 Omni（多素材参考、视频编辑）和动作模仿。路径与可灵官方一致，提交后返回 `data.id`，用 `GET /tasks` 查询。客户端使用任务 ID 轮询状态，提交时请省略 `callback_url`。

## Agent 调用规则

1. 按需求选路径：POST `/text-to-video/kling-3.0`、`/image-to-video/kling-3.0`、`/omni-video/kling-3.0-omni` 或 `/motion-control/kling-3.0`。请求体不传 `model`。记录 `data.id`。
2. 定期 GET `/tasks?task_ids={id}`，`submitted` 或 `processing` 时继续查询。
3. `succeeded`：把 `data[0].outputs[0].url` 返回给用户。
4. `failed`：把 `data[0].message` 告诉用户，不要自动重试。

## 简明说明

### 这个接口做什么？

用可灵 3.0 生成视频：文生视频只用提示词；图生视频用首帧（可加尾帧和主体）；Omni 可以组合提示词、首尾帧、参考图和参考视频，也能编辑视频；动作模仿让图片中的角色按一段视频的动作动起来。用法和可灵官方完全一样，只需把 Base URL 换成本站、使用本站 API Key。

### 你需要提供的信息

- **做什么**：文生视频 `/text-to-video/kling-3.0`，图生视频 `/image-to-video/kling-3.0`，Omni `/omni-video/kling-3.0-omni`，动作模仿 `/motion-control/kling-3.0`。
- **提示词和素材**：文生视频用 `prompt`；其他接口用 `contents` 数组：`prompt` 项写描述，图片、视频项填 `url`。
- **输出设置**：`settings`：时长、分辨率、音频；文生视频和 Omni 还可以设画面比例。

### 怎么拿到结果

- **状态**：`submitted`、`processing` 继续等待；`succeeded` 成功；`failed` 失败。
- **视频地址**：`data[].outputs[].url`。计费时长见 `usage.output_duration`。

## 路径与查询

### 创建与单任务查询

| 类型 | 提交 | 按任务 ID 查询 |
|---|---|---|
| 文生视频 | `POST /text-to-video/kling-3.0` | `GET /text-to-video/kling-3.0/{task_id}` |
| 图生视频 | `POST /image-to-video/kling-3.0` | `GET /image-to-video/kling-3.0/{task_id}` |
| Omni | `POST /omni-video/kling-3.0-omni` | `GET /omni-video/kling-3.0-omni/{task_id}` |
| 动作模仿 | `POST /motion-control/kling-3.0` | `GET /motion-control/kling-3.0/{task_id}` |

- 请求头：`Authorization: Bearer <API Key>`，`Content-Type: application/json`。
- 路径与可灵官方完全一致，Base URL 换成本站即可。模型由路径决定，请求体不要传 `model`。
- 创建和查询的响应与可灵官方一致：`{code, message, request_id, data}`。`data.id` 是任务 ID。状态：`submitted`、`processing`、`succeeded`、`failed`。
- 批量查询 `GET /tasks?task_ids=`、按自定义 ID 查询 `GET /tasks?external_task_ids=` 和游标查询 `POST /tasks` 的参数与 4.0 相同，见 [查询任务](/docs/kling-4.md)。
- 不支持 `options.callback_url`，请用任务 ID 轮询。

可灵说明：[文生视频](https://kling.ai/document-api/api/video/3-0-omni/text-to-video)、[图生视频](https://kling.ai/document-api/api/video/3-0-omni/image-to-video)、[Omni](https://kling.ai/document-api/api/video/3-0-omni/video-omni)、[动作模仿](https://kling.ai/document-api/api/video/motion-control)。

### 价格

打开[模型定价](/pricing)，选择模型和分组即可查看当前售价。实际扣费以你所在分组的倍率为准。

### 查询任务

```bash
curl "https://api.o1key.com/tasks?task_ids=task_xxxxxxxxxx" \
  -H "Authorization: Bearer $API_KEY"
```

### 成功响应

```json
{
  "code": 0,
  "message": "SUCCEED",
  "request_id": "req_xxxxxxxxxx",
  "data": [
    {
      "id": "task_xxxxxxxxxx",
      "status": "succeeded",
      "message": "",
      "create_time": 1781080778802,
      "update_time": 1781080794151,
      "external_id": "",
      "outputs": [
        {
          "type": "video",
          "id": "video_xxxxxxxxxx",
          "url": "https://cdn.example.com/result.mp4",
          "watermark_url": "",
          "duration": "5.04"
        }
      ],
      "usage": {"output_duration": "5"}
    }
  ]
}
```

ID、链接仅为示例。处理中时 `status` 为 `processing`，没有 `outputs`；失败时 `status` 为 `failed`，原因在 `message`。

## 文生视频

`POST /text-to-video/kling-3.0`

只用提示词生成视频。要用图片或视频做参考，请用 [Omni](#/omni-video/kling-3.0-omni)。

### 请求参数

| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `prompt` | string | 是 | 描述画面、动作和镜头，最多 3072 字符。 |
| `settings.duration` | integer | 否 | 3–15 秒的整数。 |
| `settings.resolution` | string | 否 | `720p`、`1080p`、`4k`。 |
| `settings.aspect_ratio` | string | 否 | `16:9`、`9:16`、`1:1`。 |
| `settings.audio` | string | 否 | `native` 按画面生成音频；`off` 无音频。 |
| `settings.multi_shot` | boolean | 否 | 是否生成多镜头。多镜头提示词写法为“镜头序号, 秒数, 描述;”。 |
| `options.external_task_id` | string | 否 | 自定义任务 ID，账号内唯一。用 `GET /tasks?external_task_ids=` 查询。 |
| `options.watermark_info.enabled` | boolean | 否 | 是否同时生成带水印结果，默认 `false`。 |

只接受上表字段，其他字段会返回 400。

### 请求示例

```bash
curl https://api.o1key.com/text-to-video/kling-3.0 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "prompt": "A cinematic sunrise over a quiet harbor, gentle waves and seagulls.",
    "settings": {"duration": 5, "resolution": "1080p", "aspect_ratio": "16:9", "audio": "native"}
  }'
```

### 响应示例

#### 成功 · 200

```json
{
  "code": 0,
  "message": "",
  "request_id": "req_xxxxxxxxxx",
  "data": {
    "id": "task_xxxxxxxxxx",
    "status": "submitted",
    "create_time": 1781080778802,
    "update_time": 1781080778802,
    "external_id": ""
  }
}
```

#### 失败 · 400

```json
{
  "code": 1201,
  "message": "prompt is required",
  "request_id": "req_xxxxxxxxxx"
}
```

## 图生视频

`POST /image-to-video/kling-3.0`

用首帧生成视频，可加尾帧和最多 3 个主体。

### 请求参数

| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `contents` | array | 是 | 首帧、尾帧、提示词和主体。 |
| `contents[].type` | string | 是 | `first_frame`（必须且只能 1 个）、`last_frame`（最多 1 个）、`prompt`、`element`（最多 3 个）。 |
| `contents[].url` | string | 条件 | 首帧、尾帧必填。公开 URL 或 Base64。 |
| `contents[].text` | string | 条件 | `type=prompt` 时必填，最多 3072 字符。 |
| `contents[].element_id` | string | 条件 | `type=element` 时必填，来自 [主体管理](/docs/kling-4.md)。 |
| `contents[].id` | string | 否 | 任务内唯一，可在提示词中用 `@id` 引用。 |
| `settings` | object | 否 | 同文生视频的 `duration`、`resolution`、`audio`、`multi_shot`。不能传 `aspect_ratio`，比例跟随首帧。 |
| `options` | object | 否 | 同文生视频。 |

### 请求示例

```bash
curl https://api.o1key.com/image-to-video/kling-3.0 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "The girl turns around and smiles, the camera slowly pushes in."},
      {"type": "first_frame", "url": "https://cdn.example.com/start.png"},
      {"type": "last_frame", "url": "https://cdn.example.com/end.png"}
    ],
    "settings": {"duration": 5, "resolution": "1080p", "audio": "off"}
  }'
```

### 响应示例

#### 成功 · 200

```json
{
  "code": 0,
  "message": "",
  "request_id": "req_xxxxxxxxxx",
  "data": {
    "id": "task_xxxxxxxxxx",
    "status": "submitted",
    "create_time": 1781080778802,
    "update_time": 1781080778802,
    "external_id": ""
  }
}
```

#### 失败 · 400

```json
{
  "code": 1201,
  "message": "image-to-video requires one first_frame and at most one last_frame",
  "request_id": "req_xxxxxxxxxx"
}
```

## Kling 3.0 Omni 视频生成

`POST /omni-video/kling-3.0-omni`

使用官方 `contents`、`settings`、`options` 结构，模型由路径决定，不要传 `model`。返回 `data.id`，用 [GET /tasks](/docs/kling-4.md) 查询。

### 请求参数

| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `contents` | array | 是 | 提示词、图片和视频输入集合。 |
| `contents[].type` | string | 是 | `prompt`、`first_frame`、`last_frame`、`refer_image`、`feature_video`、`base_video`。 |
| `contents[].text` | string | 条件 | `type=prompt` 时必填。官方上限 3072 字符，建议不超过 2500 字符。 |
| `contents[].url` | string | 条件 | 图片支持公开 URL 或 Base64；视频使用可公开访问的 URL。 |
| `contents[].id` | string | 否 | 任务内唯一的引用 ID，可在提示词中以 `@id` 引用。 |
| `settings` | object | 条件 | 输出设置。没有首帧或参考视频时必须提供，并填写 `aspect_ratio`。 |
| `settings.multi_shot` | boolean | 否 | 是否生成多镜头，默认 `true`。 |
| `settings.audio` | string | 否 | `native` 生成原生音频；`original` 保留参考视频声音；`off` 无音频。默认 `off`。 |
| `settings.resolution` | string | 否 | `720p`、`1080p`、`4k`，默认 `720p`。 |
| `settings.aspect_ratio` | string | 条件 | `16:9`、`9:16`、`1:1`。没有首帧或参考视频时必填。 |
| `settings.duration` | integer | 否 | 3-15 秒的整数，默认 5 秒。 |
| `options.external_task_id` | string | 否 | 调用方自定义且账号内唯一的任务 ID。 |
| `options.watermark_info.enabled` | boolean | 否 | 是否同时生成带水印结果，默认 `false`。 |

### 素材与组合规则

- 图片支持 JPG、JPEG、PNG，单文件不超过 50MB；宽高均不低于 300px，宽高比在 1:2.5 至 2.5:1 之间。
- 首尾帧仅支持“仅首帧”或“首帧 + 尾帧”，不支持只传尾帧。
- 视频支持 MP4、MOV，单文件不超过 200MB，时长 3-15.5 秒；最多传入 1 个参考视频。
- `feature_video` 用作特征参考：`multi_shot` 必须为 `true`，`audio` 使用 `off`。
- `base_video` 用作视频编辑：不能同时传首尾帧，`multi_shot` 必须为 `false`，`audio` 可用 `original` 或 `off`。
- 多镜头提示词写法为“镜头序号, 秒数, 描述;”，支持 1-6 个镜头；各镜头时长之和必须等于 `settings.duration`。

### 请求示例

#### 纯文本

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "A cinematic sunrise over a quiet harbor, gentle waves and native ambient sound."}
    ],
    "settings": {
      "resolution": "1080p",
      "aspect_ratio": "16:9",
      "duration": 5,
      "audio": "native",
      "multi_shot": false
    }
  }'
```

#### 首帧 + 参考图

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "@image_1 walks into the scene; match the color palette of @image_2."},
      {"type": "first_frame", "url": "https://cdn.example.com/start.png", "id": "image_1"},
      {"type": "refer_image", "url": "https://cdn.example.com/style.png", "id": "image_2"}
    ],
    "settings": {"resolution": "1080p", "duration": 5, "audio": "native", "multi_shot": false}
  }'
```

#### 首尾帧

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "Create a smooth cinematic transition from @start to @end."},
      {"type": "first_frame", "url": "https://cdn.example.com/start.jpg", "id": "start"},
      {"type": "last_frame", "url": "https://cdn.example.com/end.jpg", "id": "end"}
    ],
    "settings": {"resolution": "1080p", "duration": 8, "audio": "off", "multi_shot": false}
  }'
```

#### Base64 图片

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "Animate @image_1 with a slow camera push-in."},
      {"type": "first_frame", "url": "data:image/png;base64,iVBORw0KGgoAAA...", "id": "image_1"}
    ],
    "settings": {"resolution": "720p", "duration": 5, "audio": "off", "multi_shot": false}
  }'
```

#### 多模态 · 图 + 视频

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "type": "prompt",
        "text": "Use @image_1 as the character and clothing reference; reproduce the camera movement and action rhythm of @video_1."
      },
      {
        "type": "refer_image",
        "url": "https://cdn.example.com/character.png",
        "id": "image_1"
      },
      {
        "type": "feature_video",
        "url": "https://cdn.example.com/camera-and-motion.mp4",
        "id": "video_1"
      }
    ],
    "settings": {
      "resolution": "1080p",
      "audio": "off",
      "multi_shot": true
    },
    "options": {
      "external_task_id": "omni-multimodal-001",
      "watermark_info": {"enabled": false}
    }
  }'
```

#### 多镜头

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {
        "type": "prompt",
        "text": "shot 1, 3, Wide shot: a traveler walks across a misty mountain ridge at sunrise; shot 2, 3, Close-up: the traveler stops, turns toward the warm sunlight, and smiles;"
      }
    ],
    "settings": {
      "resolution": "1080p",
      "aspect_ratio": "16:9",
      "duration": 6,
      "audio": "native",
      "multi_shot": true
    },
    "options": {
      "external_task_id": "omni-multishot-001",
      "watermark_info": {"enabled": false}
    }
  }'
```

#### 特征视频

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "Use the camera rhythm and visual features of @video_1."},
      {"type": "feature_video", "url": "https://cdn.example.com/reference.mp4", "id": "video_1"}
    ],
    "settings": {"resolution": "4k", "audio": "off", "multi_shot": true}
  }'
```

#### 基础视频

```bash
curl https://api.o1key.com/omni-video/kling-3.0-omni \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "Change the weather to light rain while preserving the original subject and motion."},
      {"type": "base_video", "url": "https://cdn.example.com/source.mov", "id": "video_1"}
    ],
    "settings": {"resolution": "1080p", "audio": "original", "multi_shot": false}
  }'
```

### 响应示例

#### 成功 · 200

```json
{
  "code": 0,
  "message": "",
  "request_id": "req_xxxxxxxxxx",
  "data": {
    "id": "task_xxxxxxxxxx",
    "status": "submitted",
    "create_time": 1781080778802,
    "update_time": 1781080778802,
    "external_id": ""
  }
}
```

#### 失败 · 400

```json
{
  "code": 1201,
  "message": "settings.aspect_ratio is required when no first frame or reference video is provided",
  "request_id": "req_xxxxxxxxxx"
}
```

## Kling 3.0 动作模仿

`POST /motion-control/kling-3.0`

请求体沿用 Kling 3.0 Motion Control 官方结构。每个任务提供 1 张角色外观参考图和 1 个动作参考视频；模型由路径决定。返回 `data.id`，用 [GET /tasks](/docs/kling-4.md) 查询。

### 请求参数

| 字段 | 类型 | 必填 | 说明 |
|---|---|---|---|
| `contents` | array | 是 | 由提示词、角色图片和动作视频组成。 |
| `contents[].type` | string | 是 | 本页展示 `prompt`、`image`、`video`。 |
| `contents[].text` | string | 条件 | `type=prompt` 时必填，最多 2500 字符；提示词本身可省略。 |
| `contents[].url` | string | 条件 | 图片支持公开 URL 或 Base64；动作视频使用公开 URL。 |
| `settings.character_orientation` | string | 是 | `video`：朝向跟随动作视频；`image`：朝向跟随参考图。 |
| `settings.audio` | string | 否 | `original` 保留动作视频原声；`off` 无音频。默认 `original`。 |
| `settings.resolution` | string | 否 | `720p`、`1080p`，默认 `720p`。 |
| `options.external_task_id` | string | 否 | 调用方自定义且账号内唯一的任务 ID。 |
| `options.watermark_info.enabled` | boolean | 否 | 是否同时生成带水印结果，默认 `false`。 |

### 素材规则

- 必须且只能传 1 个 `image` 和 1 个 `video`。
- 图片支持 JPG、JPEG、PNG，最大 50MB；宽高均不低于 300px，宽高比在 1:2.5 至 2.5:1 之间。
- 动作视频支持 MP4、MOV，最大 100MB，宽高均在 340-3850px 之间；建议使用人物完整可见、无遮挡、无切镜、无明显运镜的连续单镜头。
- `character_orientation=video` 时动作视频可为 3-30 秒；设为 `image` 时可为 3-10 秒。
- `video` 更适合复杂动作；`image` 保持参考图朝向，并更适合通过提示词控制镜头运动。

### 请求示例

#### 朝向跟随视频

```bash
curl https://api.o1key.com/motion-control/kling-3.0 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "The character wears a loose gray T-shirt and denim shorts."},
      {"type": "image", "url": "https://cdn.example.com/character.png"},
      {"type": "video", "url": "https://cdn.example.com/dance-10s.mp4"}
    ],
    "settings": {
      "character_orientation": "video",
      "resolution": "1080p",
      "audio": "original"
    },
    "options": {
      "external_task_id": "motion-order-001",
      "watermark_info": {"enabled": false}
    }
  }'
```

#### 朝向跟随图片

```bash
curl https://api.o1key.com/motion-control/kling-3.0 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "prompt", "text": "The camera slowly pulls back while the character performs the reference motion."},
      {"type": "image", "url": "https://cdn.example.com/character.jpg"},
      {"type": "video", "url": "https://cdn.example.com/motion-8s.mov"}
    ],
    "settings": {
      "character_orientation": "image",
      "resolution": "1080p",
      "audio": "off"
    }
  }'
```

#### Base64 图片

```bash
curl https://api.o1key.com/motion-control/kling-3.0 \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contents": [
      {"type": "image", "url": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQ..."},
      {"type": "video", "url": "https://cdn.example.com/motion-6s.mp4"}
    ],
    "settings": {
      "character_orientation": "video",
      "resolution": "720p",
      "audio": "original"
    }
  }'
```

### 响应示例

#### 成功 · 200

```json
{
  "code": 0,
  "message": "",
  "request_id": "req_xxxxxxxxxx",
  "data": {
    "id": "task_xxxxxxxxxx",
    "status": "submitted",
    "create_time": 1781080778802,
    "update_time": 1781080778802,
    "external_id": ""
  }
}
```

#### 失败 · 400

```json
{
  "code": 1201,
  "message": "motion control requires exactly one image and one video",
  "request_id": "req_xxxxxxxxxx"
}
```
