文本生成视频
通过 CometAPI 的 POST /kling/v1/videos/text2video 使用 Kling 根据文本 Prompt 生成视频,然后通过任务 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.