Skip to main content
POST
cURL
このエンドポイントを使用すると、プロンプトから Kling のテキストから動画へのタスクを作成できます。完成済みの動画をすぐに返すのではなく、非同期ジョブを開始します。

最初に動かすリクエスト

  • まずは短いプロンプトを送信します
  • 最初は kling-v3 の例から始め、別のモデル系統が必要になったら OpenAPI の enum から別の model_name を選択します
  • 基本のフローが動作してから aspect_ratiodurationmodesound を追加します
  • 純粋なポーリングではなくプッシュ配信を使いたい場合は callback_url を設定します
  • 生成音声をサポートするモデルで、音声なしの決定的な初回リクエストにしたい場合は sound: off を使用します

モデル命名

このエンドポイントでは通常の Kling 動画 model ID を使用します。Omni model ID は Omni Video 用にしてください。

再生時間とアスペクト比

このエンドポイントでは、個別の解像度トークンや厳密な size フィールドは公開されていません。指定したアスペクト比によって、出力フレームの形状が制御されます。

タスクフロー

1

Submit the generation request

このエンドポイントを通じてタスクを作成し、返された Kling task id を保存します。
2

Poll the task state

タスクが終端状態に達するまで、Get a Kling task を通じて進行状況を確認します。
3

Persist the result

Kling が完成したアセットのメタデータを返したら、長期保存が必要な場合は結果を自分のストレージに移動します。
完全なパラメータ一覧とモデル系統の詳細については、Kling 公式ドキュメントを参照してください。

承認

Authorization
string
header
必須

Bearer token authentication. Use your CometAPI key.

ヘッダー

Content-Type
string

Must be application/json.

ボディ

application/json
prompt
string
必須

Text prompt describing the video to generate. Maximum 500 characters.

negative_prompt
string

Elements to exclude from the video. Maximum 200 characters.

aspect_ratio
enum<string>

Aspect ratio request. Typical rendered sizes are 1280x720 for 16:9, 720x1280 for 9:16, and 960x960 for 1:1. This endpoint does not expose an exact size field.

利用可能なオプション:
16:9,
9:16,
1:1
callback_url
string

Webhook URL to receive task status updates when the task completes.

model_name
enum<string>
デフォルト:kling-v1

Model ID for this text-to-video request. Use an ordinary Kling video model ID; use Omni model IDs only with the Omni Video endpoint.

利用可能なオプション:
kling-v1,
kling-v1-6,
kling-v2-master,
kling-v2-1-master,
kling-v2-5-turbo,
kling-v2-6,
kling-v3
cfg_scale
number

Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.

mode
enum<string>
デフォルト:std

Generation mode. std for standard (faster), pro for professional (higher quality). The default is std.

利用可能なオプション:
std,
pro
duration
string
デフォルト:5

Output video length in seconds. Use 5 or 10; omit to use 5.

camera_control
object

Camera motion preset or manual configuration. Omit for automatic camera movement.

external_task_id
string

Custom task id for your own tracking. Does not replace the system-generated task id but can be used to query tasks. Must be unique per user.

sound
enum<string>

Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.

利用可能なオプション:
on,
off

レスポンス

200 - application/json

Successful Response

code
integer

Error code; specifically define the error code

message
string

error message

request_id
string

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object