跳至正文
EN
Kling · 模型接口

Kling V2.1 API

Kling V2.1 API 的模型能力、计价规格、请求参数和接入示例。使用 VezAPI 账号密钥统一接入。

文生视频图生视频

Kling V2.1 API 接入文档

使用 VezAPI 密钥接入 Kling V2.1。下列操作共用同一个账号余额和鉴权方式。

服务地址: https://api.vezapi.com
请求头使用 Authorization: Bearer YOUR_VEZAPI_KEY。每次提交使用唯一的 Idempotency-Key,查询同一笔提交时才复用。

Kling V2.1 Master 图生视频

POST/api/v1/jobs/createTask

模型标识: kling/v2-1-master-image-to-video

参数类型说明与限制
model
必填
string

用于生成任务的模型名称。必填字段。 - 该接口必须使用 `kling/v2-1-master-image-to-video` 模型

可选值:"kling/v2-1-master-image-to-video"

默认:"kling/v2-1-master-image-to-video"

callBackUrl
可选
string

接收生成任务完成通知的回调 URL。可选配置,生产环境建议使用。 - 任务生成完成后,系统会向该 URL 以 POST 方式推送任务状态和结果 - 回调内容包含生成内容的 URL 及任务相关信息 - 你的回调接口需支持接收 POST 请求及 JSON 格式的请求体 - 也可选择调用任务详情接口,主动轮询任务状态

input
可选
object

生成任务的输入参数

input.prompt
必填
string

描述待生成视频内容的文本提示词(最大长度:5000 字符)

maxLength: 5000

input.image_url
必填
string

用于生成视频的图片 URL(需为上传后的文件 URL,而非文件内容;支持的格式:image/jpeg、image/png;最大文件大小:10.0MB)

input.duration
必填
string

必填。"5" 或 "10"(秒)。

可选值:"5", "10"

input.negative_prompt
可选
string

用于排除视频中特定元素的反向提示词(最大长度:500 字符)

maxLength: 500

input.cfg_scale
可选
number

CFG(无分类器引导)系数,用于控制模型贴合提示词的程度(最小值:0,最大值:1,步长:0.1)

默认:0.5

minimum: 0

maximum: 1

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling/v2-1-master-image-to-video",
  "input": {
    "prompt": "A team of paratroopers descends into enemy territory, as they pass through clouds, the camera switches to a slow pan above the battlefield lighting up with",
    "image_url": "https://example.com/input.png",
    "duration": "5"
  }
}'
返回值与错误

HTTP 200

请求成功

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Kling V2.1 Master 文生视频

POST/api/v1/jobs/createTask

模型标识: kling/v2-1-master-text-to-video

参数类型说明与限制
model
必填
string

用于生成任务的模型名称。必填字段。 - 该接口必须使用 `kling/v2-1-master-text-to-video` 模型

可选值:"kling/v2-1-master-text-to-video"

默认:"kling/v2-1-master-text-to-video"

callBackUrl
可选
string

接收生成任务完成通知的回调 URL。可选配置,生产环境建议使用。 - 任务生成完成后,系统会向该 URL 以 POST 方式推送任务状态和结果 - 回调内容包含生成内容的 URL 及任务相关信息 - 你的回调接口需支持接收 POST 请求及 JSON 格式的请求体 - 也可选择调用任务详情接口,主动轮询任务状态

input
可选
object

生成任务的输入参数

input.prompt
必填
string

描述待生成视频内容的文本提示词(最大长度:5000 字符)

maxLength: 5000

input.duration
必填
string

必填。"5" 或 "10"(秒)。

可选值:"5", "10"

input.aspect_ratio
可选
string

生成视频画面的宽高比

可选值:"16:9", "9:16", "1:1"

默认:"16:9"

input.negative_prompt
可选
string

生成视频中需要规避的元素(最大长度:500 字符)

maxLength: 500

input.cfg_scale
可选
number

CFG(无分类器引导)系数,用于控制模型贴合提示词的程度(最小值:0,最大值:1,步长:0.1)

默认:0.5

minimum: 0

maximum: 1

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling/v2-1-master-text-to-video",
  "input": {
    "prompt": "First-person view from a soldier jumping from a transport plane — the camera shakes with turbulence, oxygen mask reflections flicker — as the clouds part, the battlefield below pulses with anti-air fire and missile trails.",
    "duration": "5",
    "aspect_ratio": "16:9"
  }
}'
返回值与错误

HTTP 200

请求成功

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Kling V2.1 Pro

POST/api/v1/jobs/createTask

模型标识: kling/v2-1-pro

参数类型说明与限制
model
必填
string

用于生成任务的模型名称。必填字段。 - 该接口必须使用 `kling/v2-1-pro` 模型

可选值:"kling/v2-1-pro"

默认:"kling/v2-1-pro"

callBackUrl
可选
string

接收生成任务完成通知的回调 URL。可选配置,生产环境建议使用。 - 任务生成完成后,系统会向该 URL 以 POST 方式推送任务状态和结果 - 回调内容包含生成内容的 URL 及任务相关信息 - 你的回调接口需支持接收 POST 请求及 JSON 格式的请求体 - 也可选择调用任务详情接口,主动轮询任务状态

input
可选
object

生成任务的输入参数

input.prompt
必填
string

描述待生成视频内容的文本提示词(最大长度:5000 字符)

maxLength: 5000

input.image_url
必填
string

用于生成视频的基准图片 URL(需为上传后的文件 URL,而非文件内容;支持的格式:image/jpeg、image/png;最大文件大小:10.0MB)

input.duration
必填
string

必填。"5" 或 "10"(秒)。

可选值:"5", "10"

input.negative_prompt
可选
string

