136+ 创意视频特效,包括节日主题、动态效果和风格变换。将特效应用于照片,生成精彩视频。
在所有请求中添加 Bearer Token 认证头:
Authorization: Bearer YOUR_API_KEY
| 模型 | API 名称 | 特性 |
|---|---|---|
| Kling 视频特效 | kling-effects | 136+ 创意视频特效, 支持单人和双人 |
| 类别 | $ | 示例 |
|---|---|---|
| 超低 | $0.0106 | pet_lion, pet_cat, pet_dog |
| 低 | $0.0181 | santa_gift |
| 中等 (基础) | $0.0214 | santa_express, balloon_parade |
| 中高 | $0.0373 | bloombloom, dizzydizzy, face_warp |
| 高 | $0.0425 | happy_birthday, birthday_cake |
| 超高 | $0.0745 | bullet_time |
/api/v1/video/generations创建可灵特效视频生成任务。将创意特效应用于一张或两张人物照片。
/api/v1/video/generations?task_id=xxx查询任务状态并获取视频链接
curl -X POST https://apimodels.app/api/v1/video/generations \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"model": "kling-effects",
"effect_scene": "balloon_parade",
"input": {
"image": "https://example.com/person.jpg"
}
}'{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "pending",
"model": "kling-video/kling-effects"
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "completed",
"model": "kling-video/kling-effects",
"resultUrls": ["https://...video.mp4"],
"createTime": 1705123450000,
"completeTime": 1705123500000
}
}{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"state": "failed",
"model": "kling-video/kling-effects",
"failMsg": "Content policy violation"
}
}在创建请求中传入 callback_url 后,任务进入 completed 或 failed 终态时,我们会向该地址发起一次 HTTP POST。请求头仅包含 Content-Type: application/json,无签名头。失败会自动重试 3 次(指数退避 1s/2s/4s,单次超时 10s);如果仍未成功,后台会在 30 分钟内继续补偿重发,直到接收端返回 2xx。
POST {your callback_url}
Content-Type: application/json
{
"code": 200,
"msg": "success",
"data": {
"taskId": "clxxx...",
"model": "kling-video/kling-effects",
"state": "completed" | "failed",
"param": "<JSON string>", // request params, JSON.parse once
"resultJson": "<JSON string> | null", // result object, JSON.parse once
"failCode": null | "string",
"failMsg": null | "string",
"costTime": 12345, // duration in ms
"completeTime": 1705123500000, // ms epoch
"createTime": 1705123450000 // ms epoch
}
}注意:data.param 与 data.resultJson 都是 JSON 字符串,使用前必须 JSON.parse 一次。
{
"resultUrls": ["https://r2.apimodels.app/videos/xxx.mp4"],
"videoDuration": 5 // optional, seconds
}resultUrls 始终存在,长度通常为 1(失败时为空数组)。其它字段可选。state=failed 时 resultJson 通常为 null 或 {"resultUrls":[]}。
app.post('/webhook/kling-effects', express.json(), (req, res) => {
const { taskId, state, resultJson, failMsg } = req.body.data
if (state === 'completed') {
const r = JSON.parse(resultJson)
console.log('video ready', taskId, r.resultUrls[0], r.videoDuration)
} else {
console.warn('video failed', taskId, failMsg)
}
res.status(200).end() // must be 2xx, otherwise we retry
})pending任务已排队,等待处理processing视频生成中completed视频生成成功failed视频生成失败400请求错误 - 参数缺失或无效401未授权 - API 密钥无效402余额不足 - 积分不够404未找到 - 任务 ID 不存在500服务器内部错误