跳转到主要内容
POST
cURL
使用 POST /omni-video/{model} 创建异步 Kling Omni 视频任务。在 URL 中指定模型 ID,并通过 contents 提供输入。

选择模型

  • kling-4.0: 720p 或 1080p;时长为 3-30 秒;没有 audio 字段。除固定宽高比外,还支持 adaptive 宽高比,并接受 middle_frame 内容。
  • kling-3.0-omni: 720p, 1080p,或 4k;时长为 3-15 秒;支持 native、original 或 off 音频。
  • kling-o1: 720p 或 1080p;时长为 3-10 秒;支持 original 或 off 音频。
纯文本示例使用 kling-3.0-omni。要创建无声视频,请将 settings.audio 设置为 off。

请求参数

对于 kling-4.0,最多允许一个 base_video 内容项。对于 kling-3.0-omni,feature_video 输入需要 settings.multi_shot: true 和 settings.audio: off。base_video 输入需要 settings.multi_shot: false,且不能使用 settings.audio: native。不要将 base_video 与首帧或末帧同时使用。 kling-3.0-omni 的官方默认值为 multi_shot: true;需要指定镜头模式时,请显式设置该字段。对于 kling-o1,Prompt 最多可包含 2500 个字符。如果请求仅包含一个 first_frame,没有其他参考图像或视频,请使用 5 秒或 10 秒的时长。 要创建一个 5 秒的纯文本视频,请将以下请求正文发送到 POST /omni-video/kling-3.0-omni:
响应会返回异步任务的 id:
使用 data.id 值调用 获取 Kling 任务 ,直到任务完成。从任务的 outputs 数组中读取生成的视频 URL。如果需要持久访问,请将视频存储在自己的存储空间中。 OpenAPI 面板中包含对应的 Shell、Python 和 JavaScript 请求。有关更多输入组合,请参阅 Kling 3.0 Omni 视频 API 参考 或 Kling O1 Omni 视频 API 参考.

授权

Authorization
string
header
必填

Authenticate with your CometAPI API key.

路径参数

model
enum<string>
必填

Kling Omni model ID. The selected model controls resolution, duration, and audio choices. kling-4.0 adds the adaptive ratio and the middle_frame input role.

可用选项:
kling-4.0,
kling-3.0-omni,
kling-o1

请求体

application/json

Omni video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.

contents
object[]
必填

Video input items. Send a prompt item for text-only generation.

Minimum array length: 1
settings
object

Output settings exposed by the CometAPI route. Set model-specific fields explicitly for the intended result.

options
object

Optional task fields exposed by the CometAPI route.

响应

200 - application/json

Task created. Store data.id for a GET /tasks query.

code
必填

Result code. 0 indicates task creation.

message
string
必填

Result message.

data
object
必填

Task identification and submission status.

msg
string

Additional result message, when included.

最后修改于 2026年11月13日