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

# 查询任务

> 使用 `GET /v1/video/query` 查询即梦统一视频任务状态与结果。

# 查询任务

即梦统一视频任务提交后，通过 `GET /v1/video/query` 查询进度与结果。查询参数使用 `id`，值为 [创建视频](./unified-generation) 返回的任务 ID。

* 路由入口是 `GET /v1/video/query`。
* 任务 ID 通过 Query 参数 `id` 传入。
* 返回结构包含 `status`、`progress`、`video_url` 等字段。

## 方法与路径

```http theme={null}
GET /v1/video/query?id={task_id}
```

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl "https://octopusx.ai/v1/video/query?id=48038932-0ff5-4251-8b4b-7a76c09fd114" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/video/query",
      params={"id": "48038932-0ff5-4251-8b4b-7a76c09fd114"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const params = new URLSearchParams({
    id: "48038932-0ff5-4251-8b4b-7a76c09fd114",
  });

  const response = await fetch(
    `https://octopusx.ai/v1/video/query?${params.toString()}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        Accept: "application/json",
      },
    }
  );

  console.log(await response.json());
  ```
</CodeGroup>

## 响应示例

<ResponseExample>
  ```json 200 - 处理中 theme={null}
  {
    "id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
    "status": "processing",
    "progress": 50,
    "created_at": 1774494511
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
    "status": "completed",
    "progress": 100,
    "created_at": 1774494511,
    "completed_at": 1774494622,
    "video_url": "https://example.com/video/aigcVideoGenFile.mp4",
    "thumbnail_url": "https://example.com/thumbnail/thumb.png"
  }
  ```
</ResponseExample>

## 认证

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

## Query Parameters

<ParamField query="id" type="string" required>
  任务 ID，与创建接口返回的 `task_id` 一致。
</ParamField>

## Response

<ResponseField name="id" type="string">
  任务 ID。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态，常见值包括 `processing`、`failed`、`completed`。
</ResponseField>

<ResponseField name="progress" type="integer">
  进度百分比（0-100）。
</ResponseField>

<ResponseField name="created_at" type="integer">
  创建时间（Unix 时间戳）。
</ResponseField>

<ResponseField name="completed_at" type="integer">
  完成时间（Unix 时间戳），仅在任务完成时返回。
</ResponseField>

<ResponseField name="video_url" type="string">
  视频下载地址，仅在 `completed` 状态下返回。
</ResponseField>

<ResponseField name="thumbnail_url" type="string">
  缩略图地址，可选字段。
</ResponseField>

## 相关接口

* [即梦视频概览](./overview)
* [创建视频](./unified-generation)
* [即梦任务状态查询（OpenAI 格式）](./query)
