v1

latestOpenAPI 3.1.02026-07-26793302.3 KB

Create a Kling text-to-audio task

Submit a text prompt and duration, then poll the returned task id through the generic Kling query route.

post/kling/v1/audio/text-to-audio

Request body

promptstring required

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

durationinteger required

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

external_task_idstring

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

callback_urlstring

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

Response

Task accepted.

codeinteger required

Error code; specific error code definition

messagestring required

Error message

Example response

{
  "code": 0,
  "message": "SUCCEED",
  "data": {
    "task_id": "861254119619698760",
    "task_status": "submitted",
    "task_info": {},
    "created_at": 1773367502225,
    "updated_at": 1773367502225
  }
}
All 79 operations