跳转到内容
打开 Castaly控制台

视频

kling-2.6 API

通过 Modelflare 异步视频入口使用精确的 kling-2.6 模型 ID。

使用精确模型 ID kling-2.6。请求中的模型名必须与本页完全一致。

示例输出kling-2.6POST /v1/videos5.0s

请求参数:duration=5resolution=1080pratio=16:9

提示词:One continuous take, no cuts. An automatic car wash bay, brushes stopped mid-turn, foam sliding down the glass. A figure in a translucent PVC raincoat steps into the bay and the foam stops being foam: it sets into iridescent shells that peel off the car and the walls and drift up around the coat, each one catching a different colour. The camera pushes in slowly through the bay and rotates around the figure as the shells rise. One hard magenta wash light from the far end, cold blue daylight at the entrance. Real weight and inertia, soap and water still running, no text.

生成该示例的请求
{
"model": "kling-2.6",
"prompt": "One continuous take, no cuts. An automatic car wash bay, brushes stopped mid-turn, foam sliding down the glass. A figure in a translucent PVC raincoat steps into the bay and the foam stops being foam: it sets into iridescent shells that peel off the car and the walls and drift up around the coat, each one catching a different colour. The camera pushes in slowly through the bay and rotates around the figure as the shells rise. One hard magenta wash light from the far end, cold blue daylight at the entrance. Real weight and inertia, soap and water still running, no text.",
"seconds": "5",
"duration": 5,
"resolution": "1080p",
"ratio": "16:9",
"aspect_ratio": "16:9"
}

使用 Modelflare API Key,通过 https://modelflare.dev/v1 发送请求。网关入口为 POST /v1/videos。

HTTP
Authorization: Bearer YOUR_MODELFLARE_API_KEY
终端窗口bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "kling-2.6",
"prompt": "一只白猫在雨夜霓虹街道上奔跑,电影感跟拍",
"duration": "5", "mode": "std"
}'

提交成功后保存任务 ID。使用 GET /v1/videos/{task_id} 轮询,完成后使用 GET /v1/videos/{task_id}/content 下载;结果地址可能过期,应及时转存。

终端窗口bash
curl https://modelflare.dev/v1/videos/TASK_ID \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY"

Kling 按模型族使用 model_name、prompt、mode、duration、image_list 或 contents / settings;原生 JSON 会保留并转发。

Kling Legacy 使用 model_name 和统一的 text2video / image2video 请求结构。具体模式、分辨率和音频档位以当前模型的官方页面与价格页为准。

字段 必填 说明
model_name 是 kling-2.6
prompt 条件 文生视频必填;图生视频可与图片组合
image 条件 首帧图片 URL 或 Base64
image_tail 否 可选尾帧图片
video_url 条件 Kling 3.0 motion-control 的参考视频
image_list 否 Omni/O1 或多媒体工作流中的图片列表
negative_prompt 否 负向提示词
mode 否 std / pro / 4k(视模型而定)
duration 否 5 / 10(字符串)
multi_shot 否 是否启用多镜头分镜
sound 否 支持时生成同步音效
camera_control 否 运镜控制(模型支持时)

Kling 2.6 使用 Legacy API,固定 5/10 秒,支持 720p/1080p、16:9/9:16/1:1、图生视频、原生音频和 motion control;sound 可用 on/off。

Legacy 模型根据工作流选择 model_name、首帧/尾帧或 motion-control 字段;固定时长和音频限制以本页表格为准。

终端窗口bash
curl https://modelflare.dev/v1/videos \
-H "Authorization: Bearer YOUR_MODELFLARE_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model_name": "kling-2.6", "prompt": "一只狗在海边奔跑",
"duration": "5", "mode": "pro", "aspect_ratio": "16:9", "sound": "on"
}'

参数不符合模型契约时,创建接口会返回带 request ID 的 4xx。异步任务也可能在创建成功后进入 failed;轮询响应中的 error_code 和 error_message 才是该任务的最终原因。不要把同一请求改成另一种 JSON 结构重试。

本页只覆盖 Modelflare 的模型生成/编辑调用。搜索或地图增强、声音管理、元素库管理等资源型接口不属于本页的公开调用范围,也不需要作为模型请求字段传入。

本模型按视频秒计费。请查看模型价格页查看当前销售价、参考原价和完整规格。

媒体契约 · v1

契约 ID: media.kling-2-6.v1Adapter: video.kling.legacy.v1@v1指纹: b53fa35546d2b5028a69146a031a053d852003d673d1b7a334d8b124997101cc

官方来源: Kuaishou Kling

契约参数

Intent 字段控件选项
ratioselect16:9 / 9:16 / 1:1
resolutionselect720p / 1080p
durationselect5 / 10
audioswitch—

支持能力

  • allowed_values · ratio · 16:9, 9:16, 1:1
  • allowed_values · resolution · 720p, 1080p
  • allowed_values · duration · 5, 10
  • max_assets · reference_asset_ids · 2

结构化请求示例

text

Intent

{
  "audio": false,
  "duration": 5,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "720p"
}

上游请求

{
  "aspect_ratio": "16:9",
  "duration": "5",
  "mode": "std",
  "model_name": "kling-2.6",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "sound": "off"
}

reference

Intent

{
  "audio": false,
  "duration": 5,
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "ratio": "16:9",
  "resolution": "720p"
}

上游请求

{
  "aspect_ratio": "16:9",
  "duration": "5",
  "image": "https://example.com/reference.png",
  "mode": "std",
  "model_name": "kling-2.6",
  "prompt": "A red paper kite over a quiet harbour at dusk.",
  "sound": "off"
}