> ## 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.

# Vidu 任务状态查询

> 使用 `GET /v1/videos/{task_id}` 查询 Vidu 视频任务状态与结果。

# Vidu 任务状态查询

Vidu 系列任务提交后,通过 `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": "viduq3-pro",
    "status": "processing",
    "progress": 50,
    "created_at": 1712697600,
    "size": "1024x1808",
    "seconds": "5",
    "quality": "standard"
  }
  ```

  ```json 200 - 已完成 theme={null}
  {
    "id": "video_123",
    "object": "video",
    "model": "viduq3-pro",
    "status": "completed",
    "progress": 100,
    "created_at": 1712697600,
    "completed_at": 1712697700,
    "size": "1024x1808",
    "seconds": "5",
    "quality": "standard",
    "video_url": "https://example.com/video/output.mp4"
  }
  ```

  ```json 200 - 失败 theme={null}
  {
    "id": "video_123",
    "object": "video",
    "model": "viduq3-pro",
    "status": "failed",
    "progress": 0,
    "created_at": 1712697600,
    "completed_at": 1712697650,
    "size": "1024x1808",
    "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="size" type="string">
  视频尺寸,例如 `1024x1808`。
</ResponseField>

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

<ResponseField name="quality" type="string">
  视频质量,例如 `standard`。
</ResponseField>

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

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

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

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

## 相关接口

* [Vidu 视频概览](./overview)
* [Vidu 视频生成](./vidu-generation)
