# MiniMax Hailuo 02 任务状态

> 视频生成

查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。

## 请求地址

`GET https://api.modelverse.cn/v1/tasks/status`

## 请求参数

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| task_id | query | string | Yes | Unique identifier of the asynchronous task returned by `/v1/tasks/submit`. |

## 响应

- **200** — 任务状态响应。
- **400** — 任务标识或请求参数无效。
- **default** — 错误响应。

## OpenAPI 定义

```json
{
  "openapi": "3.1.0",
  "x-language": "zh-CN",
  "info": {
    "title": "MiniMax-Hailuo-02接口文档",
    "version": "1.0.0",
    "description": "这是 ModelVerse 上 `MiniMax-Hailuo-02` 的视频接口文档，说明如何提交生成任务、查询任务状态、读取视频结果以及处理错误。\n接口路径包括 `POST /v1/tasks/submit`、`GET /v1/tasks/status`。\n"
  },
  "servers": [
    {
      "url": "https://api.modelverse.cn",
      "description": "该模型文档中使用的 ModelVerse API 端点。"
    }
  ],
  "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 视频生成",
        "description": "提交异步任务。请求体中的模型和参数按本模型文档填写，响应会返回任务 ID。\n",
        "security": [
          {
            "bearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MiniMaxHailuo02SubmitRequest"
              },
              "examples": {
                "textToVideo": {
                  "summary": "文生视频任务",
                  "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": "图生视频任务带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": "任务提交成功。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02SubmitResponse"
                },
                "examples": {
                  "submitted": {
                    "summary": "已提交任务",
                    "value": {
                      "output": {
                        "task_id": "106916112212032"
                      },
                      "request_id": "request_id"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "invalidParameter": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "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 任务状态",
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n",
        "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": "任务状态响应。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02StatusResponse"
                },
                "examples": {
                  "success": {
                    "summary": "成功任务",
                    "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": "失败任务",
                    "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": "任务标识或请求参数无效。",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MiniMaxHailuo02ErrorResponse"
                },
                "examples": {
                  "invalidParameter": {
                    "$ref": "#/components/examples/MiniMaxHailuo02InvalidParameterError"
                  }
                }
              }
            }
          },
          "default": {
            "description": "错误响应。",
            "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": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      }
    },
    "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": "视频起始帧或尾帧图片，支持公网 URL 或 Base64 编码的 Data URL\n（格式：`data:image/jpeg;base64,...`）。支持 JPG、JPEG、PNG、WebP，\n体积不超过 20 MB，短边像素大于 300 px，长宽比在 2:5 到 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": "唯一请求标识。"
          }
        }
      },
      "MiniMaxHailuo02SubmitOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "异步任务唯一标识。"
          }
        }
      },
      "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": "唯一请求标识。"
          }
        }
      },
      "MiniMaxHailuo02StatusOutput": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "task_id",
          "task_status"
        ],
        "properties": {
          "task_id": {
            "type": "string",
            "description": "异步任务唯一标识。"
          },
          "task_status": {
            "$ref": "#/components/schemas/MiniMaxHailuo02TaskStatus"
          },
          "urls": {
            "type": "array",
            "description": "视频结果 URL 列表。",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "submit_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务提交时间戳。"
          },
          "finish_time": {
            "type": "integer",
            "format": "int64",
            "description": "任务完成时间戳。"
          },
          "error_message": {
            "type": "string",
            "description": "任务失败时返回的错误信息。"
          }
        }
      },
      "MiniMaxHailuo02TaskStatus": {
        "type": "string",
        "enum": [
          "Pending",
          "Running",
          "Success",
          "Failure"
        ],
        "description": "查询异步任务状态。任务完成后，响应中会包含结果 URL、用量信息或错误信息。\n"
      },
      "MiniMaxHailuo02Usage": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "duration": {
            "type": "integer",
            "description": "视频时长，单位为秒。"
          }
        }
      },
      "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": "错误信息。"
          },
          "type": {
            "type": "string",
            "description": "错误类型。",
            "enum": [
              "invalid_request_error",
              "authentication_error",
              "permission_error",
              "rate_limit_error",
              "timeout",
              "internal_error"
            ]
          },
          "code": {
            "type": [
              "string",
              "null"
            ],
            "description": "错误码。",
            "enum": [
              "param_error",
              "auth_error",
              "model_error",
              "rate_limit",
              "timeout",
              "internal_error",
              null
            ]
          },
          "param": {
            "type": [
              "string",
              "null"
            ],
            "description": "相关请求参数，如有。"
          }
        }
      }
    },
    "examples": {
      "MiniMaxHailuo02InvalidParameterError": {
        "summary": "参数错误",
        "value": {
          "error": {
            "message": "Invalid param",
            "type": "invalid_request_error",
            "code": "param_error",
            "param": null
          }
        }
      }
    }
  }
}
```
