---
title: "Query Task"
method: GET
path: "/v2/query/video_generation/{task_id}"
tags: ["Video V2"]
---

# Query Task

`GET /v2/query/video_generation/{task_id}`

## Request

- Base URL: `https://api.minimax.io`
- URL: `https://api.minimax.io/v2/query/video_generation/{task_id}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/minimax/apis/minimax-api/docs/v2/query/video_generation/:task_id/get.ts> (a function with typed inputs; its response is checked against the schema)

Query the status and result of a single video generation, H3-Context-IR, or video regeneration task. Once the task succeeds (`status=succeeded`), retrieve video output from `content.url` or an enhanced prompt from `content.prompt`.

> Only tasks from the last 7 days can be queried (window `[T-7d, T)`, where `T` is the request time as a UTC timestamp in seconds); a `task_id` outside this window returns `invalid task_id`. Video output URLs are time-limited, so download or store them promptly.

## Path parameters

- `task_id` string, required

## Response `200`

- GetVideoGenerationV2Resp
  - `task` VideoTask: Task object returned by the shared H3 task query and list endpoints.
    - `id` string: Task ID.
    - `model` string: Model name used by the task, e.g. `MiniMax-H3`.
    - `status` 'queued' | 'running' | 'succeeded' | 'failed' | 'cancelled': Task status: - `queued`: waiting in queue - `running`: in progress - `succeeded`: succeeded - `failed`: failed - `cancelled`: cancelled
    - `error` VideoTaskError
      - `code` string: Error code.
      - `message` string: Error message.
    - `created_at` integer: Unix timestamp (seconds) when the task was created.
    - `updated_at` integer: Unix timestamp (seconds) when the task status was last updated.
    - `content` VideoTaskContent
      - `url` string: Time-limited download URL of a video task output. Download or store it promptly; query again to obtain a new URL after it expires.
      - `prompt` string: Structured, enhanced video prompt generated by an H3-Context-IR task. Returned only when `task_type=h3_context_ir` and the task succeeds.
    - `resolution` string: Resolution of the task output.
    - `duration` integer: Duration of the task output (seconds).
    - `usage` VideoTaskUsage: Usage of this request. Video tasks return fields measured in seconds; H3-Context-IR tasks return Token-usage fields. Returned only when the task has succeeded.
      - `total_seconds` integer: Total metered seconds = input seconds + output seconds.
      - `input_seconds` integer: Input reference-video seconds (counted when a reference video is present).
      - `output_seconds` integer: Output video seconds.
      - `input_image_count` integer: Total number of input images (first_frame + last_frame + reference_image combined).
      - `input_audio_seconds` integer: Input reference-audio seconds (sum of segments, rounded); not returned when there is no reference audio.
      - `total_tokens` integer: Total tokens = prompt_tokens + completion_tokens. - Video tasks: converted from usage; - H3-Context-IR tasks: total tokens used by the task.
      - `prompt_tokens` integer: Input tokens. - Video tasks = input reference-video seconds + all input images + input reference-audio seconds, 0 when none; - H3-Context-IR tasks: input tokens of the task.
      - `completion_tokens` integer: Output tokens. - Video tasks = output video seconds converted; - H3-Context-IR tasks: output tokens of the task.
    - `ratio` string: Aspect ratio of the task output. This can be an empty string when it does not apply to the task type.
    - `task_type` 'generation' | 'h3_context_ir' | 'regeneration': Task type: - `generation`: video generation - `h3_context_ir`: H3-Context-IR (`/v2/h3_context_ir`) - `regeneration`: video regeneration (`/v2/video_regeneration`)
    - `modality` 'video' | 'text': Output modality. Video generation and video regeneration tasks return `video`; H3-Context-IR tasks return `text`.

## Other responses

- `400`: Invalid parameters
- `401`: Authentication failed
- `429`: Rate limit triggered
- `500`: Server error

---

[API](https://skmtc.dev/minimax/apis/minimax-api.md) - [All operations](https://skmtc.dev/minimax/apis/minimax-api/llms.txt) - [OpenAPI document](https://skmtc.dev/minimax/apis/minimax-api/revisions/81353c47e0e6?raw)
