# Quickstart

In this quickstart, you'll create an AI-powered phone line that can make and receive calls. By the end, you'll have a working phone number connected to your AI agent.

What you'll learn:

* Create your KrosAI account and API key
* Purchase a phone number
* Connect an AI endpoint (ElevenLabs, Vapi, or custom)
* Make your first inbound and outbound calls

### Prerequisites

Before you begin, you'll need:

* A KrosAI account ([sign up free](https://cockpit.krosai.com))
* An AI voice provider account (ElevenLabs, Vapi, or Retell)
* A phone to test calls

{% stepper %}
{% step %}

#### Step 1: Create your account

<figure><img src="/files/UVjY9DWUA6DMLwc0inFF" alt=""><figcaption></figcaption></figure>

* Go to [cockpit.krosai.com](https://cockpit.krosai.com/)
* Sign up with email or Google
* Complete KYC verification (required for phone numbers) - takes \~2 minutes

{% hint style="info" %}
KYC verification is required by telecom regulations before purchasing phone numbers. We use Sumsub for secure identity verification.
{% endhint %}
{% endstep %}

{% step %}

#### Step 2: Create an API key

<figure><img src="/files/kdfUg0u4uO5LrG8N5z3u" alt=""><figcaption></figcaption></figure>

**Using the Dashboard**

* Navigate to **Developers** → **API Keys**
* Click **Create API Key**
* Name it (e.g., "My First Key")
* Select scopes:
  * `numbers:read` - View phone numbers
  * `numbers:write` - Purchase/configure numbers
  * `calls:read` - View call logs
  * `calls:write` - Make outbound calls
* Click **Create**
* **Copy and save your key** - it's only shown once!

Your API key will look like: `kros_live_abc123...`
{% endstep %}

{% step %}

#### Step 3: Purchase a phone number

{% tabs %}
{% tab title="TypeScript" %}

```typescript
 const response = await fetch('https://api.krosai.com/v1/phone-numbers', {
  method: 'POST',
  headers: {
    'x-api-key': 'kros_live_your_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    inventory_id: 'inv_ng_12345', // From GET /phone-numbers/available
  }),
});

const { number, id } = await response.json();
console.log('Purchased:', number); // +2348012345678
```

{% endtab %}

{% tab title="Python" %}

```python
import requests

response = requests.post(
    'https://api.krosai.com/v1/phone-numbers',
    headers={
        'x-api-key': 'kros_live_your_key_here',
        'Content-Type': 'application/json',
    },
    json={
        'inventory_id': 'inv_ng_12345',
    }
)

data = response.json()
print(f"Purchased: {data['number']}")
```

{% endtab %}

{% tab title="cURL" %}

```bash
curl -X POST "https://api.krosai.com/v1/phone-numbers" \
  -H "x-api-key: kros_live_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{"inventory_id": "inv_ng_12345"}'
```

{% endtab %}

{% tab title="Dashboard" %}

<figure><img src="/files/t8eTniMREM5ueudu9RuU" alt=""><figcaption></figcaption></figure>

* Navigate to **Phone Numbers** → **Buy Number**
* Select your country (e.g., Nigeria, Kenya, UAE)
* Choose a number from the available inventory
* Click **Purchase**
  {% endtab %}
  {% endtabs %}
  {% endstep %}

{% step %}

#### Connect AI Agent Providers

<figure><img src="/files/9wXPc5le6dD3Yo05kuc5" alt=""><figcaption></figcaption></figure>
{% endstep %}

{% step %}

#### Step 4: Create an endpoint

An endpoint defines where inbound calls are routed—typically your AI voice agent.

{% tabs %}
{% tab title="Vapi" %}

```typescript
// Create a Vapi endpoint:
const response = await fetch('https://api.krosai.com/v1/endpoints', {
  method: 'POST',
  headers: {
    'x-api-key': 'kros_live_your_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'My Support Agent',
    type: 'agent',
    url: 'sip:assistant@sip.vapi.ai', // Or your provider's SIP URI
    provider_config: {
      provider: 'vapi',
      assistant_id: 'asst_abc123',
    },
  }),
});

const { id: endpointId } = await response.json();
```

{% endtab %}

{% tab title="ElevenLabs" %}

```typescript
// Create an ElevenLabs endpoint:
const response = await fetch('https://api.krosai.com/v1/endpoints', {
  method: 'POST',
  headers: {
    'x-api-key': 'kros_live_your_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    name: 'ElevenLabs Agent',
    type: 'agent',
    url: 'sip:agent@sip.rtc.elevenlabs.io',
    provider_config: {
      provider: 'elevenlabs',
      agent_id: 'your-agent-id',
    },
  }),
});
```

{% endtab %}

{% tab title="Dashboard" %}

<figure><img src="/files/GezpRdUs2kCRGHX6PQCi" alt=""><figcaption></figcaption></figure>

1. Navigate to **Endpoints** → **Create Endpoint**
2. Select your provider:
   * **ElevenLabs** - Enter Agent ID
   * **Vapi** - Enter Assistant ID
   * **Retell** - Enter Agent ID
   * **Webhook** - Enter your server URL
3. Click **Create**
   {% endtab %}
   {% endtabs %}
   {% endstep %}

{% step %}

#### Step 5: Attach endpoint to phone number

{% tabs %}
{% tab title="TypeScript" %}

```typescript
await fetch(`https://api.krosai.com/v1/phone-numbers/${phoneNumberId}`, {
  method: 'PATCH',
  headers: {
    'x-api-key': 'kros_live_your_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    endpoint_id: endpointId,
    allow_inbound: true,
    allow_outbound: true,
  }),
});
```

{% endtab %}

{% tab title="Dashboard" %}

<figure><img src="/files/C7TtTjDY4Uv6tLxfRNV6" alt=""><figcaption></figcaption></figure>

* Go to **Phone Numbers** → Select your number
* In the **Routing** section, select your endpoint
* Enable **Allow Inbound Calls**
* Click **Save**
  {% endtab %}
  {% endtabs %}
  {% endstep %}

{% step %}

#### Step 6: Make your first call

**Test inbound call**

Call your new phone number from any phone. Your AI agent will answer:

📞 Call: +234 801 234 5678 ↓ 🤖 Your AI agent answers and starts the conversation

**Make an outbound call**

{% tabs %}
{% tab title="TypeScript" %}

```typescript
const response = await fetch('https://api.krosai.com/v1/outbound-calls', {
  method: 'POST',
  headers: {
    'x-api-key': 'kros_live_your_key_here',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({
    from_number: '+2348012345678', // Your KrosAI number
    to_number: '+14155551234',      // Destination phone
    endpoint_id: endpointId,        // Your AI agent
  }),
});

const { call_id, status } = await response.json();
console.log('Call initiated:', call_id);
```

{% endtab %}

{% tab title="Python" %}

```python
response = requests.post(
    'https://api.krosai.com/v1/outbound-calls',
    headers={
        'x-api-key': 'kros_live_your_key_here',
        'Content-Type': 'application/json',
    },
    json={
        'from_number': '+2348012345678',
        'to_number': '+14155551234',
        'endpoint_id': endpoint_id,
    }
)

data = response.json()
print(f"Call initiated: {data['call_id']}")
```

{% endtab %}
{% endtabs %}

#### Using the Playground

The KrosAI Dashboard includes a **Playground** for testing calls without code:

* Go to **Playground** in the dashboard
* Select your phone number
* Enter a destination number
* Click **Call**
* Watch real-time call events and transcription
  {% endstep %}
  {% endstepper %}

#### 🎉 Congratulations!

You've successfully:

* ✅ Created a KrosAI account
* ✅ Purchased a phone number
* ✅ Connected an AI agent
* ✅ Made your first call

### Next steps

#### Deep dive into integrations

* [ElevenLabs Integration Guide](/integration/elevenlabs.md) - Voice cloning and natural conversations
* [Vapi Integration Guide](/integration/vapi.md) - Structured workflows and tool calling
* [Retell Integration Guide](/integration/retell.md) - Low-latency enterprise deployments


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.krosai.com/getting-started/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
