kling
文字轉音訊
在 CometAPI 中使用 Kling Text to Audio API,將文字 Prompt 轉換為音訊,並支援語音風格控制、時長選項與可用於串流的輸出。
POST
Create a Kling text-to-audio task
使用此端點可透過 Kling 根據文字 Prompt 產生一段短音訊片段。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
呼叫前須知
- 保持
prompt簡潔且直接 - 建議先將
duration設定在 3 到 10 秒之間 - 將
callback_url和external_task_id視為選用的整合輔助欄位,而非核心必要條件
任務流程
輪詢任務
透過 Kling 音訊查詢路徑持續使用 單筆查詢,直到任務進入最終狀態。
授權
Bearer token authentication. Use your CometAPI key.
主體
application/json
Text prompt describing the audio to generate. Max 200 characters.
Duration of the generated audio in seconds. Range: 3.0–10.0, supports one decimal place.
Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.
Webhook URL for task status notifications. The server sends a callback when the task status changes.