Kling API ドキュメント

1つの API キーで Kling 4.0、Kling 4.0 Flash、Kling 3.0、Kling Video O3 をアプリに組み込むための完全ガイド。

API v1.0 Base URL: https://kling3api.com

クイックスタート

bash
1curl -X POST 'https://kling3api.com/api/generate' \
2 -H 'Authorization: Bearer YOUR_API_KEY' \
3 -H 'Content-Type: application/json' \
4 -d '{
5 "model": "kling-4.0",
6 "prompt": "A cinematic shot of mountains at sunrise",
7 "duration": 5,
8 "resolution": "1080p",
9 "aspect_ratio": "16:9"
10 }'

認証

すべてのAPIリクエストには、AuthorizationヘッダーでBearerトークンを使用した認証が必要です。

APIキーの取得: ダッシュボードのAPI KeysページからAPIキーを取得できます。 → APIキーの取得

http
1Authorization: Bearer YOUR_API_KEY

利用可能なモデル

4.0

Kling 4.0 新着

参照素材・被写体・音声・キーフレームを使った 3〜30 秒、720p / 1080p のシーン

モデルガイド →

指定方法 "model": "kling-4.0"

タイプ説明時間クレジット
reference-to-videoテキスト、参照画像、被写体、音声(自動で選択)3-30s28.5/s (720p) · 42.5/s (1080p)
keyframe-to-video最初・中間・最後のフレーム(自動で選択)3-30s28.5/s (720p) · 42.5/s (1080p)
Flash

Kling 4.0 Flash 新着

画像から動画、参照素材、動画編集に対応した低コストの 720p クリップ

モデルガイド →

指定方法 "model": "kling-4.0-flash"

タイプ説明時間クレジット
text-to-videoテキストから動画、720p3-20s24/s
image-to-video最初のフレーム画像を動かす(プロンプトは任意)3-20s24/s
reference-to-video画像最大 10 枚、参照動画最大 5 本3-20s24/s · 32/s (videos)
video-editプロンプトで元動画を編集、元動画の秒数で課金auto (3-20s)32/s
3.0

Kling 3.0

高品質4K動画生成

タイプ説明時間クレジット
pro-text-to-videoPro品質テキストから動画生成3-15s54/s (no audio) · 80/s (with audio)
pro-image-to-videoPro品質画像から動画アニメーション3-15s54/s (no audio) · 80/s (with audio)
std-text-to-videoスタンダード品質テキストから動画3-15s40/s (no audio) · 60/s (with audio)
std-image-to-videoスタンダード品質画像から動画3-15s40/s (no audio) · 60/s (with audio)
O3

Kling Video O3

参照・動画編集機能付き次世代モデル

タイプ説明時間クレジット
o3-pro-text-to-videoO3 Pro テキストから動画3-15s48/s
o3-pro-image-to-videoO3 Pro 画像から動画3-15s48/s
o3-pro-reference-to-videoO3 Pro 参照画像/動画付き3-15s72/s
o3-pro-video-editO3 Pro 動画編集auto435 fixed
o3-std-text-to-videoO3 Standard テキストから動画3-15s36/s
o3-std-image-to-videoO3 Standard 画像から動画3-15s36/s
o3-std-reference-to-videoO3 Standard 参照から動画3-15s20/s
o3-std-video-editO3 Standard 動画編集auto360 fixed

APIエンドポイント

POST/api/generate

動画生成タスクを作成します。Kling 4 シリーズは model に kling-4.0 または kling-4.0-flash を指定します。Kling 3.0 と O3 は type フィールドでバックエンドが決まります。

リクエストボディ

Body ParametersJSON
model:optional string

Kling 4 シリーズのモデル:kling-4.0 または kling-4.0-flash。省略すると type フィールドで Kling 3.0 または O3 を使用します。Kling 4 の各モデルには専用のフィールドがあります。詳しくはモデルガイドをご覧ください。

type:optional string

Kling 3.0 / O3 のタスクタイプ(例:pro-text-to-video、o3-pro-reference-to-video)。model を指定する場合は不要です。

prompt:string

生成する動画のテキスト説明。最大長:Kling 3.0 は 2,000 文字、Kling 4.0 は 8,000 文字、Kling 4.0 Flash は 2,500 文字。

duration:optional number

動画時間(秒)。Kling 3.0: 3-15。O3: 3-15。 Defaults to 5.

aspect_ratio:optional string

出力アスペクト比(16:9, 9:16, 1:1) Defaults to 16:9.

image:optional string

画像から動画タスクの画像URL

end_image:optional string

最終フレーム画像URL(画像から動画のみ)

video:optional string

参照動画または動画編集タスクの動画URL

images:optional string[]

参照画像URLの配列(O3 参照から動画、最大7)

sound:optional boolean

ネイティブ音声生成を有効にする Defaults to true.

negative_prompt:optional string

特定の要素を避けるためのネガティブプロンプト

cfg_scale:optional number

