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

# Query Task

> Use `GET /v1/video/query` to query the status and result of a Vidu unified video task.

# Query Task

After a Vidu unified video task is submitted, use `GET /v1/video/query` to query its progress and result. The query parameter uses `id`, whose value is the task ID returned by [Create Video](./unified-generation).

* The route entry is `GET /v1/video/query`.
* The task ID is passed in via the Query parameter `id`.
* The returned structure includes fields such as `status`, `progress`, and `video_url`.

## Method and Path

```http theme={null}
GET /v1/video/query?id={task_id}
```

## Request Example

<CodeGroup>
  ```bash theme={null}
  curl "https://octopusx.ai/v1/video/query?id=48038932-0ff5-4251-8b4b-7a76c09fd114" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/video/query",
      params={"id": "48038932-0ff5-4251-8b4b-7a76c09fd114"},
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```

  ```javascript theme={null}
  const params = new URLSearchParams({
    id: "48038932-0ff5-4251-8b4b-7a76c09fd114",
  });

  const response = await fetch(
    `https://octopusx.ai/v1/video/query?${params.toString()}`,
    {
      headers: {
        Authorization: "Bearer YOUR_API_KEY",
        Accept: "application/json",
      },
    }
  );

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

## Response Example

<ResponseExample>
  ```json 200 - Processing theme={null}
  {
    "id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
    "status": "processing",
    "progress": 50,
    "created_at": 1774494511
  }
  ```

  ```json 200 - Completed theme={null}
  {
    "id": "48038932-0ff5-4251-8b4b-7a76c09fd114",
    "status": "completed",
    "progress": 100,
    "created_at": 1774494511,
    "completed_at": 1774494622,
    "video_url": "https://example.com/video/aigcVideoGenFile.mp4"
  }
  ```
</ResponseExample>

## Authentication

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

## Query Parameters

<ParamField query="id" type="string" required>
  Task ID, consistent with the `task_id` returned by the creation interface.
</ParamField>

## Response

<ResponseField name="id" type="string">
  Task ID.
</ResponseField>

<ResponseField name="status" type="string">
  Task status; common values include `processing`, `failed`, and `completed`.
</ResponseField>

<ResponseField name="progress" type="integer">
  Progress percentage (0-100).
</ResponseField>

<ResponseField name="created_at" type="integer">
  Creation time (Unix timestamp).
</ResponseField>

<ResponseField name="completed_at" type="integer">
  Completion time (Unix timestamp), returned only when the task is completed.
</ResponseField>

<ResponseField name="video_url" type="string">
  Video download URL, returned only when the status is `completed`.
</ResponseField>

## Related APIs

* [Vidu Video Overview](./overview)
* [Create Video](./unified-generation)
* [Vidu Query Task (Official Format)](./query)
