電商口播整合指南
透過 POST /kling/video-commerce 提交任務,使用已有 POST /kling/tasks 查詢平台任務狀態。
¶ 輸入
上傳一張人物圖並指定 voice_id,或使用一個預設 avatar_id(兩者互斥,預設人物不能另行指定 voice_id)。必須提供一個最多 2000 字的 speech_script。提供商品資訊時,至少需要一張 ref_image 和一個 goods_title;商品口播不支援 speech_rate。一般人物口播支援 0.8、1.0 或 1.2 倍語速。
以下是請求結構範例,請替換素材 URL 後呼叫。
{
"contents": [
{
"type": "avatar_image",
"url": "https://your-cdn.example/person.jpg"
},
{
"type": "ref_image",
"url": "https://your-cdn.example/product.jpg"
},
{
"type": "goods_title",
"text": "你的商品或口播内容"
},
{
"type": "speech_script",
"text": "你的商品或口播内容"
}
],
"settings": {
"resolution": "720p",
"voice_id": "male_calm_informative"
},
"async": true
}
¶ 結果與計費
同步模式回傳生成結果;非同步模式先回傳 task_id,完成結果包含 data 中的影片或圖片連結及伺服器計算的 usage。callback_url 用於完成通知;watermark=true 請求同時回傳浮水印版本。
一般人物口播:720p 為 1.4 Credits/秒、1080p 為 1.68 Credits/秒;商品口播:720p 為 1.96 Credits/秒、1080p 為 2.24 Credits/秒。影片按實際生成時長結算,生成前的每秒基本價格不代表整項任務總價。失敗任務不收取生成費用。
