> ## 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}` 查询豆包视频任务状态与结果。

# 豆包任务状态查询

豆包系列任务提交后,通过 `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_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2 \
    -H "Authorization: Bearer YOUR_API_KEY"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/videos/video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
      headers={"Authorization": "Bearer YOUR_API_KEY"},
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const response = await fetch(
    "https://octopusx.ai/v1/videos/video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
      },
    }
  );

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

## 响应示例

<ResponseExample>
  ```json 200 - 处理中 theme={null}
  {
    "id": "video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
    "object": "video",
    "model": "doubao-seedance-1-5-pro_720p",
    "status": "processing",
    "progress": 50,
    "created_at": 1761635478,
    "seconds": "5",
    "size": "720x720"
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
    "object": "video",
    "model": "doubao-seedance-1-5-pro_720p",
    "status": "completed",
    "progress": 100,
    "created_at": 1761635478,
    "completed_at": 1761635600,
    "expires_at": 1761722000,
    "seconds": "5",
    "size": "720x720",
    "video_url": "https://example.com/video/output.mp4"
  }
  ```

  ```json 200 - 失败 theme={null}
  {
    "id": "video_bbfbc1d2-ab22-44ca-b9dd-bc16983acac2",
    "object": "video",
    "model": "doubao-seedance-1-5-pro_720p",
    "status": "failed",
    "progress": 0,
    "created_at": 1761635478,
    "completed_at": 1761635500,
    "expires_at": 1761721900,
    "seconds": "5",
    "size": "720x720",
    "error": {
      "message": "生成失败,请重试",
      "code": "GENERATION_FAILED"
    }
  }
  ```
</ResponseExample>

## 认证

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

## Path Parameters

<ParamField path="task_id" type="string" required>
  任务 ID,与生成接口返回的 `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">
  任务状态。可选值包括 `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="expires_at" type="integer">
  过期时间(Unix 时间戳)。
</ResponseField>

<ResponseField name="seconds" type="string">
  视频时长(秒)。
</ResponseField>

<ResponseField name="size" type="string">
  视频尺寸,例如 `720x720`。
</ResponseField>

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

<ResponseField name="remixed_from_video_id" type="string">
  混剪来源视频 ID(如果有)。
</ResponseField>

<ResponseField name="error" type="object">
  错误信息,仅在 `failed` 状态下返回。
</ResponseField>

<ResponseField name="error.message" type="string">
  错误消息。
</ResponseField>

<ResponseField name="error.code" type="string">
  错误代码。
</ResponseField>

## 相关接口

* [豆包视频概览](./overview)
* [豆包视频生成](./doubao-generation)
