Usa la API de Kling Text to Audio en CometAPI para convertir prompts de texto en audio con controles de estilo de voz, opciones de duración y salida lista para streaming.
curl --request POST \
--url https://api.cometapi.com/kling/v1/audio/text-to-audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Soft ambient ocean waves at sunrise.",
"duration": 5
}
'{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "861254119619698760",
"task_status": "submitted",
"task_info": {},
"created_at": 1773367502225,
"updated_at": 1773367502225
}
}prompt conciso y directoduration entre 3 y 10 segundoscallback_url y external_task_id como ayudas de integración opcionales, no como requisitos principalesEnviar la tarea de audio
Consultar la tarea
prompt y duration, y devolvió task_status: submitted.Bearer token authentication. Use your CometAPI key.
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.
curl --request POST \
--url https://api.cometapi.com/kling/v1/audio/text-to-audio \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"prompt": "Soft ambient ocean waves at sunrise.",
"duration": 5
}
'{
"code": 0,
"message": "SUCCEED",
"data": {
"task_id": "861254119619698760",
"task_status": "submitted",
"task_info": {},
"created_at": 1773367502225,
"updated_at": 1773367502225
}
}