Usa l’API Kling Text to Audio in CometAPI per convertire prompt testuali in audio con controlli sullo stile della voce, opzioni di durata e output pronto per lo 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 e direttoduration tra 3 e 10 secondicallback_url ed external_task_id come supporti di integrazione opzionali, non requisiti fondamentaliInterroga il task
prompt e duration è stata accettata e ha restituito 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
}
}