# Kling 3.0 Omni

> 可灵 3.0 Omni 统一多模态视频模型，支持文生、首尾帧图生与最多 7 个参考图或主体的参考生视频，最高 4K、3–15 秒

- 模型页: https://yir.ai/zh/models/kling-3-omni
- 模型 ID: `klingai/kling-3.0-omni`
- 计费：按实际执行渠道的上游计费收取；上游未计费的尝试不收费。

## 价格

同一输出规格下各渠道的当前公开价；官方价为参考。实际按执行渠道计费，故障转移时可能切换渠道。

| 输出规格 | 渠道 | 公开价 |
|---|---|---|
| 720p · 无音频 | Kling AI (官方) | $0.084 / 秒 |
| 720p · 无音频 | APIMart | $0.0672 / 秒 |
| 720p · 无音频 | KIE | $0.0755 / 秒 |
| 720p · 无音频 | FAL | $0.084 / 秒 |
| 720p · 含音频 | Kling AI (官方) | $0.112 / 秒 |
| 720p · 含音频 | APIMart | $0.0896 / 秒 |
| 720p · 含音频 | KIE | $0.101 / 秒 |
| 720p · 含音频 | FAL | $0.112 / 秒 |
| 1080p · 无音频 | Kling AI (官方) | $0.112 / 秒 |
| 1080p · 无音频 | APIMart | $0.0896 / 秒 |
| 1080p · 无音频 | KIE | $0.101 / 秒 |
| 1080p · 无音频 | FAL · pro | $0.112 / 秒 |
| 1080p · 含音频 | Kling AI (官方) | $0.14 / 秒 |
| 1080p · 含音频 | APIMart | $0.112 / 秒 |
| 1080p · 含音频 | KIE | $0.126 / 秒 |
| 1080p · 含音频 | FAL · pro | $0.14 / 秒 |
| 4K | Kling AI (官方) | $0.42 / 秒 |
| 4K | KIE | $0.3775 / 秒 |
| 4K | FAL · native4k | $0.42 / 秒 |
| 4K | APIMart | $0.4286 / 秒 |

## 参数

- 操作: `generate_video`

| 参数 | 可选值 | 默认值 |
|---|---|---|
| `input` | text / reference / image | text |
| `resolution` | 720p / 1080p / 4K | 720p |
| `aspect_ratio` | 16:9 / 9:16 / 1:1 | 16:9 |
| `duration` | 3 / 4 / 5 / 6 / 7 / 8 / 9 / 10 / 11 / 12 / 13 / 14 / 15 | 5 |
| `generate_audio` | true / false | false |

## 接入

两种方式任选：新项目用官方 SDK；已按 OpenAI 协议对接的项目换 Base URL 即可。

### 官方 SDK（TypeScript）

SDK 调用 Standard API（https://gateway.yir.ai），支持提交、等待和获取结果，另有 Go SDK。 https://yir.ai/zh/docs/integrations/sdk

```bash
pnpm add @yir-ai/sdk
```

```ts
import { createNodeYirClient } from "@yir-ai/sdk/server";

// Reads YIR_API_KEY from the environment by default: process.env.YIR_API_KEY
const client = createNodeYirClient();

// 1. Submit a video generation job
const job = await client.submitVideo({
  model: "klingai/kling-3.0-omni",
  input: {
    type: "text",
    prompt: "一只海龟缓缓游过珊瑚礁，镜头从侧面平稳跟随，阳光穿过清澈海水，在龟背上形成流动的光纹",
  },
  parameters: {
    duration: 5,
    resolution: "720p",
    aspect_ratio: "16:9",
    generate_audio: false,
    n: 1,
  },
});

// 2. Wait for the job to finish and deliver its result
const result = await client.waitForJob(job.id);
console.log("Delivered files:", result.result);
if (result.result && "files" in result.result) {
  for (const file of result.result.files) {
    console.log("->", file.url);
  }
}
```

### OpenAI 兼容 API

OpenAI Images 与 Sora Videos 协议，适用于 OpenAI SDK 和 new-api 等网关；不支持对话。 https://yir.ai/zh/docs/integrations/openai-compatibility

- OpenAI SDK base_url: `https://gateway.yir.ai/openai/v1`
- new-api 渠道 Base URL（渠道类型 OpenAI）: `https://gateway.yir.ai/openai`
- 模型 ID: `klingai/kling-3.0-omni`

```bash
curl https://gateway.yir.ai/openai/v1/videos \
  -H "Authorization: Bearer $YIR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "model": "klingai/kling-3.0-omni",
    "prompt": "一只海龟缓缓游过珊瑚礁，镜头从侧面平稳跟随，阳光穿过清澈海水，在龟背上形成流动的光纹",
    "resolution": "720p",
    "aspect_ratio": "16:9",
    "seconds": "5"
  }'
```

## 常见问题

### Kling 3.0 Omni 有官方 API 吗？

有。Kling AI 通过自己的官方 API 提供 Kling 3.0 Omni。同规格下，Yir 上第三方渠道的公开价最多比官方低 20%（见上表），用一个 Yir API Key 即可全部调用。

## 接入须知

- 使用 Authorization: Bearer $YIR_API_KEY 鉴权；Key 只放服务端环境变量，不进浏览器代码、仓库、提示词或日志。
- 任务是异步的：提交后保存 Job ID，等待终态再读取结果；处理失败与取消。
- 安全重试时复用同一个幂等键和请求，不要在结果未知时盲目重新提交。
- 结果链接是临时的，需要长期保存请自行转存。

## 链接

- [快速开始](https://yir.ai/zh/docs/getting-started/quickstart)
- [API 参考](https://yir.ai/zh/docs/reference)
- [llms.txt](https://yir.ai/llms.txt)
