Użyj API Kling Text to Audio w CometAPI, aby przekształcać prompty tekstowe w audio z kontrolą stylu głosu, opcjami długości i wyjściem gotowym do streamingu.
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 krótki i konkretnyduration między 3 a 10 sekundamicallback_url i external_task_id jako opcjonalne elementy pomocnicze integracji, a nie podstawowe wymaganiaPrześlij zadanie audio
Odpytuj zadanie
prompt i duration zostało zaakceptowane i zwróciło 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
}
}