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

# manxue-2.0 查询视频任务

> 使用 `GET /v1/videos/{id}` 查询 manxue-2.0 视频任务状态。

# manxue-2.0 查询视频任务

这个接口用于查询 `manxue-2.0` 异步视频任务状态。创建任务接口返回 `id` 后，可通过该接口轮询状态并读取结果地址。

* 根据创建任务返回的 `id` 查询。
* 任务完成后读取 `video_url`。
* 任务失败时读取 `error`。
* 常见状态为 `queued`、`in_progress`、`completed`、`failed`。

## 方法与路径

```http theme={null}
GET /v1/videos/{id}
```

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET https://www.geeknow.top/v1/videos/task_01jz8s3dbke8p9vq2m8r9a7gk4 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python Python theme={null}
  import requests

  task_id = "task_01jz8s3dbke8p9vq2m8r9a7gk4"

  resp = requests.get(
      f"https://www.geeknow.top/v1/videos/{task_id}",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      timeout=30,
  )

  print(resp.json())
  ```

  ```javascript JavaScript theme={null}
  const taskId = "task_01jz8s3dbke8p9vq2m8r9a7gk4";

  const response = await fetch(`https://www.geeknow.top/v1/videos/${taskId}`, {
    method: "GET",
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
  });

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

## 响应示例

<ResponseExample>
  ```json 200 - 任务处理中 theme={null}
  {
    "id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
    "object": "video",
    "created": 1790557800,
    "model": "manxue-2.0",
    "status": "in_progress"
  }
  ```

  ```json 200 - 任务完成 theme={null}
  {
    "id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
    "object": "video",
    "created": 1790557800,
    "model": "manxue-2.0",
    "status": "completed",
    "video_url": "https://example.com/results/manxue-video.mp4",
    "actualDuration": 8,
    "totalTokens": 1200
  }
  ```

  ```json 200 - 任务失败 theme={null}
  {
    "id": "task_01jz8s3dbke8p9vq2m8r9a7gk4",
    "object": "video",
    "created": 1790557800,
    "model": "manxue-2.0",
    "status": "failed",
    "error": "task failed"
  }
  ```

  ```json 404 - 任务不存在 theme={null}
  {
    "error": {
      "message": "Task not found",
      "type": "invalid_request_error"
    }
  }
  ```
</ResponseExample>

## 认证

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

## Path Parameters

<ParamField path="id" type="string" required>
  视频任务 ID。创建视频任务接口返回的 `id`，例如 `task_01jz8s3dbke8p9vq2m8r9a7gk4`。
</ParamField>

## Response

<ResponseField name="object" type="string">
  对象类型，通常为 `video`。
</ResponseField>

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

<ResponseField name="status" type="string">
  任务状态。支持 `queued`、`in_progress`、`completed`、`failed`。
</ResponseField>

<ResponseField name="created" type="integer">
  创建时间戳。
</ResponseField>

<ResponseField name="model" type="string">
  任务使用的模型名称。
</ResponseField>

<ResponseField name="video_url" type="string">
  任务完成时返回的视频 URL。
</ResponseField>

<ResponseField name="actualDuration" type="integer">
  实际生成的视频时长。上游返回该字段时透出。
</ResponseField>

<ResponseField name="totalTokens" type="integer">
  任务计费用量。上游返回该字段时透出。
</ResponseField>

<ResponseField name="error" type="string">
  任务失败原因。
</ResponseField>

## 状态映射

| 上游状态                                 | 返回状态          |
| ------------------------------------ | ------------- |
| `pending`、`queued`                   | `queued`      |
| `processing`、`running`、`in_progress` | `in_progress` |
| `succeeded`、`completed`              | `completed`   |
| `failed`、`cancelled`                 | `failed`      |

## 下载视频内容

如果查询结果没有直接返回可访问的 `video_url`，可以使用内容下载端点：

```http theme={null}
GET /v1/videos/{id}/content
```

## 注意事项

* 查询接口只读取任务状态，不会重新提交生成任务。
* `video_url` 只在任务完成且上游返回结果地址后出现。
* 轮询间隔建议保持数秒以上，避免过于频繁地查询同一个任务。

## 相关页面

* [特惠渠道系列概览](./overview)
* [manxue-2.0 创建视频任务](./generation)
