Skip to main content
POST
/
vendors
/
kling
/
v1
/
videos
/
text2video
Text to Video
curl --request POST \
  --url https://api.mulerun.com/vendors/kling/v1/videos/text2video \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "model_name": "kling-v2-1-master",
  "prompt": "A beautiful woman is dancing in a room",
  "negative_prompt": "ugly, bad, distorted",
  "cfg_scale": 0.5,
  "mode": "std"
}'
{
  "videos": [
    "https://example.com/1234567890.mp4"
  ],
  "task_info": {
    "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "status": "succeeded",
    "created_at": "2023-11-07T05:31:56Z",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}
This API is compatible with Kling’s format.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Text to Video create task request body

prompt
string
required

Positive text prompt. Cannot exceed 2500 characters.

Maximum length: 2500
model_name
enum<string>
default:kling-v2-1-master

Model Name

Available options:
kling-v2-1-master
negative_prompt
string | null

Negative text prompt. Cannot exceed 2500 characters.

Maximum length: 2500
cfg_scale
number
default:0.5

Flexibility in video generation. Higher value means lower flexibility and stronger relevance to the prompt. Range [0, 1].

Not supported by Kling v2.x models.

Required range: 0 <= x <= 1
mode
enum<string>
default:std

Video generation mode

std: Standard Mode, which is cost-effective. pro: Professional Mode, generates videos use longer duration but higher quality video output.

Available options:
std,
pro
camera_control
object

Terms of controlling camera movement. If not specified, the model will intelligently match based on the input text/images.

aspect_ratio
enum<string>
default:16:9

The aspect ratio of the generated video frame (width:height)

Available options:
16:9,
9:16,
1:1
duration
enum<string>
default:5

Video Length in seconds

Available options:
5,
10

Response

200 - application/json

Message object.

videos
string<uri>[]

URL of the generated video

Example:
["https://example.com/1234567890.mp4"]
task_info
object
I