Verwenden Sie die Kling Text to Audio API in CometAPI, um Text-Prompts mit Steuerung des Sprachstils, Daueroptionen und Streaming-fähiger Ausgabe in Audio umzuwandeln.
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 kurz und direktduration zwischen 3 und 10 Sekundencallback_url und external_task_id als optionale Integrationshilfen, nicht als zentrale AnforderungenAudio-Task übermitteln
Task abfragen
prompt und duration akzeptiert wurde und task_status: submitted zurückgab.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
}
}