Skip to content

Create video generation task

POST
/v1/video/generations
curl --request POST \
--url https://api.mirapi.ai/v1/video/generations \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "model": "kling-v1", "prompt": "An astronaut walking on the moon", "duration": 5, "width": 1280, "height": 720 }'

Submits a video generation task; text-to-video and image-to-video are both supported.

Returns a task ID the GET endpoint uses to report status.

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": "An astronaut walking on the moon",
"duration": 5,
"width": 1280,
"height": 720
}

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"
}
}