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

# Status Checking

> Poll the status endpoint to track generation progress and retrieve results.

Generation is asynchronous. Use the status endpoint to check when your video is ready.

Related

* [Video generation](/docs/api-reference/video-generation)

```http title="Endpoint" theme={"system"}
GET /api/v1/status/{request_id}
```

```http title="Authentication" theme={"system"}
Authorization: Bearer sk-your-api-key-here
```

## Status responses

```json title="Pending" theme={"system"}
{
  "request_id": "req_abc123...",
  "status": "pending",
  "estimated_cost_usd": 0.25
}
```

```json title="Processing" theme={"system"}
{
  "request_id": "req_abc123...",
  "status": "processing",
  "estimated_cost_usd": 0.25,
  "progress": 45
}
```

```json title="Completed" theme={"system"}
{
  "request_id": "req_abc123...",
  "status": "completed",
  "video_url": "https://storage.googleapis.com/vinci-dev/videos/generated_video.mp4",
  "duration_seconds": 5.2,
  "cost_usd": 0.26
}
```

```json title="Failed" theme={"system"}
{
  "request_id": "req_abc123...",
  "status": "failed",
  "error": "Invalid prompt format"
}
```

## Code examples

<CodeGroup>
  ```curl cURL theme={"system"}
  curl -X GET "https://tryvinci.com/api/v1/status/your-request-id" \
    -H "Authorization: Bearer sk-your-api-key-here"
  ```

  ```python poll_status.py theme={"system"}
  import requests, time

  API_KEY = "sk-your-api-key-here"
  request_id = "your-request-id"
  url = f"https://tryvinci.com/api/v1/status/{request_id}"
  headers = {"Authorization": f"Bearer {API_KEY}"}

  while True:
      r = requests.get(url, headers=headers)
      r.raise_for_status()
      s = r.json()

      if s["status"] == "completed":
          print(f"Video ready: {s['video_url']}")
          break
      if s["status"] == "failed":
          print("Generation failed")
          break

      print(f"Status: {s['status']}")
      time.sleep(5)
  ```

  ```javascript poll_status.js theme={"system"}
  const API_KEY = "sk-your-api-key-here";
  const requestId = "your-request-id";

  async function checkStatus() {
    const r = await fetch(`https://tryvinci.com/api/v1/status/${requestId}`, {
      headers: { "Authorization": `Bearer ${API_KEY}` },
    });
    if (!r.ok) throw new Error(`HTTP ${r.status}`);
    const s = await r.json();

    if (s.status === "completed") {
      console.log(`Video ready: ${s.video_url}`);
      return;
    }
    if (s.status === "failed") {
      console.log("Generation failed");
      return;
    }
    console.log(`Status: ${s.status}`);
    setTimeout(checkStatus, 5000);
  }
  checkStatus();
  ```
</CodeGroup>
