# MiniMax Hailuo 02 Video Generation

> Video Generation

Submit an asynchronous MiniMax-Hailuo-02 text-to-video or image-to-video generation task.

## Endpoint

`POST https://api.modelverse.cn/v1/tasks/submit`

## Request Body

## Responses

- **200** — Task submitted successfully.
- **400** — Invalid request parameters.
- **default** — Error response.

## OpenAPI Definition

```json
{
  "openapi": "3.1.0",
  "x-language": "en-US",
  "info": {
    "title": "ModelVerse MiniMax-Hailuo-02 Video Task API",
    "version": "1.0.0",
    "description": "Self-contained OpenAPI 3.1 schema for the ModelVerse MiniMax-Hailuo-02\ntext-to-video and image-to-video asynchronous task API.\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "ModelVerse API endpoint documented for this model."
    }
  ],
  "tags": [
    {
      "name": "MiniMax-Hailuo-02",
      "description": "MiniMax-Hailuo-02 asynchronous video task operations."
    }
  ],
  "paths": {
    "/v1/tasks/submit": {
      "post": {
        "tags": [
          "MiniMax-Hailuo-02"
        ],
        "operationId": "submitMiniMaxHailuo02Task",
        "summary": "MiniMax Hailuo 02 Video Generation",
        "description": "Submit an asynchronous MiniMax-Hailuo-02 text-to-video or image-to-video generation task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MiniMaxHailuo02SubmitRequest"
              },
              "examples": {
                "textToVideo": {
                  "summary": "Text-to-video task",
                  "value": {
                    "model": "MiniMax-Hailuo-02",
                    "input": {
                      "prompt": "A beautiful sunset over the ocean with waves gently crashing on the shore. [推进, 跟随]"
                    },
                    "parameters": {
                      "duration": 6,
                      "resolution": "1080P",
                      "prompt_optimizer": true,
                      "fast_pretreatment": false,
                      "aigc_watermark": false
                    }
                  }
                },
                "imageToVideo": {
                  "summary": "Image-to-video task with start and end frames",
                  "value": {
                    "model": "MiniMax-Hailuo-02",
                    "input": {
                      "prompt": "A cinematic product reveal with a slow push-in camera move. [推进]",
                      "first_frame_image": "https://example.com/first-frame.jpg",
                      "last_frame_image": "https://example.com/last-frame.png"
                    },
                    "parameters": {
                      "duration": 10,
                      "resolution": "768P",
                      "prompt_optimizer": true,
                      "fast_pretreatment": false,
                      "aigc_watermark": false
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Task submitted successfully.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02SubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "Submitted task",
                    "value": {
                      "output": {
                        "task_id": "106916112212032"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "invalidParameter": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/v1/tasks/status": {
      "get": {
        "tags": [
          "MiniMax-Hailuo-02"
        ],
        "operationId": "getMiniMaxHailuo02TaskStatus",
        "summary": "MiniMax Hailuo 02 Task Status",
        "description": "Query the status, result URLs, and usage for an asynchronous MiniMax-Hailuo-02 task.",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "task_id",
            "in": "query",
            "required": true,
            "description": "Unique identifier of the asynchronous task returned by `/v1/tasks/submit`.",
            "schema": {
              "type": "string"
            },
            "example": "176843862716480"
          }
        ],
        "responses": {
          "200": {
            "description": "Task status response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02StatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "Successful task",
                    "value": {
                      "output": {
                        "task_id": "176843862716480",
                        "task_status": "Success",
                        "urls": [
                          "https://xxxxx/xxxx.mp4"
                        ],
                        "submit_time": 1756959000,
                        "finish_time": 1756959050
                      },
                      "usage": {
                        "duration": 6
                      },
                      "request_id": ""
                    }
                  },
                  "failure": {
                    "summary": "Failed task",
                    "value": {
                      "output": {
                        "task_id": "task_id",
                        "task_status": "Failure",
                        "submit_time": 1756959000,
                        "finish_time": 1756959019,
                        "error_message": "error_message"
                      },
                      "usage": {
                        "duration": 6
                      },
                      "request_id": ""
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid task identifier or request parameters.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "invalidParameter": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "Error response.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "error": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "ModelVerse API key sent in the `Authorization: Bearer <API_KEY>` header."
      }
    },
    "schemas": {
      "MiniMaxHailuo02SubmitRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "model",
          "input"
        ],
        "properties": {
          "model": {
            "type": "string",
            "const": "MiniMax-Hailuo-02",
            "description": "Model name. This schema is pinned to MiniMax-Hailuo-02."
          },
          "input": {
            "$ref": "#/components/schemas/MiniMaxHailuo02Input"
          },
          "parameters": {
            "$ref": "#/components/schemas/MiniMaxHailuo02Parameters"
          }
        }
      },
      "MiniMaxHailuo02Input": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "prompt"
        ],
        "properties": {
          "prompt": {
            "type": "string",
            "maxLength": 2000,
            "description": "Video prompt. Supports camera movement instructions such as\n[左移], [右移], [左摇], [右摇], [推进], [拉远], [上升], [下降],\n[上摇], [下摇], [变焦推近], [变焦拉远], [晃动], [跟随], and [固定].\n"
          },
          "first_frame_image": {
            "$ref": "#/components/schemas/MiniMaxHailuo02ImageReference"
          },
          "last_frame_image": {
            "$ref": "#/components/schemas/MiniMaxHailuo02ImageReference"
          }
        }
      },
      "MiniMaxHailuo02ImageReference": {
        "type": "string",
        "x-supported-formats": [
          "JPG",
          "JPEG",
          "PNG",
          "WebP"
        ],
        "x-max-file-size-mb": 20,
        "x-min-short-side-px-exclusive": 300,
        "x-min-aspect-ratio": "2:5",
        "x-max-aspect-ratio": "5:2",
        "description": "Public image URL or base64-encoded Data URL such as\n`data:image/jpeg;base64,...`. Supported formats are JPG, JPEG, PNG,\nand WebP. The image must be no larger than 20 MB, its short side must\nbe greater than 300 px, and its aspect ratio must be between 2:5 and 5:2.\n",
        "examples": [
          "https://example.com/frame.jpg",
          "data:image/jpeg;base64,..."
        ]
      },
      "MiniMaxHailuo02Parameters": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "enum": [
              6,
              10
            ],
            "default": 6,
            "description": "Video duration in seconds. MiniMax-Hailuo-02 supports 6 or 10 seconds."
          },
          "resolution": {
            "type": "string",
            "enum": [
              "768P",
              "1080P"
            ],
            "default": "768P",
            "description": "Video resolution. 768P supports 6 or 10 seconds; 1080P supports 6 seconds."
          },
          "prompt_optimizer": {
            "type": "boolean",
            "default": true,
            "description": "Whether to automatically optimize the prompt."
          },
          "fast_pretreatment": {
            "type": "boolean",
            "default": false,
            "description": "Whether to shorten prompt optimization preprocessing time. Documented as effective only for MiniMax-Hailuo-2.3."
          },
          "aigc_watermark": {
            "type": "boolean",
            "default": false,
            "description": "Whether to add an AIGC watermark to the generated video."
          }
        }
      },
      "MiniMaxHailuo02SubmitResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/MiniMaxHailuo02SubmitOutput"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "MiniMaxHailuo02SubmitOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          }
        }
      },
      "MiniMaxHailuo02StatusResponse": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "output",
          "request_id"
        ],
        "properties": {
          "output": {
            "$ref": "#/components/schemas/MiniMaxHailuo02StatusOutput"
          },
          "usage": {
            "$ref": "#/components/schemas/MiniMaxHailuo02Usage"
          },
          "request_id": {
            "type": "string",
            "description": "Unique request identifier."
          }
        }
      },
      "MiniMaxHailuo02StatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "Unique identifier of the asynchronous task."
          },
          "task_status": {
            "$ref": "#/components/schemas/MiniMaxHailuo02TaskStatus"
          },
          "urls": {
            "type": "array",
            "description": "Video result URL list.",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task submission timestamp."
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "Task completion timestamp."
          },
          "error_message": {
            "type": "string",
            "description": "Error message returned when the task fails."
          }
        }
      },
      "MiniMaxHailuo02TaskStatus": {
        "type": "string",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ],
        "description": "Task status."
      },
      "MiniMaxHailuo02Usage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "description": "Video duration in seconds."
          }
        }
      },
      "MiniMaxHailuo02ErrorResponse": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "$ref": "#/components/schemas/MiniMaxHailuo02ErrorObject"
          }
        }
      },
      "MiniMaxHailuo02ErrorObject": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "message",
          "type"
        ],
        "properties": {
          "message": {
            "type": "string",
            "description": "Error message."
          },
          "type": {
            "type": "string",
            "description": "Error type.",
            "enum": [
              "invalid_request_error",
              "authentication_error",
              "permission_error",
              "rate_limit_error",
              "timeout",
              "internal_error"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "Error code.",
            "enum": [
              "param_error",
              "auth_error",
              "model_error",
              "rate_limit",
              "timeout",
              "internal_error",
              null
            ]
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "Related request parameter, if any."
          }
        }
      }
    },
    "examples": {
      "MiniMaxHailuo02InvalidParameterError": {
        "summary": "Invalid parameter error",
        "value": {
          "error": {
            "message": "Invalid param",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": null
          }
        }
      }
    }
  }
}
```
