> ## Documentation Index
> Fetch the complete documentation index at: https://platform.minimaxi.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# 查询视频生成任务

> 按 task_id 查询单个视频生成任务的状态与结果，任务成功后获取生成视频。



## OpenAPI

````yaml api-reference/video/generation/api/v2-video-generation.json GET /v2/query/video_generation/{task_id}
openapi: 3.1.0
info:
  title: MiniMax API
  description: MiniMax video generation V2 (Hailuo-03) API
  license:
    name: MIT
  version: 2.0.0
servers:
  - url: https://api.minimaxi.com
security:
  - bearerAuth: []
paths:
  /v2/query/video_generation/{task_id}:
    get:
      tags:
        - Video V2
      summary: 查询视频生成任务
      description: >-
        查询单个视频生成任务的状态与结果。任务成功（`status=succeeded`）后可从 `content` 获取生成视频。


        > 仅支持查询最近 7 天内的任务记录（窗口 `[T-7天, T)`，`T` 为请求发起时刻的 UTC 时间戳，精确到秒）；超出该窗口的
        `task_id` 将返回 `invalid task_id`。生成视频的下载链接有时效，请及时下载或转存。
      operationId: videoGenerationV2Query
      parameters:
        - name: task_id
          in: path
          required: true
          description: 要查询的视频生成任务 ID（创建任务返回的 `task_id`）。
          schema:
            type: string
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GetVideoGenerationV2Resp'
              examples:
                成功:
                  value:
                    task:
                      id: '424010985738629'
                      model: MiniMax-H3
                      status: succeeded
                      created_at: 1785125529
                      updated_at: 1785125946
                      content:
                        url: >-
                          https://cdn.hailuoai.com/prod/hailuo_demo/testsets/h3_promo_eval_ref2va/gallery/sr_v2p26_trio_seed42_20260724/inputs/89f8c0bbee5b_denoise_ids_0_final.mp4
                      resolution: 2K
                      duration: 5
                      usage:
                        total_seconds: 5
                        input_seconds: 0
                        output_seconds: 5
                        image_count: 0
                      ratio: '16:9'
                      task_type: generation
                失败:
                  value:
                    task:
                      id: '424010985738630'
                      model: MiniMax-H3
                      status: failed
                      error:
                        code: '1026'
                        message: video description contains sensitive content
                      created_at: 1785125529
                      updated_at: 1785125700
                      resolution: 2K
                      duration: 5
                      usage:
                        total_seconds: 0
                        input_seconds: 0
                        output_seconds: 0
                        image_count: 0
                      ratio: '16:9'
                      task_type: generation
        '400':
          $ref: '#/components/responses/Err400'
        '401':
          $ref: '#/components/responses/Err401'
        '429':
          $ref: '#/components/responses/Err429'
        '500':
          $ref: '#/components/responses/Err500'
