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

# 查询 MiniMax H3 Context-IR 任务

> 查询提示词增强任务状态、增强结果和 token 用量。

使用创建接口返回的 `irtask_` 任务 ID 查询 Context-IR 任务。

```bash theme={null}
curl "https://{your-domain}/v1/videos/context-ir/irtask_16a77bfc435343ff98cf67d17f23336e" \
  -H "Authorization: Bearer $API_KEY"
```

建议每 5–10 秒查询一次。

## 成功响应

```json theme={null}
{
  "id": "irtask_16a77bfc435343ff98cf67d17f23336e",
  "object": "video.context_ir.task",
  "created": 1786099200,
  "created_at": 1786099200,
  "updated_at": 1786099231,
  "model": "minimax-h3",
  "status": "succeeded",
  "billing_status": "settled",
  "task_type": "h3_context_ir",
  "duration": 5,
  "ratio": "16:9",
  "content": {
    "prompt": "integrated_multimodal_description: [Shot 1] Cinematic wide shot..."
  },
  "usage": {
    "prompt_tokens": 5664,
    "completion_tokens": 3426,
    "total_tokens": 9090
  }
}
```

## 返回字段

| 字段                        | 说明                                               |
| ------------------------- | ------------------------------------------------ |
| `content.prompt`          | Context-IR 生成的结构化视频提示词。                          |
| `usage.prompt_tokens`     | 多模态上下文产生的输入 token。                               |
| `usage.completion_tokens` | 增强提示词产生的输出 token。                                |
| `usage.total_tokens`      | 输入与输出 token 总数。                                  |
| `billing_status`          | `frozen` 表示已冻结，`settled` 表示已结算，`refunded` 表示已退款。 |

Context-IR 分别按照输入和输出 token 单价结算。任务失败、取消或超时后，平台会释放对应冻结金额。

## 失败响应

任务本身执行失败时，查询接口仍返回 HTTP `200`，通过 `status=failed`、`billing_status=refunded` 和 `error` 判断结果：

```json theme={null}
{
  "id": "irtask_1aee13ca0e9246069efd7f1da57b82db",
  "object": "video.context_ir.task",
  "created": 1786169942,
  "created_at": 1786169942,
  "updated_at": 1786169954,
  "model": "minimax-h3",
  "status": "failed",
  "billing_status": "refunded",
  "task_type": "h3_context_ir",
  "duration": 4,
  "ratio": "adaptive",
  "error": {
    "code": "failed",
    "message": "content[3].audio_url: invalid param: audio format \".mpeg\" not allowed"
  }
}
```

如果任务 ID 不存在或不属于当前 API Key，接口返回 HTTP `404`，错误体结构为：

```json theme={null}
{
  "error": {
    "type": "task_not_found",
    "message": "task not found"
  }
}
```
