{
"contentType": "application/json",
"properties": {
"contents": {
"description": "内容数组,必填。规则:① 至少一个 type=first_frame 项(必须有 url);② 可附加 type=prompt 项(text 最多 2500 字符);③ type 仅支持 prompt / first_frame,其他值报 400。",
"items": {
"oneOf": [
{
"additionalProperties": false,
"description": "首帧图片(必须至少一个)",
"properties": {
"type": {
"const": "first_frame",
"type": "string"
},
"url": {
"description": "首帧图片的公网可访问 URL。上游约束:格式 jpg/jpeg/png(不支持 webp);大小 ≤ 50MB;宽/高各 ≥ 300px;图片宽高比须在 1:2.5 ~ 2.5:1 范围内,否则上游返回错误。",
"format": "uri",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Publicly accessible first-frame image URL. Upstream: jpg/jpeg/png (no webp); ≤50MB; each side ≥300px; aspect 1:2.5–2.5:1 or upstream errors."
}
}
}
},
"required": [
"type",
"url"
],
"type": "object",
"x-i18n": {
"en-US": {
"description": "first-frame image (at least one required)"
}
}
},
{
"additionalProperties": false,
"description": "文本提示词(可选,最多一个)",
"properties": {
"text": {
"description": "提示词文本,最多 2500 字符(图生限制,低于文生的 3072)。",
"maxLength": 2500,
"minLength": 1,
"type": "string",
"x-i18n": {
"en-US": {
"description": "Prompt text, max 2500 chars (I2V limit; lower than T2V 3072)."
}
}
},
"type": {
"const": "prompt",
"type": "string"
}
},
"required": [
"type",
"text"
],
"type": "object",
"x-i18n": {
"en-US": {
"description": "text prompt (optional, at most one)"
}
}
}
]
},
"minItems": 1,
"type": "array",
"x-i18n": {
"en-US": {
"description": "Content array, required. Rules: (1) ≥1 type=first_frame with url; (2) optional type=prompt (text ≤2500); (3) type only prompt/first_frame else 400."
}
}
},
"options": {
"additionalProperties": false,
"description": "任务控制参数,全部可选。",
"properties": {
"callback_url": {
"description": "任务完成后上游回调的 URL。",
"format": "uri",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Upstream callback URL after task completion."
}
}
},
"external_task_id": {
"description": "业务侧自定义任务 ID,便于幂等查询。",
"type": "string",
"x-i18n": {
"en-US": {
"description": "Caller-defined external task ID for idempotent queries."
}
}
},
"watermark_info": {
"description": "水印配置,原样透传。",
"properties": {},
"type": "object",
"x-i18n": {
"en-US": {
"description": "Watermark config, passed through as-is."
}
}
}
},
"type": "object",
"x-i18n": {
"en-US": {
"description": "Task control parameters, all optional."
}
}
},
"settings": {
"additionalProperties": false,
"description": "生成参数,全部可选。⚠️ 图生视频 body 原样透传上游,缺失 settings 时不补默认值,建议显式填写。",
"properties": {
"aspect_ratio": {
"description": "画面宽高比。⚠️ 官方说明:图生视频的宽高比由首帧图片决定,此字段对上游实际无效;但网关仍用它计算计费,建议与首帧图片的实际比例保持一致(或不传)。",
"enum": [
"16:9",
"9:16",
"1:1"
],
"type": "string",
"x-apifox-enum": [
{
"description": "上游忽略,计费参考用",
"name": "横屏 16:9",
"value": "16:9"
},
{
"description": "上游忽略,计费参考用",
"name": "竖屏 9:16",
"value": "9:16"
},
{
"description": "上游忽略,计费参考用",
"name": "方形 1:1",
"value": "1:1"
}
],
"x-i18n": {
"en-US": {
"description": "Aspect ratio. Warning: officially I2V follows first-frame aspect so upstream ignores this; gateway still uses it for billing—match first frame or omit."
}
}
},
"duration": {
"description": "视频时长(秒),范围 3–15。计费金额与时长线性正相关。",
"maximum": 15,
"minimum": 3,
"type": "integer",
"x-i18n": {
"en-US": {
"description": "Video duration (seconds), range 3–15. Billing scales linearly with duration."
}
}
},
"resolution": {
"description": "输出分辨率。1080p 计费约 1.5×。",
"enum": [
"720p",
"1080p"
],
"type": "string",
"x-apifox-enum": [
{
"description": "基准计费倍率",
"name": "标清 720p",
"value": "720p"
},
{
"description": "计费倍率约 1.5×",
"name": "高清 1080p",
"value": "1080p"
}
],
"x-i18n": {
"en-US": {
"description": "Output resolution. 1080p bills ~1.5×."
}
}
}
},
"type": "object",
"x-i18n": {
"en-US": {
"description": "Generation params, all optional. Warning: I2V body pass-through; missing settings are not defaulted—set explicitly."
}
}
}
},
"required": [
"contents"
]
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
}
],
"settings": {
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
},
{
"text": "The character slowly turns around and waves, soft natural lighting, smooth camera movement",
"type": "prompt"
}
],
"settings": {
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "720p"
}
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
}
],
"settings": {
"aspect_ratio": "9:16",
"duration": 5,
"resolution": "720p"
}
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
},
{
"text": "Camera slowly zooms in, subject smiles gently, wind blows hair slightly",
"type": "prompt"
}
],
"settings": {
"aspect_ratio": "16:9",
"duration": 5,
"resolution": "1080p"
}
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
},
{
"text": "Subject walks forward confidently, dynamic background blur, cinematic style",
"type": "prompt"
}
],
"options": {
"callback_url": "https://your-server.com/webhook/kling",
"external_task_id": "biz-img2v-20240623-001"
},
"settings": {
"aspect_ratio": "9:16",
"duration": 10,
"resolution": "1080p"
}
}{
"contents": [
{
"type": "first_frame",
"url": "{{first_frame_url}}"
},
{
"text": "Flower petals gently swaying, bokeh background shimmers, dreamy atmosphere",
"type": "prompt"
}
],
"settings": {
"aspect_ratio": "1:1",
"duration": 5,
"resolution": "720p"
}
}