文字轉影片
透過 CometAPI 的 POST /kling/v1/videos/text2video 使用 Kling 根據文字 Prompt 產生影片,然後依 task ID 追蹤任務狀態並取得結果。
使用這個端點可根據 Prompt 建立一個 Kling 的文字轉影片任務。它會啟動非同步工作,而不是立即回傳完成的影片。Documentation Index
Fetch the complete documentation index at: https://apidoc.cometapi.com/llms.txt
Use this file to discover all available pages before exploring further.
第一個可運作的請求
- 先傳送簡短的 Prompt
- 僅在基本流程可正常運作後,再加入
aspect_ratio、duration或mode - 如果你想使用推送交付而非純輪詢,請設定
callback_url
任務流程
輪詢任務狀態
授權
Bearer token authentication. Use your CometAPI key.
標頭
Must be application/json.
主體
Text prompt describing the video to generate. Maximum 500 characters.
Elements to exclude from the video. Maximum 200 characters.
Output aspect ratio (width:height). Options: 16:9, 9:16, 1:1, 4:3, 3:4, 3:2, 2:3.
Webhook URL to receive task status updates when the task completes.
Kling model variant to use. See the Models page for current options.
Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.
Generation mode. std for standard (faster), pro for professional (higher quality).
std, pro Output video length in seconds. Options: 5, 10.
Camera motion preset or manual configuration. Omit for automatic camera movement.
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.