# Get Grok Video

Poll a public UnifyLLM task ID and check status and errors before downloading the completed video.

- Source: https://www.unifyllm.com/docs/api-reference/get-grok-video/
- Language: en

## Endpoint

```http
GET https://api.unifyllm.top/v1/videos/{task_id}
```

Use the authentication and headers shown in the request examples. 

## Polling and terminal states

- Poll every 5–10 seconds while queued or in_progress. Never submit another creation request to check progress.

- A timeout or network error does not prove creation failed. Do not automatically repeat a potentially paid POST when its outcome is unknown.

- Check error even when status=completed. moderation_blocked can mean that no playable video is available.

| Status | Action |
| --- | --- |
| queued | Task queued; continue polling |
| in_progress | Task running; continue polling |
| completed | Stop polling; inspect error before downloading |
| failed | Stop polling; inspect error.code and error.message |

## Download the result

The query response does not guarantee an upstream video URL. Download /v1/videos/{task_id}/content with the exact public task id returned by creation. Use your UnifyLLM API key for creation, queries and downloads; no supplier key is required.

## Parameters

| Field | Location | Type | Required | Description | Allowed values | Example |
| --- | --- | --- | --- | --- | --- | --- |
| task_id | path | string | yes | Exact public id returned by creation, including its task_ prefix. Never substitute a provider-internal ID. |  | task_example |

## Default

```json
{}
```

### cURL

```bash
curl --request GET \
  --url 'https://api.unifyllm.top/v1/videos/task_example' \
  --header 'Authorization: Bearer <YOUR_API_KEY>'
```

### JavaScript

```javascript
const response = await fetch("https://api.unifyllm.top/v1/videos/task_example", {
  method: "GET",
  headers: {
    "Authorization": "Bearer <YOUR_API_KEY>"
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

response = requests.get(
    "https://api.unifyllm.top/v1/videos/task_example",
    headers={"Authorization": "Bearer <YOUR_API_KEY>"}
)
response.raise_for_status()
print(response.json())
```

## Response examples

### Task In Progress — HTTP 200

```json
{
  "id": "task_example",
  "object": "video",
  "model": "grok-imagine-video-1.5",
  "status": "in_progress",
  "progress": 40
}
```

### Task Completed — HTTP 200

```json
{
  "id": "task_example",
  "object": "video",
  "model": "grok-imagine-video-1.5",
  "status": "completed",
  "progress": 100,
  "seconds": "3"
}
```

### Task Failed — HTTP 200

```json
{
  "id": "task_example",
  "object": "video",
  "model": "grok-imagine-video-1.5",
  "status": "failed",
  "error": {
    "code": "video_generation_failed",
    "message": "Video generation failed."
  }
}
```

## Related endpoints

- [Create Grok Video](https://www.unifyllm.com/docs/api-reference/create-grok-video/)
- [Download Grok Video](https://www.unifyllm.com/docs/api-reference/download-grok-video/)
