> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.levrage.ai/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.levrage.ai/_mcp/server.

# Quickstart

> Make your first Levrage.AI API call in 5 minutes

This guide walks you through creating your first voice agent and making a call — all from the command line.

## Prerequisites

* A Levrage.AI account ([sign up](https://studio.levrage.ai))
* Your API key (Dashboard → Settings → Developers → API Keys)
* A source phone number (available in Dashboard → Numbers)

## Step 1: Verify Your API Key

Test that your API key works:

**`cURL`**

```bash cURL
curl -H "Authorization: Bearer $API_KEY" \
     https://api.levrage.ai/v1/health
```

**`Python`**

```python Python
import requests

response = requests.get(
    "https://api.levrage.ai/v1/health",
    headers={"Authorization": f"Bearer {API_KEY}"}
)
print(response.json())
```

**`JavaScript`**

```javascript JavaScript
const response = await fetch("https://api.levrage.ai/v1/health", {
  headers: { "Authorization": `Bearer ${API_KEY}` }
});
console.log(await response.json());
```

Expected response:

```json
{
  "status": "ok"
}
```

## Step 2: Browse Available Industries

Discover what agent types are available:

**`cURL`**

```bash cURL
# List all industries
curl https://api.levrage.ai/v1/industries

# Get agent types for a specific industry
curl https://api.levrage.ai/v1/industries/Real%20Estate/agent-types
```

**`Python`**

```python Python
# List all industries
industries = requests.get(f"{BASE_URL}/industries").json()

# Get agent types for Real Estate
types = requests.get(f"{BASE_URL}/industries/Real%20Estate/agent-types").json()
```

**`JavaScript`**

```javascript JavaScript
// List all industries
const industries = await fetch(`${BASE_URL}/industries`).then(r => r.json());

// Get agent types for Real Estate
const types = await fetch(`${BASE_URL}/industries/Real%20Estate/agent-types`).then(r => r.json());
```

## Step 3: Create a Voice Agent

**`cURL`**

```bash cURL
curl -X POST https://api.levrage.ai/v1/agents \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Demo Sales Agent",
    "agent_type": "sales",
    "language": "English",
    "voice": "female",
    "ai_model": "lai-premium-2",
    "start_flow": "Hello! This is Sarah from Demo Corp. How are you today?",
    "end_flow": "Thank you so much for your time. Goodbye!",
    "description": "Sales agent for demo purposes"
  }'
```

**`Python`**

```python Python
agent = requests.post(
    f"{BASE_URL}/agents",
    headers=headers,
    json={
        "name": "Demo Sales Agent",
        "agent_type": "sales",
        "language": "English",
        "voice": "female",
        "ai_model": "lai-premium-2",
        "start_flow": "Hello! This is Sarah from Demo Corp. How are you today?",
        "end_flow": "Thank you so much for your time. Goodbye!",
        "description": "Sales agent for demo purposes"
    }
).json()

agent_id = agent["data"]["id"]
print(f"Agent created: {agent_id}")
```

**`JavaScript`**

```javascript JavaScript
const agent = await fetch(`${BASE_URL}/agents`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    name: "Demo Sales Agent",
    agent_type: "sales",
    language: "English",
    voice: "female",
    ai_model: "lai-premium-2",
    start_flow: "Hello! This is Sarah from Demo Corp. How are you today?",
    end_flow: "Thank you so much for your time. Goodbye!",
    description: "Sales agent for demo purposes"
  })
}).then(r => r.json());

const agentId = agent.data.id;
console.log(`Agent created: ${agentId}`);
```

Save the `id` from the response — you'll need it for the next step.

> **Tip**
>
> The agent is automatically created with a production-ready prompt based on the `agent_type` and `language` you chose. You can also pass a custom `prompt` field to override it.

## Step 4: Make a Call

**`cURL`**

```bash cURL
curl -X POST https://api.levrage.ai/v1/call \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "agent_id": "YOUR_AGENT_ID",
    "source_number": "+919240018601",
    "phone_number": "+919876543210",
    "metadata": {
      "customer_name": "John",
      "purpose": "demo"
    }
  }'
```

**`Python`**

```python Python
call = requests.post(
    f"{BASE_URL}/call",
    headers=headers,
    json={
        "agent_id": agent_id,
        "source_number": "+919240018601",
        "phone_number": "+919876543210",
        "metadata": {"customer_name": "John", "purpose": "demo"}
    }
).json()

print(f"Call initiated: {call['data']['id']}")
```

**`JavaScript`**

```javascript JavaScript
const call = await fetch(`${BASE_URL}/call`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    agent_id: agentId,
    source_number: "+919240018601",
    phone_number: "+919876543210",
    metadata: { customer_name: "John", purpose: "demo" }
  })
}).then(r => r.json());

console.log(`Call initiated: ${call.data.id}`);
```

The call will be initiated immediately. You can track its status via the call history endpoint.

## Step 5: Check Call History

**`cURL`**

```bash cURL
curl -H "Authorization: Bearer $API_KEY" \
     "https://api.levrage.ai/v1/calls?page=1&page_size=5"
```

**`Python`**

```python Python
calls = requests.get(
    f"{BASE_URL}/calls",
    headers=headers,
    params={"page": 1, "page_size": 5}
).json()

for call in calls["data"]:
    print(f"{call['phone_number']} — {call['status']} ({call.get('duration_seconds', 0)}s)")
```

**`JavaScript`**

```javascript JavaScript
const calls = await fetch(`${BASE_URL}/calls?page=1&page_size=5`, { headers })
  .then(r => r.json());

calls.data.forEach(call => {
  console.log(`${call.phone_number} — ${call.status} (${call.duration_seconds || 0}s)`);
});
```

Each call record includes:

* **status** — `completed`, `no_answer`, `failed`, `voicemail`
* **duration** — Call length in seconds
* **transcript** — Full conversation transcript
* **recording\_url** — Link to the call recording
* **sentiment** — AI-analyzed sentiment of the call
* **details\_collection** — Any data the agent collected

## Step 6: Run a Batch Campaign (Optional)

Scale to multiple calls with a campaign:

**`cURL`**

```bash cURL
curl -X POST https://api.levrage.ai/v1/campaigns \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "January Outreach",
    "agent_id": "YOUR_AGENT_ID",
    "phone_number": "+919240018601",
    "phone_column": "phone",
    "contacts": [
      {"phone": "+919876543210", "name": "Alice"},
      {"phone": "+919876543211", "name": "Bob"},
      {"phone": "+919876543212", "name": "Charlie"}
    ],
    "max_concurrent_calls": 2
  }'
```

**`Python`**

```python Python
campaign = requests.post(
    f"{BASE_URL}/campaigns",
    headers=headers,
    json={
        "name": "January Outreach",
        "agent_id": agent_id,
        "phone_number": "+919240018601",
        "phone_column": "phone",
        "contacts": [
            {"phone": "+919876543210", "name": "Alice"},
            {"phone": "+919876543211", "name": "Bob"},
            {"phone": "+919876543212", "name": "Charlie"}
        ],
        "max_concurrent_calls": 2
    }
).json()

print(f"Campaign created: {campaign['data']['id']}")
```

**`JavaScript`**

```javascript JavaScript
const campaign = await fetch(`${BASE_URL}/campaigns`, {
  method: "POST",
  headers,
  body: JSON.stringify({
    name: "January Outreach",
    agent_id: agentId,
    phone_number: "+919240018601",
    phone_column: "phone",
    contacts: [
      { phone: "+919876543210", name: "Alice" },
      { phone: "+919876543211", name: "Bob" },
      { phone: "+919876543212", name: "Charlie" }
    ],
    max_concurrent_calls: 2
  })
}).then(r => r.json());

console.log(`Campaign created: ${campaign.data.id}`);
```

## What's Next?

* [Agents Guide](/guides/agents) — Deep dive into agent configuration
* [Campaigns Guide](/guides/campaigns) — Advanced campaign features (scheduling, retries, blackouts)
* [Webhooks Guide](/guides/webhooks) — Get real-time notifications when calls end
* [Error Handling](/guides/error-handling) — Handle errors and retries like a pro
* [API Reference](/api-reference) — Full endpoint documentation