Skip to main content
POST
/
kling
/
v1
/
videos
/
text2video
cURL
curl https://api.cometapi.com/kling/v1/videos/text2video \
  -H "Authorization: Bearer $COMETAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
      "prompt": "A small ceramic cup on a wooden table, steam rising in soft morning light",
      "model_name": "kling-v3",
      "mode": "std",
      "duration": "5",
      "sound": "off"
    }'
{
  "code": 123,
  "message": "<string>",
  "request_id": "<string>",
  "data": {
    "task_id": "<string>",
    "task_status": "<string>",
    "created_at": 123,
    "updated_at": 123
  }
}
Use this endpoint to create a Kling text-to-video task from a prompt. It starts an async job rather than returning a finished video immediately.
For a copyable create-and-poll flow, start with the Kling API quickstart.

First working request

  • Send a short prompt first
  • Start with the kling-v3 example, then choose another model_name from the OpenAPI enum when you need a different model track
  • Add aspect_ratio, duration, mode, or sound only after the basic flow works
  • Set callback_url if you want push delivery instead of pure polling
  • Use sound: off when 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

SettingSupported valuesDefaultBoundary behavior
duration5, 105Other values are outside the text-to-video request shape.
aspect_ratio16:9, 9:16, 1:116:9Use the ratio that matches your delivery surface.
modestd, prostdpro improves quality and costs more.
soundon, offmodel defaultApplies only to model tracks that support generated audio.
This endpoint does not expose a separate resolution token or exact size field. The requested aspect ratio controls the output frame shape.
aspect_ratioTypical rendered WxH
16:91280x720
9:16720x1280
1:1960x960

Task flow

1

Submit the generation request

Create the task through this endpoint and save the returned Kling task id.
2

Poll the task state

Check progress through Get a Kling task until the task reaches a terminal state.
3

Persist the result

Once Kling returns the finished asset metadata, move the result into your own storage if you need long retention.
For the full parameter matrix and model-track details, refer to the official Kling documentation.

Authorizations

Authorization
string
header
required

Bearer token authentication. Use your CometAPI key.

Headers

Content-Type
string

Must be application/json.

Body

application/json
prompt
string
required

Text prompt describing the video to generate. Maximum 500 characters.

negative_prompt
string

Elements to exclude from the video. Maximum 200 characters.

aspect_ratio
enum<string>

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.

Available options:
16:9,
9:16,
1:1
callback_url
string

Webhook URL to receive task status updates when the task completes.

model_name
enum<string>
default:kling-v1

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.

Available options:
kling-v1,
kling-v1-6,
kling-v2-master,
kling-v2-1-master,
kling-v2-5-turbo,
kling-v2-6,
kling-v3
cfg_scale
number

Prompt adherence strength. Higher values follow the prompt more closely. Range: 0–1.

mode
enum<string>
default:std

Generation mode. std for standard (faster), pro for professional (higher quality). The default is std.

Available options:
std,
pro
duration
string
default:5

Output video length in seconds. Use 5 or 10; omit to use 5.

camera_control
object

Camera motion preset or manual configuration. Omit for automatic camera movement.

external_task_id
string

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.

sound
enum<string>

Optional generated-audio switch for models that support video sound. Use on or off, or omit the field for the model default.

Available options:
on,
off

Response

200 - application/json

Successful Response

code
integer

Error code; specifically define the error code

message
string

error message

request_id
string

Request ID, system-generated, for tracking requests, troubleshooting issues

data
object