Ana içeriğe atla
POST
/
kling
/
v1
/
audio
/
text-to-audio
Create a Kling text-to-audio task
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
  }
}

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.

Bu endpoint’i, Kling aracılığıyla bir metin prompt’undan kısa bir ses klibi oluşturmak için kullanın.

Çağırmadan önce

  • prompt değerini kısa ve doğrudan tutun
  • duration için 3 ila 10 saniye arasında başlayın
  • callback_url ve external_task_id alanlarını temel gereksinimler değil, isteğe bağlı entegrasyon yardımcıları olarak değerlendirin

Görev akışı

1

Ses görevini gönderin

Metin prompt’unu ve süreyi gönderin, ardından dönen görev kimliğini kaydedin.
2

Görevi sorgulayın

Görev son duruma ulaşana kadar Kling ses sorgu yolunu kullanarak Individual Queries ile devam edin.
3

Ses çıktısını saklayın

Sağlayıcının teslimat penceresinin ötesinde ihtiyacınız olacaksa nihai ses varlığını kalıcı olarak saklayın.
Tam parametre referansı için resmi Kling dokümantasyonuna bakın.

Yetkilendirmeler

Authorization
string
header
gerekli

Bearer token authentication. Use your CometAPI key.

Gövde

application/json
prompt
string
varsayılan:Hello
gerekli

Text prompt describing the audio to generate. Max 200 characters.

duration
integer
varsayılan:5
gerekli

Duration of the generated audio in seconds. Range: 3.0–10.0, supports one decimal place.

external_task_id
string
varsayılan:audio-text-task-001

Optional user-defined task ID for your own tracking. Does not replace the system-generated task ID. Must be unique per account.

callback_url
string
varsayılan:https://example.com/webhook

Webhook URL for task status notifications. The server sends a callback when the task status changes.

Yanıt

200 - application/json

Task accepted.

code
integer
gerekli

Error code; specific error code definition

message
string
gerekli

Error message

data
object
gerekli