components:
  schemas:
    GetVideoGenerationV2Resp:
      type: object
      properties:
        task:
          $ref: '#/components/schemas/VideoTask'
      example:
        task:
          id: '424010985738629'
          model: MiniMax-H3
          status: succeeded
          created_at: 1785125529
          updated_at: 1785125946
          content:
            url: >-
              https://video-product.cdn.minimax.io/inference_output/rollout/2026-07-27/6c68f487-4b33-48cb-8c92-1631f63f6682/output.mp4
          resolution: 2K
          duration: 5
          usage:
            total_seconds: 5
            input_seconds: 0
            output_seconds: 5
            image_count: 0
          ratio: '16:9'
          task_type: generation
    VideoTask:
      type: object
      description: 视频生成任务对象。
      properties:
        id:
          type: string
          description: 视频生成任务 ID。
        model:
          type: string
          description: 任务使用的模型名称，如 `MiniMax-H3`。
        status:
          type: string
          description: |-
            任务状态：
            - `queued`：排队中
            - `running`：运行中
            - `succeeded`：成功
            - `failed`：失败
            - `cancelled`：已取消
            - `expired`：超时
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
            - expired
        error:
          $ref: '#/components/schemas/VideoTaskError'
          description: 错误信息，任务成功时不返回；任务失败时返回 `code` 与 `message`。
        created_at:
          type: integer
          description: 任务创建时间的 Unix 时间戳（秒）。
        updated_at:
          type: integer
          description: 任务状态更新时间的 Unix 时间戳（秒）。
        content:
          $ref: '#/components/schemas/VideoTaskContent'
          description: 任务输出内容，任务成功后返回。
        resolution:
          type: string
          description: 生成视频的分辨率。
        duration:
          type: integer
          description: 生成视频的时长（秒）。
        usage:
          $ref: '#/components/schemas/VideoTaskUsage'
          description: 本次请求的计费用量（按秒）。任务失败/未成功时各项返回 0。
        ratio:
          type: string
          description: 生成视频的宽高比。
        task_type:
          type: string
          description: 任务类型。
        modality:
          type: string
          description: 输出模态：`video` / `audio`。
    OaiError:
      type: object
      description: OpenAI 风格错误响应。出错时 HTTP 状态码为真实错误码(401/400/429/402/422/500…),响应体为该结构。
      properties:
        type:
          type: string
          description: 固定为 `error`。
          example: error
        error:
          $ref: '#/components/schemas/OaiErrorDetail'
        request_id:
          type: string
          description: 请求追踪 ID(便于排查)。
    VideoTaskError:
      type: object
      properties:
        code:
          type: string
          description: 错误码。
        message:
          type: string
          description: 错误提示信息。
    VideoTaskContent:
      type: object
      properties:
        url:
          type: string
          description: 生成视频的下载 URL（mp4），有时效，请及时下载或转存；过期后重新查询获取。
    VideoTaskUsage:
      type: object
      description: 计费用量（按秒计费）。
      properties:
        total_seconds:
          type: integer
          description: 本次计费总秒数 = 输入秒数 + 输出秒数。
        input_seconds:
          type: integer
          description: 输入参考视频计费秒数（含参考视频时计）。
        output_seconds:
          type: integer
          description: 输出视频计费秒数。
        image_count:
          type: integer
          description: 本次计费涉及的图片数量。
    OaiErrorDetail:
      type: object
      properties:
        type:
          type: string
          description: >-
            错误类型:`authorized_error`(401)/`bad_request_error`(400)/`rate_limit_error`(429)/`insufficient_balance_error`(402)/`unprocessable_entity_error`(422)/`overloaded_error`(529)/`server_error`(500)
            等。
        message:
          type: string
          description: 错误详情,结尾括号内为内部错误码(如 `... (1004)`)。
        http_code:
          type: string
          description: HTTP 状态码字符串,如 `401`。
  responses:
    Err400:
      description: 参数错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OaiError'
          example:
            type: error
            error:
              type: bad_request_error
              message: invalid params (2013)
              http_code: '400'
            request_id: 021785229015510a2c883cf675b9804d
    Err401:
      description: 鉴权失败
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OaiError'
          example:
            type: error
            error:
              type: authorized_error
              message: >-
                login fail: Please carry the API secret key in the
                'Authorization' field of the request header (1004)
              http_code: '401'
            request_id: 021785229015510a2c883cf675b9804d
    Err429:
      description: 触发限流
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OaiError'
          example:
            type: error
            error:
              type: rate_limit_error
              message: rate limit, please retry later (1002)
              http_code: '429'
            request_id: 021785229015510a2c883cf675b9804d
    Err500:
      description: 服务端错误
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/OaiError'
          example:
            type: error
            error:
              type: server_error
              message: internal error (1000)
              http_code: '500'
            request_id: 021785229015510a2c883cf675b9804d
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: |-
        `HTTP: Bearer Auth`
         - Security Scheme Type: http
         - HTTP Authorization Scheme: Bearer API_key，用于验证账户信息，可在 [账户管理>接口密钥](https://platform.minimaxi.com/user-center/basic-information/interface-key) 中查看。

````