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

# Quickstart

> Make your first Vinci API call and poll job status in 5 minutes (Python &amp; JavaScript).

## Prerequisites

* A Vinci account and API key from [Vinci Dashboard](https://app.tryvinci.com/dashboard/api)
* Balance with sufficient credits
* See full guide at [Getting Started](/docs/guides/getting-started)

<Note>
  Keep your API key secret. Do not expose keys in client-side code.
</Note>

## 1) Install dependencies

```bash title="Python" theme={"system"}
pip install requests
```

```bash title="JavaScript (Node 18+)" theme={"system"}
# No extra deps needed for fetch in Node 18+. For older versions, use node-fetch.
```

## 2) Create your first video (Text-to-Video)

<CodeGroup>
  ```curl cURL theme={"system"}
  curl -X POST "https://tryvinci.com/api/v1/generate/text-to-video" \
    -H "Authorization: Bearer sk-your-api-key-here" \
    -H "Content-Type: application/json" \
    -d '{
      "prompt": "A serene sunset over a calm lake",
      "duration_seconds": 5,
      "aspect_ratio": "16:9"
    }'
  ```

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

  API_KEY = "sk-your-api-key-here"
  url = "https://tryvinci.com/api/v1/generate/text-to-video"
  headers = {
      "Authorization": f"Bearer {API_KEY}",
      "Content-Type": "application/json"
  }
  data = {
      "prompt": "A serene sunset over a calm lake",
      "duration_seconds": 5,
      "aspect_ratio": "16:9"
  }

  resp = requests.post(url, headers=headers, json=data)
  resp.raise_for_status()
  result = resp.json()
  print(f"Request ID: {result['request_id']}")
  ```

  ```javascript text_to_video.js theme={"system"}
  const API_KEY = "sk-your-api-key-here";

  const response = await fetch("https://tryvinci.com/api/v1/generate/text-to-video", {
    method: "POST",
    headers: {
      "Authorization": `Bearer ${API_KEY}`,
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      prompt: "A serene sunset over a calm lake",
      duration_seconds: 5,
      aspect_ratio: "16:9",
    }),
  });

  if (!response.ok) throw new Error(`HTTP ${response.status}`);
  const result = await response.json();
  console.log(`Request ID: ${result.request_id}`);
  ```
</CodeGroup>

## 3) Poll job status

<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"
  status_url = f"https://tryvinci.com/api/v1/status/{request_id}"
  headers = {"Authorization": f"Bearer {API_KEY}"}

  while True:
      r = requests.get(status_url, headers=headers)
      r.raise_for_status()
      status = r.json()

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

      print(f"Status: {status['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 status = await r.json();

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

## Next steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/essentials/authentication">
    Learn how to properly authenticate your API requests.
  </Card>

  <Card title="Video Generation API" icon="video" href="/docs/api-reference/video-generation">
    Explore the full video generation API reference.
  </Card>

  <Card title="Billing & Usage" icon="credit-card" href="/docs/guides/billing-usage">
    Understand billing and monitor your usage.
  </Card>

  <Card title="Error Handling" icon="triangle-exclamation" href="/docs/guides/error-handling">
    Learn how to handle errors gracefully.
  </Card>
</CardGroup>
