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

# Quickstart

> Make your first API call in under 5 minutes

# Quickstart

This guide will help you make your first API call to Voicy in just a few minutes.

## Prerequisites

* A Voicy account ([sign up here](https://app.voicy.co))
* An API key ([create one](/authentication#creating-api-keys))
* A phone number assigned to your account with an agent configured

## Step 1: Set Up Your Environment

Store your API key as an environment variable:

<CodeGroup>
  ```bash macOS/Linux theme={null}
  export VOICY_API_KEY="voicy_sk_live_your_key_here"
  ```

  ```powershell Windows theme={null}
  $env:VOICY_API_KEY = "voicy_sk_live_your_key_here"
  ```
</CodeGroup>

## Step 2: List Your Calls

Let's start by listing recent calls to verify your API key works:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.voicy.co/functions/v1/call-list \
    -H "Authorization: Bearer $VOICY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{"limit": 5}'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.voicy.co/functions/v1/call-list', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.VOICY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({ limit: 5 }),
  });

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

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      'https://api.voicy.co/functions/v1/call-list',
      headers={
          'Authorization': f'Bearer {os.environ["VOICY_API_KEY"]}',
          'Content-Type': 'application/json',
      },
      json={'limit': 5},
  )

  calls = response.json()
  print(calls)
  ```
</CodeGroup>

## Step 3: Make an Outbound Call

Now let's initiate an AI-powered phone call:

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.voicy.co/functions/v1/call-dial \
    -H "Authorization: Bearer $VOICY_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "from_number": "+15551234567",
      "to_number": "+15559876543",
      "vars_provided": {
        "customer_name": "John"
      }
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.voicy.co/functions/v1/call-dial', {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${process.env.VOICY_API_KEY}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      from_number: '+15551234567',
      to_number: '+15559876543',
      vars_provided: {
        customer_name: 'John',
      },
    }),
  });

  const call = await response.json();
  console.log(`Call initiated: ${call.call_id}`);
  ```

  ```python Python theme={null}
  import os
  import requests

  response = requests.post(
      'https://api.voicy.co/functions/v1/call-dial',
      headers={
          'Authorization': f'Bearer {os.environ["VOICY_API_KEY"]}',
          'Content-Type': 'application/json',
      },
      json={
          'from_number': '+15551234567',
          'to_number': '+15559876543',
          'vars_provided': {
              'customer_name': 'John',
          },
      },
  )

  call = response.json()
  print(f'Call initiated: {call["call_id"]}')
  ```
</CodeGroup>

<Note>
  Replace `+15551234567` with a phone number assigned to your account, and `+15559876543` with the destination number.
</Note>

## Step 4: Get Call Details

After the call completes, retrieve the full details including transcript:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.voicy.co/functions/v1/call-get/YOUR_CALL_ID \
    -H "Authorization: Bearer $VOICY_API_KEY"
  ```

  ```javascript JavaScript theme={null}
  const callId = 'YOUR_CALL_ID';
  const response = await fetch(`https://api.voicy.co/functions/v1/call-get/${callId}`, {
    headers: {
      'Authorization': `Bearer ${process.env.VOICY_API_KEY}`,
    },
  });

  const callDetails = await response.json();
  console.log('Transcript:', callDetails.transcript);
  console.log('Duration:', callDetails.duration_ms, 'ms');
  ```

  ```python Python theme={null}
  import os
  import requests

  call_id = 'YOUR_CALL_ID'
  response = requests.get(
      f'https://api.voicy.co/functions/v1/call-get/{call_id}',
      headers={
          'Authorization': f'Bearer {os.environ["VOICY_API_KEY"]}',
      },
  )

  call_details = response.json()
  print(f'Transcript: {call_details["transcript"]}')
  print(f'Duration: {call_details["duration_ms"]}ms')
  ```
</CodeGroup>

## What's Next?

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/api-reference/overview">
    Explore all available endpoints
  </Card>

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