> ## 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 查询最近 7 天内单个视频生成、H3-Context-IR 或视频再生成任务的状态与结果。



## 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: >-
        查询单个视频生成、H3-Context-IR 或视频再生成任务的状态与结果。任务成功（`status=succeeded`）后可从
        `content` 获取产物：视频任务返回 `content.url`，H3-Context-IR 任务返回 `content.prompt`
        中的增强提示词。


        > 仅支持查询最近 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
                        input_image_count: 1
                        input_audio_seconds: 6
                        total_tokens: 273890
                        prompt_tokens: 13500
                        completion_tokens: 260390
                      ratio: '16:9'
                      task_type: generation
                      modality: video
                H3-Context-IR 成功:
                  value:
                    task:
                      id: '426586401755526'
                      model: MiniMax-H3
                      status: succeeded
                      created_at: 1785702855
                      updated_at: 1785702884
                      content:
                        prompt: >-
                          integrated_multimodal_description: [Shot 1] Cinematic,
                          wide shot with a slow push in on a female captain
                          standing center frame with her back to the camera. She
                          has a slender build and short, swept-back silver hair,
                          wearing a crisp, dark navy-blue futuristic military
                          uniform adorned with rigid silver epaulets. Before her
                          stretches a colossal, curved glass observation window
                          dominating the dimly lit starship bridge. The interior
                          features sleek metallic consoles on the left and right
                          emitting soft cyan light. Outside the window, a
                          massive fleet of dark-grey, heavily armored
                          dreadnoughts and cruisers is assembling against a
                          backdrop of a swirling deep-purple and magenta nebula.
                          The rear thrusters of the distant ships glow intensely
                          with fiery orange light. [Shot 2] At 00:02.800, the
                          camera cuts to a medium close-up of the captain from
                          Shot 1 in profile facing right, while the camera
                          shakes strongly. Her facial features are now visible,
                          revealing a woman in her late forties with sharp
                          cheekbones and a stoic expression. A sudden, blinding
                          flash of brilliant cyan and white light bursts through
                          the window as the fleet outside simultaneously jumps
                          into warp, casting harsh, overexposed illumination
                          across her face. The bridge vibrates violently,
                          causing her shoulders to tense and her uniform collar
                          to tremble. The intense light instantly fades into
                          deep shadow, leaving her completely alone against the
                          newly emptied, pitch-black void of space.

                          overall_soundscape: Deep, resonant low-frequency
                          thrumming of ship engines, overlaid with rhythmic,
                          high-pitched electronic beeps from the consoles,
                          followed by a sudden, deafening sub-bass boom and a
                          loud, sizzling crackle as the warp drives engage. The
                          immense acoustic impact causes a heavy, metallic
                          clattering of the bridge panels, which instantly drops
                          off into a stark, quiet mechanical hum.

                          non_diegetic_music: Symphonic orchestral score,
                          beginning with a slow, rising brass and string
                          crescendo that abruptly cuts off, instantly
                          transitioning into a single, sustained, low-register
                          solo cello note with no dynamic swell.
                      duration: 5
                      usage:
                        total_tokens: 9090
                        prompt_tokens: 5664
                        completion_tokens: 3426
                      ratio: '16:9'
                      task_type: h3_context_ir
                      modality: text
                视频再生成成功:
                  value:
                    task:
                      id: '424010985738631'
                      model: MiniMax-H3
                      status: succeeded
                      created_at: 1785126000
                      updated_at: 1785126300
                      content:
                        url: >-
                          https://your-cdn.example.com/h3-regenerated-2k-output.mp4
                      resolution: 2K
                      duration: 5
                      usage:
                        total_seconds: 5
                        input_seconds: 0
                        output_seconds: 5
                        input_image_count: 0
                        total_tokens: 97645
                        prompt_tokens: 0
                        completion_tokens: 97645
                      ratio: ''
                      task_type: regeneration
                      modality: video
                失败:
                  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: {}
                      ratio: '16:9'
                      task_type: generation
                      modality: video
        '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
            input_image_count: 1
            input_audio_seconds: 6
            total_tokens: 273890
            prompt_tokens: 13500
            completion_tokens: 260390
          ratio: '16:9'
          task_type: generation
    VideoTask:
      type: object
      description: H3 共享任务查询和列表接口返回的任务对象。
      properties:
        id:
          type: string
          description: 任务 ID。
        model:
          type: string
          description: 任务使用的模型名称，如 `MiniMax-H3`。
        status:
          type: string
          description: |-
            任务状态：
            - `queued`：排队中
            - `running`：运行中
            - `succeeded`：成功
            - `failed`：失败
            - `cancelled`：已取消
          enum:
            - queued
            - running
            - succeeded
            - failed
            - cancelled
        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: 本次请求的用量。视频任务返回按秒计量的字段；H3-Context-IR 任务返回 Token 用量字段。仅任务成功时返回。
        ratio:
          type: string
          description: 任务产物的宽高比；不适用于当前任务类型时可能返回空字符串。
        task_type:
          type: string
          description: |-
            任务类型：
            - `generation`：视频生成
            - `h3_context_ir`：H3-Context-IR（`/v2/h3_context_ir`）
            - `regeneration`：视频再生成（`/v2/video_regeneration`）
          enum:
            - generation
            - h3_context_ir
            - regeneration
        modality:
          type: string
          description: 产物模态。视频生成和视频再生成任务返回 `video`；H3-Context-IR 任务返回 `text`。
          enum:
            - video
            - text
    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，请及时下载或转存；过期后可重新查询获取。
        prompt:
          type: string
          description: H3-Context-IR 任务生成的结构化增强提示词。仅当 `task_type=h3_context_ir` 且任务成功时返回。
    VideoTaskUsage:
      type: object
      description: 本次请求的用量。视频任务返回按秒计量的字段；H3-Context-IR 任务返回 Token 用量字段。仅任务成功时返回。
      properties:
        total_seconds:
          type: integer
          description: 本次计量总秒数 = 输入秒数 + 输出秒数。
        input_seconds:
          type: integer
          description: 输入参考视频秒数（含参考视频时计）。
        output_seconds:
          type: integer
          description: 输出视频秒数。
        input_image_count:
          type: integer
          description: >-
            本次输入的图片总数量（first_frame + middle_frame + last_frame + reference_image
            全部相加）。
        input_audio_seconds:
          type: integer
          description: 输入参考音频秒数（各段取和四舍五入）；无参考音频时不返回。
        total_tokens:
          type: integer
          description: |-
            本次总 Token 数 = prompt_tokens + completion_tokens。
            - 视频任务由用量折算；
            - H3-Context-IR 任务使用的 Token 总数。
        prompt_tokens:
          type: integer
          description: |-
            输入 Token 数。
            - 视频任务 = 输入参考视频秒数折算 + 全部输入图片数折算 + 输入参考音频秒数折算，无上述输入时为 0；
            - H3-Context-IR 任务的输入 Token 数。
        completion_tokens:
          type: integer
          description: |-
            输出 Token 数。
            - 视频任务 = 输出视频秒数折算；
            - H3-Context-IR 任务的输出 Token 数。
    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, content must include a non-empty text item
                (prompt is required) (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) 中查看。

````