Create a Kling text-to-video task
Generate videos from text prompts with Kling via CometAPI POST /kling/v1/videos/text2video, then track task status and retrieve results by task ID.
First working request
- Send a short prompt first
- Start with the
kling-v3example, then choose anothermodel_namefrom the OpenAPI enum when you need a different model track - Add
aspect_ratio,duration,mode, orsoundonly after the basic flow works - Set
callback_urlif you want push delivery instead of pure polling - Use
sound: offwhen you want a deterministic no-audio first request on models that support generated sound
Model naming
Use ordinary Kling video model IDs on this endpoint. Keep Omni model IDs for Omni Video.Duration and aspect ratio
| Setting | Supported values | Default | Boundary behavior |
|---|---|---|---|
duration | 5, 10 | 5 | Other values are outside the text-to-video request shape. |
aspect_ratio | 16:9, 9:16, 1:1 | 16:9 | Use the ratio that matches your delivery surface. |
mode | std, pro | std | pro improves quality and costs more. |
sound | on, off | model default | Applies only to model tracks that support generated audio. |
size field. The requested aspect ratio controls the output frame shape.
aspect_ratio | Typical rendered WxH |
|---|---|
16:9 | 1280x720 |
9:16 | 720x1280 |
1:1 | 960x960 |
Task flow
Submit the generation request
Poll the task state
Authorizations
Bearer token authentication. Use your CometAPI key.
Headers
Must be application/json.
Body
Text prompt describing the video to generate. Maximum 500 characters.
Elements to exclude from the video. Maximum 200 characters.
Aspect ratio request. Typical rendered sizes are 1280x720 for 16:9, 720x1280 for 9:16, and 960x960 for 1:1. This endpoint does not expose an exact size field.
16:9, 9:16, 1:1 Webhook URL to receive task status updates when the task completes.
Model ID for this text-to-video request. Use an ordinary Kling video model ID; use Omni model IDs only with the Omni Video endpoint.
kling-v1, kling-v1-6, kling-v2-master, kling-v2-1-master, kling-v2-5-turbo, kling-v2-6, kling-v3 Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.
Generation mode. std for standard (faster), pro for professional (higher quality). The default is std.
std, pro Output video length in seconds. Use 5 or 10; omit to use 5.
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.
Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.
on, off