Kling 3.0 API
快手による Kling 3.0 動画生成モデルの完全な API リファレンス。
モデルバリアント {#}
この API は 4 つのモデルバリアントをサポートしています:
クイック比較
対応アスペクト比
Kling 3.0 テキストから動画(スタンダード & プロ)
エンドポイント
POST /api/v1/video/task
リクエストパラメータ
必須
任意
リクエスト例
スタンダード版:
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'kling-v3.0-std-text-to-video',
prompt: 'A fox running through a snowy forest at dusk',
duration: 5,
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
プロ版:
{
model_name: 'kling-v3.0-pro-text-to-video',
prompt: 'A fox running through a snowy forest at dusk',
duration: 5,
aspect_ratio: '16:9'
}
Kling 3.0 画像から動画(スタンダード & プロ)
リクエストパラメータ
必須
任意
リクエスト例
スタンダード版:
const response = await fetch('https://api.flaq.ai/api/v1/video/task', {
method: 'POST',
headers: {
'Authorization': 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json'
},
body: JSON.stringify({
model_name: 'kling-v3.0-std-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Gentle breeze, leaves rustling, slow camera pull back',
duration: 5,
aspect_ratio: '16:9'
})
});
const { data } = await response.json();
const taskId = data.task_id;
プロ版:
{
model_name: 'kling-v3.0-pro-image-to-video',
image_url: 'https://example.com/image.jpg',
prompt: 'Gentle breeze, leaves rustling, slow camera pull back',
duration: 5,
aspect_ratio: '16:9'
}
レスポンス形式
初期レスポンス
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "submitted"
}
}
ポーリングレスポンス
GET /api/v1/video/{taskId} をポーリングしてステータスを確認:
{
"code": 0,
"message": "success",
"data": {
"task_id": "{task_id}",
"response_url": "https://api.flaq.ai/api/v1/video/{task_id}",
"task_status": "succeed",
"task_status_msg": null,
"task_result": {
"videos": [
{
"url": "https://example.com/generated-video.mp4"
}
]
}
}
}
ステータス値
submitted:タスクが受け付けられ、処理待ちです
processing:動画生成中
succeed:動画生成完了
failed:動画生成失敗
処理時間
- スタンダード版:時間によって約 2〜4 分
- プロ版:時間によって約 3〜6 分
5〜10 秒ごとにポーリングしてください。長い動画(10〜15 秒)はさらに時間がかかる場合があります。
ベストプラクティス
- 動きを明確に記述する:より動的な結果を得るために、プロンプトにカメラの動きと被写体のアクションを含める
- ネガティブプロンプトを活用する:不要な要素(例:
"blurry, low quality, watermark")を除外して出力品質を向上させる
- ガイダンススケール:低い値(0.3〜0.5)はより創造的な自由度を与え、高い値(0.7〜1.0)はプロンプトをより厳密に遵守する
- 画像品質:画像から動画の場合、最良のモーション品質を得るためにシャープで明るい入力画像を使用する
- 時間の長さ:短い時間(3〜5 秒)から始めて素早くイテレーションし、最終出力では長くする
- ティアの選択:素早いイテレーションにはスタンダード版を、最終的な制作品質の動画にはプロ版を使用する