Skip to main content
POST
cURL
このエンドポイントを使用すると、Kling を通じてテキストプロンプトから短い音声クリップを生成できます。

呼び出す前に

  • prompt は簡潔で直接的に保ってください
  • duration は 3〜10 秒の間から始めてください
  • callback_urlexternal_task_id は必須要件ではなく、任意の連携補助として扱ってください

タスクの流れ

1

音声タスクを送信

テキストプロンプトと duration を送信し、返された task id を保存します。
2

タスクをポーリング

タスクが終了状態に達するまで、Kling 音声クエリパスを使って Kling タスクを取得 を続けてください。
3

音声出力を保存

プロバイダーの配信期間を超えて音声アセットが必要な場合は、最終的な音声アセットを永続化してください。
完全なパラメータリファレンスについては、Kling の公式ドキュメント を参照してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ボディ

application/json
prompt
string
必須

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

duration
integer
必須

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

external_task_id
string

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

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
必須