プロンプト忠実度(0-1、Kling 3.0のみ) Defaults to 0.5.

Kling 4.0 - 参照画像

json
1{
2 "model": "kling-4.0",
3 "prompt": "The woman from @image_1 walks into the cafe from @image_2 and orders a coffee",
4 "image_urls": [
5 "https://example.com/woman.jpg",
6 "https://example.com/cafe.png"
7 ],
8 "duration": 8,
9 "resolution": "1080p",
10 "aspect_ratio": "9:16"
11}

Kling 4.0 - キーフレーム

json
1{
2 "model": "kling-4.0",
3 "prompt": "Start on @first_frame and settle on @last_frame in one continuous move",
4 "first_frame_url": "https://example.com/start.jpg",
5 "last_frame_url": "https://example.com/end.jpg",
6 "duration": 6,
7 "resolution": "720p"
8}

Kling 4.0 Flash - 画像から動画

json
1{
2 "model": "kling-4.0-flash",
3 "prompt": "The product slowly rotates while soft light sweeps across it",
4 "image": "https://example.com/product.jpg",
5 "duration": 5
6}

Kling 4.0 Flash - 動画編集

json
1{
2 "model": "kling-4.0-flash",
3 "mode": "video-edit",
4 "prompt": "Turn the daytime street into a snowy night",
5 "video": "https://example.com/street.mp4",
6 "keep_original_sound": true
7}

Kling 3.0 - テキストから動画

json
1{
2 "type": "pro-text-to-video",
3 "prompt": "A majestic eagle soaring through clouds at sunset",
4 "duration": 5,
5 "aspect_ratio": "16:9",
6 "sound": true
7}

Kling 3.0 - 画像から動画

json
1{
2 "type": "pro-image-to-video",
3 "prompt": "The character slowly turns and smiles",
4 "image": "https://example.com/my-image.jpg",
5 "duration": 5
6}

Kling O3 - 参照から動画

json
1{
2 "type": "o3-pro-reference-to-video",
3 "prompt": "The character walks through a futuristic city",
4 "images": [
5 "https://example.com/character-reference.jpg",
6 "https://example.com/style-reference.jpg"
7 ],
8 "duration": 5,
9 "aspect_ratio": "16:9"
10}

Kling O3 - 動画編集

json
1{
2 "type": "o3-pro-video-edit",
3 "prompt": "Change the background to a snowy mountain landscape",
4 "video": "https://example.com/original-video.mp4",
5 "keep_original_sound": true
6}

レスポンス

Task created successfully

1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "task_id": "n75abc123kling3",
6 "status": "IN_PROGRESS",
7 "consumed_credits": 400
8 }
9}
GET/api/status

動画生成タスクのステータスを確認します。どのモデルでも /api/generate が返した task_id を渡せば、API が適切なバックエンドに振り分けます。

クエリパラメータ

Body ParametersJSON
task_id:string

生成エンドポイントが返したタスク ID(全モデル共通)

リクエスト例

bash
1curl -X GET 'https://kling3api.com/api/status?task_id=n75abc123kling3' \
2 -H 'Authorization: Bearer YOUR_API_KEY'

💡 Tip: ステータスAPIのresponseフィールドは動画URLの配列です。data.response[0]に直接アクセスして動画URLを取得できます。

javascript
1// Extract video URL from response
2const videoUrl = data.response[0];

レスポンス

1{
2 "code": 200,
3 "message": "success",
4 "data": {
5 "task_id": "n75abc123kling3",
6 "status": "SUCCESS",
7 "consumed_credits": 400,
8 "created_at": "2026-02-05T10:30:00Z",
9 "request": {
10 "type": "pro-text-to-video",
11 "prompt": "A majestic eagle soaring through clouds at sunset",
12 "duration": 5,
13 "aspect_ratio": "16:9"
14 },
15 "response": [
16 "https://cdn.example.com/videos/abc123.mp4"
17 ],
18 "error_message": null,
19 "type": "pro-text-to-video"
20 }
21}

APIプレイグラウンド

ブラウザで直接APIをテストします。YOUR_API_KEYを実際のAPIキーに置き換えてください。

サンプルボディ
API プレイグラウンドPOST

エラーコード

StatusCodeDescription
400 不正なリクエストINVALID_PROMPTプロンプトが無効または空です
400 不正なリクエストINVALID_DURATION時間がサポート範囲外です
400 不正なリクエストINVALID_TYPEサポートされていないタスクタイプです
400 不正なリクエストMISSING_IMAGE画像から動画タスクには画像が必要です
400 不正なリクエストMISSING_VIDEO動画編集タスクには動画が必要です
401 認証エラーINVALID_API_KEYAPIキーが存在しないか無効です
402 INSUFFICIENT_CREDITSこの操作にはクレジットが不足しています
429 リクエストが多すぎますRATE_LIMITEDリクエストが多すぎます。スローダウンしてください
500 サーバー内部エラーINTERNAL_ERRORサーバーエラーです。後でもう一度お試しください