kling
文本转音频
在 CometAPI 中使用 Kling 文本转音频 API,将文本提示转换为音频,并支持音色风格控制、时长选项以及适合流式输出的结果。
POST
Create a Kling text-to-audio task
使用此端点可通过 Kling 根据文本提示生成一段简短的音频片段。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.