1. kling
梧柏API使用文档
WHBAI · Kling
  • WHBAI · Google Gemini 原生 (v1alpha)
  • WHBAI · Google Gemini 原生
  • WHBAI · Ideogram
  • WHBAI · Ideogram V3
  • WHBAI · Midjourney
  • WHBAI · Jimeng
  • WHBAI · Kling
  • WHBAI · Luma
  • WHBAI · Luma V1
  • WHBAI · Omni 视频
  • WHBAI · Pixverse
  • WHBAI · Runway
  • WHBAI · Sora2
  • WHBAI · 统一视频 VEO
  • WHBAI · Vidu
  • WHBAI · 豆包 Volc
  • WHBAI · Suno
  • WHBAI · Playground
  • WHBAI · 账号与令牌
  • WHBAI · 阿里 Pix
  • WHBAI · 阿里百炼
  • WHBAI · 私域人像
  • WHBAI · Fal.ai
  • WHBAI · Replicate
  • WHBAI · 腾讯云 VOD
  • WHBAI · MiniMax
  • WHBAI · 支持模型列表
  • WHBAI · Grok Imagine
  • WHBAI · Seedance 2.0
  • WHBAI · TypeSafe
  • WHBAI · OpenAI 兼容
  • 可灵 Kling
    • 文生音效
    • 文生视频
    • 图生视频
    • 文生图
    • 查询文生视频任务
    • Omni-Video
  • kling
    • 对口型
      POST
    • 虚拟试穿
      POST
    • 视频延长
      POST
    • 视频特效
      POST
    • 多图参考生视频
      POST
    • 查询任务(免费)
      GET
    • 查询任务(单个)
      GET
    • Omni-Image
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 初始化待编辑视频
      POST
    • 增加视频选区
      POST
    • 删减视频选区
      POST
    • 预览已选区视频
      POST
    • 多模态视频
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 多图参考生图
      POST
    • 查询任务(单个)
      GET
    • 文生视频
      POST
    • 图生视频
      POST
    • 查询视频
      GET
    • 查询任务(单个)
      GET
    • 扩图
      POST
    • 查询任务(单个)
      GET
    • 图像识别
      POST
    • 数字人
      POST
    • 查询任务(单个)
      GET
    • 查询任务(单个)
      GET
    • 视频生音效
      POST
    • 查询任务(单个)
      GET
    • 语音合成
      POST
    • 查询任务(单个)
      GET
    • 人脸识别
      POST
    • 对口型
      POST
    • 查询任务(单个)
      GET
    • 自定义音色
      POST
    • 查询自定义音色(单个)
      GET
    • 查询官方音色
      GET
    • 删除自定义音色
      POST
    • 动作控制
      POST
    • 查询任务(单个)
      GET
    • 主体(旧)
      POST
    • 主体(新版本)
      POST
    • 查询自定义主体(单个新版本)
      GET
    • 查询官方主体(列表新版本)
      GET
    • 删除自定义主体(新版本)
      POST
  • 数据模型
    • KlingTaskSubmitResponse
    • KlingTaskQueryResponse
    • KlingText2VideoRequest
    • KlingImage2VideoRequest
    • PostKlingV1ImagesGenerationsRequest
    • KlingOmniVideoRequest
    • NewApiError
  1. kling

图生视频

POST
/kling/image-to-video/kling-3.0-turbo

网站中的模型与调用示例#

图生视频#

请求参数#

{
  "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"
  }
}

请求示例 · 进阶推荐:图生视频 · 1080p 高清 + 提示词引导#

{
  "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"
  }
}

请求示例 · 进阶推荐:图生视频 · 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"
  }
}

请求示例 · 进阶推荐:图生视频 · 方形 1:1 社交媒体#

{
  "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"
  }
}

请求参数

Authorization
Bearer Token
在 Header 添加参数
Authorization
,其值为在 Bearer 之后拼接 Token
示例:
Authorization: Bearer ********************
or
Body 参数application/json必填

示例
{
    "contents": [
        {
            "type": "first_frame",
            "url": "https://example.com/first-frame.jpg"
        }
    ],
    "settings": {
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "duration": 5
    }
}

请求示例代码

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
请求示例请求示例
Shell
JavaScript
Java
Swift
cURL
curl --location '/kling/image-to-video/kling-3.0-turbo' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{
    "contents": [
        {
            "type": "first_frame",
            "url": "https://example.com/first-frame.jpg"
        }
    ],
    "settings": {
        "resolution": "720p",
        "aspect_ratio": "16:9",
        "duration": 5
    }
}'

返回响应

🟢200成功
application/json
Bodyapplication/json

示例
{
    "code": 0,
    "message": "string",
    "data": {
        "id": "string",
        "task_id": "string",
        "status": "string",
        "task_status": "string"
    }
}
🟠400请求有误
🟠401没有权限
修改于 2026-10-24 18:33:09
上一页
文生视频
下一页
查询视频
Built with