Skip to content

Kling text-to-video

POST
/kling/v1/videos/text2video
curl --request POST \
--url https://api.mirapi.ai/kling/v1/videos/text2video \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "kling-v1", "prompt": "The astronaut stands up and walks away", "duration": 5, "width": 1280, "height": 720, "fps": 30 }'

Generates a video from a text description with a Kling model.

Supported models: kling-v1, kling-v1-5 and others

Media typeapplication/json

Video generation request

object
model

Model/style ID

string
prompt

Text prompt

string
image

Image input (URL or Base64)

string
duration

Video duration, in seconds

number
width

Video width

integer
height

Video height

integer
fps

Video frame rate

integer
seed

Random seed

integer
n

Number of videos to generate

integer
response_format

Response format

string
user

User identifier

string
metadata

Extra parameters (negative_prompt, style, quality_level and so on)

object
key
additional properties
any
Example
{
"model": "kling-v1",
"prompt": "The astronaut stands up and walks away",
"duration": 5,
"width": 1280,
"height": 720,
"fps": 30
}

Video generation task created

Media typeapplication/json

Video generation task submission response

object
task_id

Task ID

string
status

Task status

string
Example
{
"task_id": "abcd1234efgh",
"status": "queued"
}

Invalid request parameters

Media typeapplication/json
object
error
object
message

Error message

string
type

Error type

string
param

Related parameter

string
nullable
code

Error code

string
nullable
Examplegenerated
{
"error": {
"message": "example",
"type": "example",
"param": "example",
"code": "example"
}
}