动作控制
POST /motion-control/kling-3.0:用参考视频的动作驱动参考图中的人物,异步,用 GET /tasks 查询
POST/motion-control/kling-3.0
用动作参考视频驱动形象参考图中的人物。
| 项 | 值 |
|---|---|
| 模型 | kling-3.0-motion-control(路径写 kling-3.0) |
| 模式 | 异步(提交 → 轮询 GET /tasks,见查询任务) |
| 计费 | 按输出视频实际时长结算,提交时预冻结 |
快速开始
curl https://api.vibelab.me/motion-control/kling-3.0 \
-H "Authorization: Bearer $LOOPTOKEN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"contents": [
{
"type": "prompt",
"text": "女孩穿着宽松的灰色 T 恤和牛仔短裤"
},
{
"type": "image",
"url": "https://example.com/girl.png"
},
{
"type": "video",
"url": "https://example.com/dance.mp4"
}
],
"settings": {
"character_orientation": "video",
"resolution": "1080p",
"audio": "original"
}
}'响应示例:
{
"code": 0,
"message": "SUCCEED",
"request_id": "6a0d571e-d36c-4811-bb2b-698c94b19a8c",
"data": {
"id": "893605946402811985",
"status": "submitted",
"create_time": 1781080778802,
"update_time": 1781080778802,
"external_id": "your-id"
}
}请求参数
请求头
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
Authorization | string | 是 | - | Bearer $LOOPTOKEN_API_KEY |
Content-Type | string | 是 | - | application/json |
请求体
| 参数 | 类型 | 必填 | 默认 | 说明 |
|---|---|---|---|---|
contents[].type=prompt | object | 否 | - | 提示词,字段 text,不超过 2500 个字符 |
contents[].type=image | object | 是 | - | 形象参考图,字段 url(URL 或 Base64),有且仅有 1 张 |
contents[].type=video | object | 是 | - | 动作参考视频,字段 url,有且仅有 1 个 |
contents[].type=element | object | 否 | - | 主体引用,字段 element_id 和 id,最多 1 个 |
settings.character_orientation | string | 是 | - | 人物朝向:image(与图片一致,参考视频 3–10 秒)或 video(与视频一致,参考视频 3–30 秒) |
settings.resolution | string | 否 | 720p | 720p、1080p |
settings.audio | string | 否 | original | original(保留参考视频原声)或 off |
options.callback_url | string | 否 | - | 任务状态变化时的 HTTPS 回调地址,见概览 |
options.external_task_id | string | 否 | - | 自定义任务 ID,同一账号下不可重复 |
options.watermark_info.enabled | boolean | 否 | false | 是否同时生成含水印结果 |
响应
| 字段 | 类型 | 说明 |
|---|---|---|
code | integer | 0 表示成功,其余见错误 |
message | string | 错误信息 |
request_id | string | 请求 ID,排查问题时提供 |
data.id | string | 任务 ID |
data.status | string | submitted、processing、succeeded、failed |
data.create_time、data.update_time | integer | Unix 毫秒时间戳 |
data.external_id | string | 创建时传入的 options.external_task_id,没传则无此字段 |
计费
按输出视频的实际时长(不足 1 秒向上取整)结算。提交时按参考视频时长上限预冻结额度(character_orientation 为 video 时 30 秒,为 image 时 10 秒),任务结束后多退少补;失败全额退回。
错误
本页参数校验返回 400 / 1201,message 原文如下:
| HTTP | code | 触发场景 | 处理 |
|---|---|---|---|
| 404 | 1203 | model not found(路径 {model} 不是 kling-3.0) | 路径固定写 kling-3.0 |
| 400 | 1201 | contents is required and must be a non-empty array | 传非空 contents |
| 400 | 1201 | contents image requires a url / contents video requires a url | image、video 项补 url |
| 400 | 1201 | unsupported contents type "..." for motion-control | 只接受 prompt、image、video、element |
| 400 | 1201 | contents must include exactly one image and one video | 各传且仅传 1 项 |
| 400 | 1201 | at most 1 element is supported | element 至多 1 个 |
| 400 | 1201 | prompt must not exceed 2500 characters | 缩短提示词 |
| 400 | 1201 | settings.character_orientation must be image or video | 必传 image 或 video |
| 400 | 1201 | settings.resolution "..." is not supported for motion-control | 传 720p 或 1080p |
| 400 | 1201 | settings.audio "..." is not supported for motion-control | 传 original 或 off |
通用错误(鉴权、余额、并发、回调地址、上游错误)见 Kling 错误。
注意事项
- 模型名 → 路径中的
kling-3.0是官方写法,计费按模型kling-3.0-motion-control处理。 - 素材限制 → 图片支持 jpg、jpeg、png,不超过 50MB,宽高不小于 300px,宽高比 1:2.5 到 2.5:1;视频支持 mp4、mov,不超过 100MB,宽高在 340px 到 3850px 之间。
- 动作过快或过难 → 模型只提取有效动作,输出可能短于参考视频。