生成视频中需要规避的元素(最大长度:500 字符)

maxLength: 500

input.cfg_scale
可选
number

CFG(无分类器引导)系数,用于控制模型贴合提示词的程度(最小值:0,最大值:1,步长:0.1)

默认:0.5

minimum: 0

maximum: 1

input.tail_image_url
可选
string

用于视频结尾画面的图片 URL(需为上传后的文件 URL,而非文件内容;支持的格式:image/jpeg、image/png;最大文件大小:10.0MB)

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling/v2-1-pro",
  "input": {
    "prompt": "POV shot of a gravity surfer diving between ancient ruins suspended midair, glowing moss lights the path, the board hisses as it carves through thin mist, echoes rise with speed ",
    "image_url": "https://example.com/input.png",
    "duration": "5"
  }
}'
返回值与错误

HTTP 200

请求成功

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

Kling V2.1 Standard

POST/api/v1/jobs/createTask

模型标识: kling/v2-1-standard

参数类型说明与限制
model
必填
string

用于生成任务的模型名称。必填字段。 - 该接口必须使用 `kling/v2-1-standard` 模型

可选值:"kling/v2-1-standard"

默认:"kling/v2-1-standard"

callBackUrl
可选
string

接收生成任务完成通知的回调 URL。可选配置,生产环境建议使用。 - 任务生成完成后,系统会向该 URL 以 POST 方式推送任务状态和结果 - 回调内容包含生成内容的 URL 及任务相关信息 - 你的回调接口需支持接收 POST 请求及 JSON 格式的请求体 - 也可选择调用任务详情接口,主动轮询任务状态

input
可选
object

生成任务的输入参数

input.prompt
必填
string

描述期望生成视频内容的文本提示词(最大长度:5000 字符)

maxLength: 5000

input.image_url
必填
string

用于生成视频的图片 URL(需为上传后的文件 URL,而非文件内容;支持的格式:image/jpeg、image/png;最大文件大小:10.0MB)

input.duration
必填
string

必填。"5" 或 "10"(秒)。

可选值:"5", "10"

input.negative_prompt
可选
string

生成视频中需要规避的元素描述(最大长度:500 字符)

maxLength: 500

input.cfg_scale
可选
number

CFG(无分类器引导)系数,用于控制模型贴合提示词的程度(最小值:0,最大值:1,步长:0.1)

默认:0.5

minimum: 0

maximum: 1

请求示例
curl -X POST 'https://api.vezapi.com/api/v1/jobs/createTask' \
  -H 'Authorization: Bearer YOUR_VEZAPI_KEY' \
  -H 'Idempotency-Key: your-unique-request-id' \
  -H 'Content-Type: application/json' \
  -d '{
  "model": "kling/v2-1-standard",
  "input": {
    "prompt": "Begin with the uploaded image as the first frame. Gradually animate the scene: steam rises and drifts upward from the train; lantern lights flicker subtly; cloaked figures begin to move slowly — walking, turning, adjusting their belongings. Floating dust or magical particles catch the light. The text “KLING 2.1 STANDARD API — Now on Kie.ai” softly pulses with a golden glow. The camera pushes forward slightly, then slowly fades to black.",
    "image_url": "https://example.com/input.png",
    "duration": "5"
  }
}'
返回值与错误

HTTP 200

请求成功

参数类型说明与限制
code
可选
integer

Status code of the request. The HTTP status is 200 even when the request fails, so always check this field: 200 means success; any other value means the request failed and msg describes the reason. Common values: 401 invalid or missing API key; 402 insufficient credits; 429 rate limit exceeded; 422 or 500 the request could not be processed (read msg and check your parameters before retrying).

可选值:200, 401, 402, 404, 422, 429, 433, 455, 500, 501, 505

msg
可选
string

Response message, error description upon failure

data
必填
object
data.taskId
必填
string

The task ID can be used with the "Get Task Details" endpoint to query the task status.

任务状态与回调

异步任务请保存返回的 taskId。调用 GET /api/v1/jobs/recordInfo?taskId=... 查询,或在创建时设置 callBackUrl。只有任务所属账号可以查询任务或基于任务创建派生资源。

超时可能表示请求已经受理。请在控制台查看原请求,不要自动新建任务。回调可能重试并重复到达,请使用 X-VezAPI-Event-Id 去重。

文件、日志与计费

生成媒体通常随上游保留 14 天,上传文件在 24 小时后失效。请在过期前保存所需文件。VezAPI 仅流式转发已登记资源,不提供永久作品库。请求日志保留两个自然月。

调用前预留积分,最终按实际优惠扣分 1:1 结算。用量不明时暂停新付费请求。若保护其他任务预留后余额不足以结算,会保留待结算记录,补足余额后再扣费;模型用量不会将钱包扣成负数。按时长计价的输入文件由服务端读取时长,读取失败时不提交模型任务。

打开完整文档 →

Kling V2.1 API 价格

下方费率为参考估算,最终按实际优惠扣分 1:1 结算。按标准充值包换算,1,000 积分约为 10 美元,大额充值包可降低每积分实际单价。

规格积分计价单位美元参考
Kling 2.1, video-generation, Pro-10.0s176每个视频$1.76
Kling 2.1, text-to-video, Master-5.0s252每个视频$2.52
Kling 2.1, text-to-video, Master-10.0s504每个视频$5.04
Kling 2.1, video-generation, Standard-5.0s50.5每个视频$0.505
Kling 2.1, video-generation, Standard-10.0s101每个视频$1.01
Kling 2.1, video-generation, Pro-5.0s88每个视频$0.88
Kling 2.1, image-to-video, Master-5.0s252每个视频$2.52
Kling 2.1, image-to-video, Master-10.0s504每个视频$5.04