> ## 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/generations/{task_id}` to query the status and result of a Seedance 2.0 video generation task.

# Query Task

Query the task status, progress, and result video URL based on the `task_id` returned by [Create Video](./generation).

## Method and Path

```http theme={null}
GET /v1/video/generations/{task_id}
```

## Request Example

<CodeGroup>
  ```bash theme={null}
  curl https://octopusx.ai/v1/video/generations/cgt-20260412163502-x8k2m \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Accept: application/json"
  ```

  ```python theme={null}
  import requests

  resp = requests.get(
      "https://octopusx.ai/v1/video/generations/cgt-20260412163502-x8k2m",
      headers={
          "Authorization": "Bearer YOUR_API_KEY",
          "Accept": "application/json",
      },
      timeout=30,
  )
  print(resp.json())
  ```
</CodeGroup>

## Response Example

<ResponseExample>
  ```json 200 - In Progress theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "task_xxxxx",
      "status": "IN_PROGRESS",
      "progress": "50%",
      "submit_time": 1775908082,
      "start_time": 1775908086,
      "finish_time": 0,
      "data": {
        "status": "processing",
        "duration": 5,
        "resolution": "720p",
        "ratio": "16:9",
        "content": {},
        "usage": {}
      }
    }
  }
  ```

  ```json 200 - Success theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "task_xxxx",
      "status": "SUCCESS",
      "progress": "100%",
      "submit_time": 1775908082,
      "start_time": 1775908086,
      "finish_time": 1775908321,
      "data": {
        "status": "succeeded",
        "duration": 5,
        "resolution": "720p",
        "ratio": "16:9",
        "content": {
          "video_url": "https://example.com/output.mp4"
        },
        "usage": {
          "completion_tokens": 108900,
          "total_tokens": 108900
        }
      }
    }
  }
  ```

  ```json 200 - Failure theme={null}
  {
    "code": "success",
    "data": {
      "task_id": "task_xxxx",
      "status": "FAILURE",
      "progress": "100%",
      "submit_time": 1775908082,
      "start_time": 1775908086,
      "finish_time": 1775908200,
      "fail_reason": "Content safety check failed",
      "data": {
        "status": "failed",
        "duration": 5,
        "resolution": "720p",
        "ratio": "16:9",
        "content": {},
        "usage": {}
      }
    }
  }
  ```

  ```json 404 theme={null}
  {
    "error": {
      "code": "NotFound",
      "message": "task not found",
      "type": "new_api_error"
    }
  }
  ```
</ResponseExample>

## Authentication

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

## Path Parameters

<ParamField path="task_id" type="string" required>
  Video generation task ID, consistent with the `task_id` returned by the creation endpoint.
</ParamField>

## Response

<ResponseField name="code" type="string">
  Response code, `success` on success.
</ResponseField>

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

<ResponseField name="data.status" type="string">
  Task status: `SUBMITTED`, `IN_PROGRESS`, `SUCCESS`, `FAILURE`.
</ResponseField>

<ResponseField name="data.progress" type="string">
  Progress string, such as `50%` or `100%`.
</ResponseField>

<ResponseField name="data.fail_reason" type="string">
  Reason for failure, present only when `status=FAILURE`.
</ResponseField>

<ResponseField name="data.data.status" type="string">
  Upstream native status: `queued`, `pending`, `processing`, `succeeded`, `failed`.
</ResponseField>

<ResponseField name="data.data.content.video_url" type="string">
  Generated video URL (usually a temporary signed link, valid for about 12 hours by default).
</ResponseField>

<ResponseField name="data.data.usage.total_tokens" type="integer">
  Token usage related to billing.
</ResponseField>

## Related Pages

* [Seedance-2 Overview](./overview)
* [Create Video](./generation)
