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

# Task Status

> Query task status and results with the unified tasks API

## Get Task Status

Retrieve the current status and result of a generation task.

### Request

```http theme={null}
GET /api/v1/tasks/{id}
Authorization: Bearer river_live_xxx
```

### Response

<CodeGroup>
  ```json Succeeded theme={null}
  {
    "success": true,
    "data": {
      "id": "task_abc123",
      "type": "video",
      "status": "succeeded",
      "provider": "vidu",
      "model": "viduq3-turbo",
      "result": [
        {
          "url": "https://cdn.modelhunter.ai/results/task_abc123.mp4?signature=xxx",
          "duration": 4,
          "format": "mp4",
          "size_bytes": 12582912
        }
      ],
      "created_at": "2025-01-15T10:00:00Z",
      "completed_at": "2025-01-15T10:00:45Z"
    }
  }
  ```

  ```json Running theme={null}
  {
    "success": true,
    "data": {
      "id": "task_abc123",
      "type": "video",
      "status": "running",
      "provider": "vidu",
      "model": "viduq3-turbo",
      "created_at": "2025-01-15T10:00:00Z"
    }
  }
  ```

  ```json Failed theme={null}
  {
    "success": true,
    "data": {
      "id": "task_abc123",
      "type": "video",
      "status": "failed",
      "provider": "vidu",
      "model": "viduq3-turbo",
      "error": {
        "code": "PROVIDER_ERROR",
        "message": "Content moderation: prompt contains restricted content"
      },
      "created_at": "2025-01-15T10:00:00Z",
      "completed_at": "2025-01-15T10:00:10Z"
    }
  }
  ```
</CodeGroup>

### Status Values

| Status      | Description                   | `result` present?    |
| ----------- | ----------------------------- | -------------------- |
| `pending`   | Queued on ModelHunter.AI side | No                   |
| `queued`    | Sent to provider, waiting     | No                   |
| `running`   | Actively generating           | No                   |
| `succeeded` | Complete                      | Yes                  |
| `failed`    | Error occurred                | No (`error` present) |
| `cancelled` | Cancelled by user             | No                   |
| `expired`   | Result URL expired            | Re-fetch for new URL |

### Result Fields

When status is `succeeded`, the `result` field contains an **array** of output items. Each item has:

| Field        | Type     | Description                                      |
| ------------ | -------- | ------------------------------------------------ |
| `url`        | `string` | Signed URL for the output file (valid 15 min)    |
| `duration`   | `number` | Video/audio length in seconds (video/audio only) |
| `format`     | `string` | File format (`mp4`, `png`, `jpg`, `mp3`, etc.)   |
| `size_bytes` | `number` | File size in bytes                               |
