rocket-launchQuickstart

Create your first AI-powered phone line that can make and receive calls

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:

1

Step 1: Create your account

circle-info

KYC verification is required by telecom regulations before purchasing phone numbers. We use Sumsub for secure identity verification.

2

Step 2: Create an API key

Using the Dashboard

  • Navigate to DevelopersAPI 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...

3

Step 3: Purchase a phone number

 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
4

Connect AI Agent Providers

5

Step 4: Create an endpoint

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

// 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:[email protected]', // Or your provider's SIP URI
    provider_config: {
      provider: 'vapi',
      assistant_id: 'asst_abc123',
    },
  }),
});

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

Step 5: Attach endpoint to phone number

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,
  }),
});
7

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

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);

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

🎉 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

Last updated