> ## Documentation Index
> Fetch the complete documentation index at: https://doc.deepwl.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# MiniMax-H3 官方格式查询任务

> 使用 `GET /v1/video/generations/{task_id}` 查询 MiniMax-H3 官方格式视频任务状态与结果。

# MiniMax-H3 官方格式查询任务

根据 [创建视频（官方格式）](./official-generation) 返回的 `task_id` 查询任务状态、进度与结果视频地址。

## 方法与路径

```http theme={null}
GET /v1/video/generations/{task_id}
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl https://zx1.deepwl.net/v1/video/generations/424010985738629 \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://zx1.deepwl.net/v1/video/generations/424010985738629",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```
</CodeGroup>

## 响应示例

<ResponseExample>
  ```json 200 - 进行中 theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "424010985738629",
      "status": "IN_PROGRESS",
      "progress": "50%",
      "submit_time": 1785125529,
      "start_time": 1785125530,
      "finish_time": 0,
      "data": {
        "status": "running",
        "duration": 5,
        "resolution": "2K",
        "ratio": "16:9",
        "content": {},
        "usage": {}
      }
    }
  }
  ```

  ```json 200 - 成功 theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "424010985738629",
      "status": "SUCCESS",
      "progress": "100%",
      "submit_time": 1785125529,
      "start_time": 1785125530,
      "finish_time": 1785125946,
      "data": {
        "status": "succeeded",
        "duration": 5,
        "resolution": "2K",
        "ratio": "16:9",
        "content": {
          "video_url": "https://your-cdn.example.com/h3-generated-2k-output.mp4"
        },
        "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
        }
      }
    }
  }
  ```

  ```json 200 - 失败 theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "424010985738629",
      "status": "FAILURE",
      "progress": "100%",
      "submit_time": 1785125529,
      "start_time": 1785125530,
      "finish_time": 1785125800,
      "fail_reason": "video description contains sensitive content (1026)",
      "data": {
        "status": "failed",
        "duration": 5,
        "resolution": "2K",
        "ratio": "16:9",
        "content": {},
        "usage": {}
      }
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "NotFound",
      "message": "task not found",
      "type": "new_api_error"
    }
  }
  ```
</ResponseExample>

## 认证

```http theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="task_id" type="string" required>
  视频生成任务 ID，与创建接口返回的 `task_id` 一致。
</ParamField>

## Response

<ResponseField name="code" type="string">
  响应码，成功时为 `success`。
</ResponseField>

<ResponseField name="data.task_id" type="string">
  任务 ID。
</ResponseField>

<ResponseField name="data.status" type="string">
  网关任务状态：`SUBMITTED`（已提交）、`IN_PROGRESS`（生成中）、`SUCCESS`（成功）、`FAILURE`（失败）。
</ResponseField>

<ResponseField name="data.progress" type="string">
  进度字符串，例如 `50%`、`100%`。
</ResponseField>

<ResponseField name="data.submit_time" type="integer">
  任务提交时间，Unix 时间戳（秒）。
</ResponseField>

<ResponseField name="data.start_time" type="integer">
  任务开始时间，Unix 时间戳（秒）。
</ResponseField>

<ResponseField name="data.finish_time" type="integer">
  任务结束时间，Unix 时间戳（秒）；未结束时为 `0`。
</ResponseField>

<ResponseField name="data.fail_reason" type="string">
  失败原因，仅 `status=FAILURE` 时出现。
</ResponseField>

<ResponseField name="data.data.status" type="string">
  上游原生状态：`queued`（排队中）、`running`（运行中）、`succeeded`（成功）、`failed`（失败）、`cancelled`（已取消）。
</ResponseField>

<ResponseField name="data.data.duration" type="integer">
  生成视频时长（秒）。
</ResponseField>

<ResponseField name="data.data.resolution" type="string">
  输出分辨率，如 `2K`。
</ResponseField>

<ResponseField name="data.data.ratio" type="string">
  画面比例，如 `16:9`。
</ResponseField>

<ResponseField name="data.data.content.video_url" type="string">
  生成的视频 URL（限时有效的临时签名链接，请及时下载或转存）。
</ResponseField>

<ResponseField name="data.data.usage" type="object">
  用量统计。包含 `total_seconds`（总时长）、`input_seconds`（输入时长）、`output_seconds`（输出时长）、`input_image_count`（输入图片数）、`input_audio_seconds`（输入音频时长）、`total_tokens`、`prompt_tokens`、`completion_tokens`。
</ResponseField>

<ResponseField name="error" type="object">
  错误对象（仅在请求失败时返回），包含 `code`、`message` 与 `type`。
</ResponseField>

## 相关接口

* [MiniMax-H3 视频概览](./overview)
* [官方格式创建视频](./official-generation)
* [任务查询（OpenAI 格式）](./query)
* [查询任务（统一格式）](./unified-query)
