# Kling 3.0 Turbo API 快手 Kling 3.0 Turbo 影片生成模型的完整 API 參考。 ## 模型變體 此 API 支援兩種模型變體: | 模型 | ID | 描述 | |-------|-----|-------------| | **Kling 3.0 Turbo Text to Video** | `kling-3.0-turbo-text-to-video` | 快速文字生成影片 | | **Kling 3.0 Turbo Image to Video** | `kling-3.0-turbo-image-to-video` | 快速圖像生成影片動畫 | ## 快速比較 | 功能 | Text to Video | Image to Video | |---------|---------------|----------------| | 輸入 | 文字提示詞 | 圖像 + 文字提示詞 | | 時長範圍 | 3-15 秒 | 3-15 秒 | | 解析度選項 | 720p、1080p | 720p、1080p | | 長寬比 | 16:9、9:16、1:1 | 不支援(由來源圖像決定) | | 起始影格 | 不支援 | 必需 | ### 支援的長寬比(Text to Video) | 比例 | 描述 | |-------|-------------| | `16:9` | 橫向(寬螢幕) | | `9:16` | 直向(垂直) | | `1:1` | 正方形 | ## Kling 3.0 Turbo Text to Video ### 端點 ``` POST /api/v1/video/task ``` ### 請求參數 #### 必需 | 參數 | 類型 | 描述 | |-----------|------|-------------| | `model_name` | string | 必須為 `"kling-3.0-turbo-text-to-video"` | | `prompt` | string | 影片生成提示詞 | | `resolution` | string | 輸出解析度:`"720p"` 或 `"1080p"` | | `duration` | number | 影片時長,單位為秒(3-15) | #### 可選 | 參數 | 類型 | 描述 | |-----------|------|-------------| | `aspect_ratio` | string | 影片長寬比:`"16:9"`、`"9:16"` 或 `"1:1"`。預設為 `"16:9"` | | `sound` | boolean | 為影片生成環境聲音 | ### 請求範例 ```javascript 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-3.0-turbo-text-to-video', prompt: 'A girl sits on a train, looking out the window with a melancholic expression, cinematic lighting', aspect_ratio: '16:9', resolution: '720p', duration: 5, sound: true }) }); const { data } = await response.json(); const taskId = data.task_id; ``` ## Kling 3.0 Turbo Image to Video ### 請求參數 #### 必需 | 參數 | 類型 | 描述 | |-----------|------|-------------| | `model_name` | string | 必須為 `"kling-3.0-turbo-image-to-video"` | | `prompt` | string | 動作和場景提示詞 | | `image_url` | string | 首影格圖像 URL | | `resolution` | string | 輸出解析度:`"720p"` 或 `"1080p"` | | `duration` | number | 影片時長,單位為秒(3-15) | #### 可選 | 參數 | 類型 | 描述 | |-----------|------|-------------| | `sound` | boolean | 為影片生成環境聲音 | ### 請求範例 ```javascript { model_name: 'kling-3.0-turbo-image-to-video', prompt: 'The character slowly turns her head and looks out the window, subtle camera movement', image_url: 'https://example.com/test-first-frame.png', resolution: '720p', duration: 5, sound: true } ``` ## 回應格式 提交回應: ```json { "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/{task_id}` 輪詢。任務狀態:`submitted`、`processing`、`succeed`、`failed`。 ## 最佳實務 - 讓提示詞聚焦於動作、鏡頭行為和場景氛圍。 - 對於圖像生成影片,請使用主體清楚、乾淨的首影格圖像。 - 使用較短時長進行更快迭代,然後為最終渲染增加時長。