callback_url。任务进入 SUCCESS 或 FAILURE 终态后,系统会向该地址发送 POST 请求,无需持续轮询查询接口。callback_url 必须是绝对 http 或 https URL,不能包含用户名、密码或 URL 片段,最大长度为 2048 字节;不传或传空字符串时不启用回调。Content-Type: application/json,请求超时为 10 秒;仅 HTTP 2xx 视为投递成功,重定向不会自动跟随。GET /v1/video/generations/{task_id} 成功响应中的 data 字段完全一致,只移除外层 code、message、data 包装,不增加、删除或重命名任何任务字段。VideoCallbackMaxAttempts 控制,默认 3 次(包含首次)。task_id 查询消耗明细。同一个 task_id 最多会有两条使用明细:一条任务提交时的预扣费记录,一条视频生成成功后的补扣费记录,或失败/差额结算后的退费记录。curl --location 'https://tk.wxdatas.cn/v1/video/generations' \
--header 'Authorization: Bearer sk-xxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"model": "kling-v1",
"prompt": "宇航员站起身走了",
"image": "https://example.com/image.jpg",
"callback_url": "https://client.example.com/hooks/video",
"duration": 5,
"width": 1280,
"height": 720,
"fps": 30,
"seed": 20231234,
"n": 1,
"response_format": "url",
"user": "user-1234",
"metadata": {
"property1": "string",
"property2": "string"
}
}'{
"task_id": "abcd1234efgh",
"status": "queued"
}