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

# 查询视频

> 查询视频任务。这次请求不计费。

返回与创建接口相同的任务信封。查询会固定回到创建该任务的平台。

<ParamField path="id" type="string" required>
  创建接口返回的公开任务 ID（`gen-...`）。
</ParamField>

<RequestExample>
  ```bash cURL theme={"dark"}
  curl https://api.pipellm.ai/v2/videos/gen-xxxxxxxx \
    -H "Authorization: Bearer $PIPELLM_API_KEY"
  ```

  ```python Python theme={"dark"}
  import os
  import requests

  response = requests.get(
      "https://api.pipellm.ai/v2/videos/gen-xxxxxxxx",
      headers={"Authorization": f"Bearer {os.environ['PIPELLM_API_KEY']}"},
  )
  print(response.json())
  ```
</RequestExample>

<ResponseExample>
  ```json theme={"dark"}
  {
    "id": "gen-xxxxxxxx",
    "object": "video",
    "model": "seedance-2-0-mini",
    "provider": "volcengine",
    "status": "completed",
    "progress": 100,
    "created_at": 1726400000,
    "updated_at": 1726400120,
    "completed_at": 1726400120,
    "outputs": [
      {
        "type": "video",
        "role": "result",
        "url": "https://example.com/output.mp4",
        "mime_type": "video/mp4",
        "duration": 4.0
      }
    ]
  }
  ```
</ResponseExample>

<ResponseField name="status" type="string">
  `queued`、`in_progress`、`completed`、`failed`、`cancelled` 或 `expired`。
</ResponseField>

<ResponseField name="progress" type="integer">
  可选的 0–100 进度。
</ResponseField>

<ResponseField name="outputs" type="array">
  任务完成后出现。时长在每个产物上，不在任务顶层。
</ResponseField>

<ResponseField name="error" type="object">
  `status` 为 `failed` 时出现，包含 `code` 和 `message`。
</ResponseField>

<ResponseField name="usage" type="object">
  可选的上游计量（`completion_tokens`、`total_tokens`）。客户账单使用创建时的报价，而不是这个对象。
</ResponseField>

任务不存在或不属于当前用户时返回 `404`。该路由不计费。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.