メインコンテンツへスキップ
POST
cURL
POST /text-to-video/{model} にプロンプト(Prompt)を送信して動画タスクを作成します。レスポンスには、結果の取得に使用する id が含まれます。

モデルを選択

URLにモデルIDを指定します。JSONボディにモデルフィールドを追加しないでください。

リクエストパラメータ

kling-4.0 では settings.audio の切り替え機能は提供されていません。動画には音声トラックが含まれるため、モデルが無視する値を送信するのではなく、このフィールドを省略してください。 次のリクエストは、kling-3.0-turbo を使用して5秒の動画を作成します。
このボディをCometAPI APIキーとともに https://api.cometapi.com/text-to-video/kling-3.0-turbo に送信します。OpenAPIのコードパネルには、同じボディを使用するShell、Python、JavaScriptのリクエストが用意されています。

動画を取得

作成時のレスポンスは次の形式です。
data.id を保存します。次の Klingタスクを取得 を使用し、そのIDでタスクが終了ステータスに達するまで確認します。タスクの outputs 配列から動画のURLを読み取ります。

承認

Authorization
string
header
必須

Authenticate with your CometAPI API key.

パスパラメータ

model
enum<string>
デフォルト:kling-3.0-turbo
必須

Kling model ID. kling-4.0 accepts 3-30 second durations and the 21:9 ratio. kling-3.0 supports 4k resolution. The 2.x models accept 5- or 10-second duration.

利用可能なオプション:
kling-4.0,
kling-3.0-turbo,
kling-3.0,
kling-2.6,
kling-2.5-turbo

ボディ

application/json

Text-to-video request fields exposed by the CometAPI route. The model ID is a path parameter, not a body field.

prompt
string
必須

Text description of the video to generate.

Minimum string length: 1
settings
object

Video generation settings exposed by the CometAPI route. The model ID in the URL determines which values are accepted.

options
object

Optional task fields exposed by the CometAPI route.

レスポンス

200 - application/json

The task was created. Use data.id to retrieve its status and video output.

code
必須

Request result code. 0 or success indicates acceptance.

message
string
必須

Result message.

data
object
必須

Task identifier and submission status.

msg
string

Additional result message when included in the response.

最終更新日 2026年11月13日