메인 콘텐츠로 건너뛰기
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.

이 엔드포인트를 사용하면 Kling을 통해 텍스트 프롬프트로 짧은 오디오 클립을 생성할 수 있습니다.

호출 전에 확인하세요

  • prompt는 간결하고 직접적으로 작성하세요
  • duration은 3초에서 10초 사이로 시작하세요
  • callback_urlexternal_task_id는 핵심 필수값이 아니라 선택적 통합 도우미로 간주하세요

작업 흐름

1

오디오 작업 제출

텍스트 프롬프트와 duration을 전송한 다음, 반환된 작업 id를 저장하세요.
2

작업 폴링

작업이 종료 상태에 도달할 때까지 Kling 오디오 조회 경로를 사용해 개별 조회를 계속 진행하세요.
3

오디오 출력 저장

제공업체 전달 보관 기간 이후에도 필요하다면 최종 오디오 자산을 저장하세요.
전체 파라미터 참고 자료는 Kling 공식 문서를 확인하세요.

인증

Authorization
string
header
필수

Bearer token authentication. Use your CometAPI key.

본문

application/json
prompt
string
기본값:Hello
필수

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

duration
integer
기본값:5
필수

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

external_task_id
string
기본값: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
기본값:https://example.com/webhook

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

응답

200 - application/json

Task accepted.

code
integer
필수

Error code; specific error code definition

message
string
필수

Error message

data
object
필수