> ## 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/videos/{task_id}` 查询即梦视频任务状态与结果。

# 即梦任务状态查询

OpenAI 格式查询入口。若任务由 `POST /v1/video/create` 提交，请使用 [查询任务](./unified-query)。

即梦系列任务提交后，通过 `GET /v1/videos/{task_id}` 查询。

* 查询路径是 `GET /v1/videos/{task_id}`。
* 成功返回的是 OpenAI 风格 `video` 对象。
* 任务完成后可从 `video_url` 读取结果。

## 方法与路径

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

## 请求示例

<CodeGroup>
  ```bash theme={null}
  curl https://octopusx.ai/v1/videos/video_123 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/videos/video_123",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const response = await fetch("https://octopusx.ai/v1/videos/video_123", {
    headers: {
      Authorization: "Bearer YOUR_API_KEY",
    },
  });

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

## 响应示例

<ResponseExample>
  ```json 200 - 排队中 theme={null}
  {
    "id": "video_123",
    "object": "video",
    "model": "jimeng-video-3.0",
    "status": "queued",
    "progress": 0,
    "created_at": 1712697600,
    "video_url": ""
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "video_123",
    "object": "video",
    "model": "jimeng-video-3.0",
    "status": "completed",
    "progress": 100,
    "created_at": 1712697600,
    "completed_at": 1712697900,
    "video_url": "https://example.com/video/output.mp4"
  }
  ```
</ResponseExample>

## 认证

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

## Path Parameters

<ParamField body="task_id" type="string" required>
  视频任务 ID。
</ParamField>

## Response

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

<ResponseField name="object" type="string">
  固定为 `video`。
</ResponseField>

<ResponseField name="model" type="string">
  模型名称。
</ResponseField>

<ResponseField name="status" type="string">
  任务状态：`queued`、`processing`、`completed`、`failed`、`cancelled`。
</ResponseField>

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

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

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

<ResponseField name="video_url" type="string">
  视频结果地址（任务完成后返回）。
</ResponseField>

## 状态说明

| 状态           | 说明         |
| ------------ | ---------- |
| `queued`     | 任务已提交，排队中  |
| `processing` | 任务处理中      |
| `completed`  | 任务完成，可获取视频 |
| `failed`     | 任务失败       |
| `cancelled`  | 任务已取消      |

## 相关接口

* [即梦视频概览](./overview)
* [即梦视频生成](./generation)
* [查询任务（统一视频）](./unified-query)
