{
"contentType": "application/json",
"properties": {
"callback_url": {
"description": "回调通知地址,可选,用于接收任务状态更新",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Optional callback URL for task status updates."
}
}
},
"cfg_scale": {
"description": "生成视频的自由度,可选,取值范围0-1,值越大相关性越强",
"type": "number",
"x-i18n": {
"en-US": {
"description": "Creativity/guidance for video generation (optional), range 0-1; higher values follow the prompt more closely."
}
}
},
"duration": {
"description": "生成视频时长,单位秒,可选值:5或10(注意:包含尾帧的请求仅支持5秒)",
"type": "number",
"x-i18n": {
"en-US": {
"description": "Video duration in seconds: 5 or 10. Requests with an end frame only support 5 seconds."
}
}
},
"image": {
"description": "参考图像,必需,支持Base64编码 或图片URL,支持.jpg/.jpeg/.png格式,大小不超过10MB,分辨率不小于300*300px\nbese64 不能传入 ",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Reference image (required). Base64 or URL. jpg/jpeg/png, max 10MB, min resolution 300x300px."
}
}
},
"image_tail": {
"description": "参考图像-尾帧控制,可选,支持Base64编码或图片URL,支持.jpg/.jpeg/.png格式,大小不超过10MB,分辨率不小于300*300px",
"type": "string",
"x-i18n": {
"en-US": {
"description": "End-frame reference image (optional). Base64 or URL. jpg/jpeg/png, max 10MB, min 300x300px."
}
}
},
"mode": {
"description": "生成视频的模式,可选,std(高性能)或 pro(高表现)",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Video generation mode (optional): std (high performance) or pro (high quality)."
}
}
},
"model_name": {
"description": "kling-v1、kling-v1-5、kling-v1-6\n",
"type": "string"
},
"negative_prompt": {
"description": "负向文本提示,可选,描述不想在视频中出现的元素,不超过2000字符",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Negative text prompt (optional). Elements to avoid. Max 2000 characters."
}
}
},
"prompt": {
"description": "正向文本提示,可选,描述想要生成的视频内容,不超过5000字符",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Positive text prompt (optional). Describes desired video content. Max 5000 characters."
}
}
}
},
"required": [
"model_name",
"image",
"image_tail",
"prompt",
"negative_prompt",
"cfg_scale",
"mode",
"duration",
"callback_url"
]
}{
"aspect_ratio": "1:1",
"duration": "5",
"image_list": [
{
"image": "https://cdn.klingai.com/bs2/upload-kling-api/9471259838/image/Cl6kH2gHPegAAAAAAjveaQ-0_raw_image_0.png"
},
{
"image": "https://cdn.klingai.com/bs2/upload-kling-api/9471259838/image/Cl6kH2gHPegAAAAAAjveaQ-0_raw_image_0.png"
}
],
"image_tail": "",
"mode": "std",
"model_name": "kling-v1-6",
"negative_prompt": "",
"prompt": "flow"
}{
"contentType": "application/json",
"properties": {
"aspect_ratio": {
"description": "画幅比例。可选;传入时网关预检枚举,不传则由上游决定。",
"enum": [
"16:9",
"9:16",
"1:1"
],
"type": "string",
"x-apifox-enum": [
{
"description": "宽屏横构图",
"name": "横屏",
"value": "16:9"
},
{
"description": "短视频竖构图",
"name": "竖屏",
"value": "9:16"
},
{
"description": "正方形构图",
"name": "方屏",
"value": "1:1"
}
],
"x-i18n": {
"en-US": {
"description": "Aspect ratio, optional. Gateway validates enum when set; otherwise upstream decides."
}
}
},
"callback_url": {
"description": "任务完成回调地址,须公网可达,网关原样透传。",
"format": "uri",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Task completion callback URL; must be publicly reachable; gateway pass-through."
}
}
},
"cfg_scale": {
"description": "生成自由度(CFG),可选。网关透传,不预检范围。",
"type": "number",
"x-i18n": {
"en-US": {
"description": "CFG, optional. Gateway pass-through; range not pre-validated."
}
}
},
"duration": {
"description": "视频时长(秒),必填。仅 5 或 10;支持 string / integer,网关归一化为字符串。缺失时在 Relay 计费层报 duration must be 5 or 10。",
"oneOf": [
{
"enum": [
"5",
"10"
],
"type": "string"
},
{
"enum": [
5,
10
],
"type": "integer"
}
],
"x-i18n": {
"en-US": {
"description": "Video duration (seconds), required. Only 5 or 10; string/integer OK; gateway normalizes to string. If missing, Relay billing: duration must be 5 or 10."
}
}
},
"external_task_id": {
"description": "调用方外部任务 ID,用于幂等关联与业务对账;非响应 data.task_id。",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Caller external task ID for idempotency/reconciliation; not response data.task_id."
}
}
},
"image_list": {
"description": "参考图列表,必填。1~4 张;每项须含 image 字段(URL 或 Base64)。网关只校验 image 非空,格式/大小由上游校验。",
"items": {
"additionalProperties": true,
"properties": {
"image": {
"description": "参考图 URL 或 Base64,必填。勿用 image_url 替代(网关只认 image 字段)。",
"minLength": 1,
"type": "string",
"x-i18n": {
"en-US": {
"description": "Reference image URL or Base64, required. Do not use image_url (gateway only reads image)."
}
}
},
"image_fidelity": {
"description": "图片保真度,网关透传,不预检范围。",
"type": "number",
"x-i18n": {
"en-US": {
"description": "Image fidelity; gateway pass-through; range not pre-validated."
}
}
},
"image_url": {
"description": "备用图片 URL 字段,网关校验不读取此字段;请使用 image。",
"type": "string",
"x-i18n": {
"en-US": {
"description": "backup image URL field; gateway validation ignores it—use image."
}
}
},
"type": {
"description": "图片类型标记,网关透传,本接口不预检枚举。",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Image type flag; gateway pass-through; enum not pre-validated here."
}
}
}
},
"required": [
"image"
],
"type": "object"
},
"maxItems": 4,
"minItems": 1,
"type": "array",
"x-i18n": {
"en-US": {
"description": "Reference images, required, 1–4; each needs image (URL/Base64). Gateway only checks non-empty; format/size by upstream."
}
}
},
"mode": {
"description": "生成模式。不传时计费侧默认 std。不支持 4k。",
"enum": [
"std",
"pro"
],
"type": "string",
"x-apifox-enum": [
{
"description": "性价比模式",
"name": "标准",
"value": "std"
},
{
"description": "高表现模式,计费更高",
"name": "高品质",
"value": "pro"
}
],
"x-i18n": {
"en-US": {
"description": "generation mode. billing defaults to std if omitted. 4k not supported."
}
}
},
"model_name": {
"description": "模型名称,必填。网关仅允许 kling-v1-6;缺失或其他值返回 400。",
"enum": [
"kling-v1-6"
],
"type": "string",
"x-apifox-enum": [
{
"description": "多图参考生视频唯一支持模型;duration 仅 5/10 秒",
"name": "V1.6",
"value": "kling-v1-6"
}
],
"x-i18n": {
"en-US": {
"description": "Model name, required. Gateway only allows kling-v1-6; otherwise 400."
}
}
},
"negative_prompt": {
"description": "负向提示词,可选。网关透传,不预检长度(仅 prompt 有 2500 校验)。",
"maxLength": 2500,
"type": "string",
"x-i18n": {
"en-US": {
"description": "Negative prompt, optional. Gateway pass-through; length not pre-validated (only prompt has 2500 check)."
}
}
},
"prompt": {
"description": "正向提示词,可选。网关不强制必填;若传入须 ≤2500 字符。建议填写以引导运动与风格。",
"maxLength": 2500,
"type": "string",
"x-i18n": {
"en-US": {
"description": "Positive prompt, optional. Gateway does not require it; if set, ≤2500 chars. Recommended to guide motion/style."
}
}
}
},
"required": [
"model_name",
"image_list",
"duration"
]
}{
"aspect_ratio": "16:9",
"duration": "5",
"image_list": [
{
"image": "{{image_url_1}}"
},
{
"image": "{{image_url_2}}"
}
],
"mode": "std",
"model_name": "kling-v1-6",
"prompt": "A cinematic scene blending the subjects from reference images, smooth camera movement"
}{
"aspect_ratio": "9:16",
"duration": 5,
"image_list": [
{
"image": "{{image_url_1}}"
}
],
"mode": "std",
"model_name": "kling-v1-6",
"prompt": "The character turns and walks forward, soft natural lighting"
}{
"aspect_ratio": "16:9",
"duration": "10",
"image_list": [
{
"image": "{{image_url_1}}"
},
{
"image": "{{image_url_2}}"
},
{
"image": "{{image_url_3}}"
},
{
"image": "{{image_url_4}}"
}
],
"model_name": "kling-v1-6",
"prompt": "Combine scene, character, style and lighting from all reference images"
}{
"aspect_ratio": "16:9",
"cfg_scale": 0.5,
"duration": "10",
"image_list": [
{
"image": "{{image_url_1}}"
},
{
"image": "{{image_url_2}}"
}
],
"mode": "pro",
"model_name": "kling-v1-6",
"negative_prompt": "blurry, distorted face, low quality, watermark",
"prompt": "Epic wide shot merging both characters into one cohesive action scene"
}{
"aspect_ratio": "1:1",
"callback_url": "https://your-server.com/webhook/kling",
"duration": "5",
"external_task_id": "biz-mi2v-20260701-001",
"image_list": [
{
"image": "{{image_url_1}}"
},
{
"image": "{{image_url_2}}"
},
{
"image": "{{image_url_3}}"
}
],
"mode": "pro",
"model_name": "kling-v1-6",
"prompt": "Fashion editorial style video with dynamic camera pan"
}{
"aspect_ratio": "16:9",
"duration": 10,
"image_list": [
{
"image": "{{image_url_1}}"
},
{
"image": "{{image_url_2}}"
}
],
"mode": "std",
"model_name": "kling-v1-6",
"prompt": "Slow motion transition between two reference scenes"
}