curl --request POST \
--url https://api.dreamto.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4.0-omni",
"input": {
"prompt": "The girl from the first image and the fox from the second image walk together through a snowy forest, cinematic",
"reference_image_urls": [
"https://your-cdn.example.com/girl.png",
"https://your-cdn.example.com/fox.png"
],
"resolution": "1080P",
"duration": 5,
"aspect_ratio": "16:9"
}
}
'
{
"task_id": "job_02b88886c4fda5be35baff61",
"status": "in_progress",
"model": "kling-4.0-omni",
"created_at": 1794846663,
"request_id": "req_6a9a539502118ba1c33f1bfc"
}{
"error": {
"code": "invalid_request",
"http_status": 400,
"message": "Invalid request.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"http_status": 401,
"message": "Invalid API key.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_balance",
"http_status": 402,
"message": "Insufficient balance.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "insufficient_balance_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"http_status": 429,
"message": "Rate limit exceeded. Please try again later.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "rate_limit_error"
}
}{
"error": {
"code": "service_unavailable",
"http_status": 502,
"message": "Service temporarily unavailable. Please try again later.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "api_error"
}
}Kling 4.0 Omni
Create a video task
Submits an asynchronous video generation task and returns a task_id immediately; the video is generated in the background. The body is {"model": "...", "input": {...}} with every generation parameter inside input. Poll GET /v1/videos/{task_id} with the task_id until status is completed or failed.
POST
/
v1
/
videos
curl --request POST \
--url https://api.dreamto.ai/v1/videos \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"model": "kling-4.0-omni",
"input": {
"prompt": "The girl from the first image and the fox from the second image walk together through a snowy forest, cinematic",
"reference_image_urls": [
"https://your-cdn.example.com/girl.png",
"https://your-cdn.example.com/fox.png"
],
"resolution": "1080P",
"duration": 5,
"aspect_ratio": "16:9"
}
}
'
{
"task_id": "job_02b88886c4fda5be35baff61",
"status": "in_progress",
"model": "kling-4.0-omni",
"created_at": 1794846663,
"request_id": "req_6a9a539502118ba1c33f1bfc"
}{
"error": {
"code": "invalid_request",
"http_status": 400,
"message": "Invalid request.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "invalid_request_error"
}
}{
"error": {
"code": "unauthorized",
"http_status": 401,
"message": "Invalid API key.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "authentication_error"
}
}{
"error": {
"code": "insufficient_balance",
"http_status": 402,
"message": "Insufficient balance.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "insufficient_balance_error"
}
}{
"error": {
"code": "rate_limit_exceeded",
"http_status": 429,
"message": "Rate limit exceeded. Please try again later.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "rate_limit_error"
}
}{
"error": {
"code": "service_unavailable",
"http_status": 502,
"message": "Service temporarily unavailable. Please try again later.",
"request_id": "req_6a9a539502118ba1c33f1bfc",
"type": "api_error"
}
}Authorizations
Body
application/json
Body of a Kling 4.0 Omni video generation request.
Response
Task created.
Response of a create request.
Task status; queued or in_progress right after creation.
Allowed values:
queued: Waiting in the queue.in_progress: Being generated.completed: Finished; download the video fromvideo_url.failed: Failed; seeerrorfor the reason. Not charged.
Available options:
queued, in_progress, completed, failed 
