Kling 4.0 API
动作自然,支持 1080p。
| 分辨率 | 文本或图片 | 含视频输入 |
|---|---|---|
| 720p | 文本或图片31.4 积分/秒 ($0.157/秒) | 含视频输入18 积分/秒 ($0.09/秒) |
| 1080p | 文本或图片47 积分/秒 ($0.235/秒) | 含视频输入27 积分/秒 ($0.135/秒) |
使用参考视频或编辑视频时,计费秒数 = max(输入 + 输出,2 × 输出)。
完整价格 ↓
价格
价格自 2026-11-09 起生效
| 档位 | 价格 |
|---|---|
720p | 31.4 积分/秒 ($0.157/秒)注 13–30 秒 |
1080p | 47 积分/秒 ($0.235/秒)注 13–30 秒 |
720p(含视频输入) 720p-video | 18 积分/秒 ($0.09/秒)注 2, 33–30 秒 |
1080p(含视频输入) 1080p-video | 27 积分/秒 ($0.135/秒)注 2, 33–30 秒 |
- 最多冻结 30 秒,按实际时长扣费。
- 费率同时适用于输入和输出的秒数。
- 最多冻结 30 秒输出加 30 秒输入,按实际时长扣费。
1 积分 ≈ $0.005。按标准充值包计算;较大的充值包含赠送积分,实际单价更低。
交付与计费
- 成品
- 成品文件列在任务结果中,每个文件有素材 ID 和类型。
- 下载
- 文件保存 7 天,通过短期签名链接下载,可随时删除。
- 计费
- 任务受理时冻结积分,交付后扣费。生成失败,或 24 小时内未交付,冻结的积分会全部释放。
- 通知
- 按任务 ID 轮询,或使用签名 Webhook,并按 event_id 去重。
如何计费?
API 参考
任务只创建一次,之后按 ID 查询。 完整脚本(含上传和下载) · API 文档
API=https://api.vizoapi.com/v1
AUTH="Authorization: Bearer $VIZO_API_KEY"
# Create the task once and keep its ID.
ID=$(curl -fsS $API/generations -H "$AUTH" -H "Content-Type: application/json" \
-d '{
"model": "kling-4-0",
"input": {
"prompt": "雨夜霓虹街道的缓慢推镜",
"settings": {
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}
},
"metadata": {
"client_reference": "my-unique-reference-1"
}
}' | jq -r .id)
# Poll until the task closes, then read its status and result.
until curl -fsS $API/generations/$ID -H "$AUTH" | jq -e '.closed_at != null' > /dev/null; do sleep 5; done
curl -fsS $API/generations/$ID -H "$AUTH" | jq '{status, result}'全部字段
在 input 中发送这些字段。表中没有的字段会被拒绝,返回 HTTP 422 invalid_input。
- Send either
promptfor text-only generation orcontentsfor images and videos, never both. - Exactly one prompt, up to 10 images and 5 videos (at most one base_video). Videos must be MP4/MOV, at most 300 MB each, 3–30 seconds each and at most 30 seconds total. Repeated feature_video, refer_image or middle_frame items require unique ids.
- Repeated middle_frame, refer_image or feature_video entries require unique ids, cited in the prompt as @id.
aspect_ratioadaptivefollows your input images, so it needscontents; a text-only request withoutaspect_ratiois 16:9.
| 字段 | 说明 |
|---|---|
| 必填: Text-only generation. Up to 26000 Latin or 11000 other characters, counted together. 最多 26,000 个字符 |
| 必填: Exactly one prompt, up to 10 images and 5 videos (at most one base_video). Videos must be MP4/MOV, at most 300 MB each, 3–30 seconds each and at most 30 seconds total. Repeated feature_video, refer_image or middle_frame items require unique ids. 至少 1 项 · 最多 16 项 |
contents[]. | Item kind. 可选值 promptfirst_framemiddle_framelast_framerefer_imagefeature_videobase_video |
type 为 prompt 的项 | |
contents[]. | Prompt text. Up to 26000 Latin or 11000 other characters, counted together. 最多 26,000 个字符 |
type 为 first_frame, middle_frame, last_frame, refer_image, feature_video, base_video 的项 | |
contents[]. | An https URL or an uploaded asset id (ast_...). 最多 4000 个字符 · 格式 |
contents[]. | Name cited in the prompt as @id. Unique within contents. 最多 128 个字符 |
| |
settings. | Output resolution. Defaults to 1080p. 可选值 720p1080p默认值 |
settings. | Output seconds, 3 to 30. Omit for automatic length: holds 30 seconds and settles delivered duration. 最小 3 · 最大 30 |
settings. | Output aspect ratio. A prompt request is 16:9 when this is left out and does not accept adaptive. With contents, leave it out to keep the shape of your frame images, or send adaptive to match your input images. 可选值 21:916:99:161:1adaptive |
完整请求与响应示例
完整的创建请求、202 响应,以及任务成功后的状态。 此输入选择 720p 档位,每秒 31.4 积分。5 秒共冻结 157.000 积分。
请求
{
"model": "kling-4-0",
"input": {
"prompt": "A paper boat drifting on a pond at dawn, slow dolly in",
"settings": {
"resolution": "720p",
"duration": 5,
"aspect_ratio": "16:9"
}
},
"metadata": {
"client_reference": "my-unique-reference-1"
}
}202 已受理
{
"id": "gen_01JD8Z5QW3XR",
"model": "kling-4-0",
"source": "api",
"created_at": "2026-11-08T09:00:00Z",
"customer_resolution_deadline": "2026-11-09T09:00:00Z",
"late_result_available": false,
"metadata": {
"client_reference": "my-unique-reference-1"
},
"status": "processing",
"execution_status": "processing",
"delivery_status": "pending",
"billing_status": "pending",
"version": 1,
"price": {
"unit": "credit",
"estimated": "157.000",
"reserved": "0.000",
"charged": "0.000",
"refunded": "0.000"
},
"allowed_actions": [],
"closed_at": null,
"error": null,
"result": null
}200 已成功
{
"id": "gen_01JD8Z5QW3XR",
"model": "kling-4-0",
"source": "api",
"created_at": "2026-11-08T09:00:00Z",
"customer_resolution_deadline": "2026-11-09T09:00:00Z",
"late_result_available": false,
"metadata": {
"client_reference": "my-unique-reference-1"
},
"status": "succeeded",
"execution_status": "succeeded",
"delivery_status": "ready",
"billing_status": "settled",
"version": 4,
"price": {
"unit": "credit",
"estimated": "157.000",
"reserved": "0.000",
"charged": "157.000",
"refunded": "0.000"
},
"allowed_actions": [],
"closed_at": "2026-11-08T09:01:31Z",
"error": null,
"result": {
"asset_id": "ast_01JD8Z9M2C4V",
"outputs": [
{
"index": 0,
"asset_id": "ast_01JD8Z9M2C4V",
"content_type": "video/mp4"
}
]
}
}

