Back to Blog
AI Agents Voice API Integration Tutorial Phone Number Setup Guide

How to Give Your AI Agent a Phone Number in Under 10 Minutes

May 18, 20268 min read

By Sameer Srivastava

Here's a question I get from developers building AI agents all the time: My agent can handle text, can it handle phone calls?

The short answer is yes. But most AI agents today are stuck in text-only mode. They can write code, answer questions, generate content — but they can't pick up a phone when a customer calls. That's a real gap that limits what your agent can do.

In this guide, I'll walk you through exactly how to give your AI agent a real phone number — one that can make outbound calls, receive inbound calls, and handle SMS. We'll use AgentLine as the telephony layer, and the whole process takes under 10 minutes. No telecom expertise required.

Why Would You Even Want This?

Text is great. But phone calls unlock something different:

  • Real-time support: Customers can call in and get immediate answers, no ticket queue
  • Accessibility: Not everyone wants to type. Some users just want to call
  • Alerts and notifications: Your agent can call you when something important happens
  • Higher conversion: Outbound call follow-ups after signups consistently outperform email

When we launched AgentLine, we talked to dozens of teams building AI agents. Almost all of them had hit the same wall — their agent could do everything in text, but couldn't handle a simple phone call.

Step 1: Get Your API Key

Go to agentline.cloud and sign up. You'll get an API key immediately. It starts with sk_live_. This key authenticates all your requests to the AgentLine API.

Step 2: Create Your Agent

An agent is the AI personality that handles calls. Create one with a single API call:

curl -X POST https://api.agentline.cloud/v1/agents -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"name": "My Agent", "voice_id": "female-2"}'

You'll get back an agent ID (starts with agt_). Save it.

Voice options: female-1 (professional), female-2 (warm), male-1 (deep). You can also use any Cartesia voice UUID.

Step 3: Buy a Phone Number

Your agent needs a number. Provision one:

curl -X POST https://api.agentline.cloud/v1/numbers -H "Authorization: Bearer YOUR_API_KEY" -H "Content-Type: application/json" -d '{"agent_id": "agt_YOUR_ID", "country": "US", "area_code": "313"}'

Cost: $2.00 one-time. Pick an area code that matches your business location. Numbers are US-only for now. You'll get a number back immediately — it can make and receive calls and texts right away.

Step 4: Write Your Prompt

This is where most people rush. Don't. The prompt determines how your agent sounds, thinks, and handles edge cases.

A good prompt includes: - Who the agent is (give it a name and personality) - What it should do (specific instructions for common scenarios) - What it should NOT do (boundaries are as important as instructions) - How to escalate (when to hand off to a human) - Example conversations (showing is better than telling)

Spend at least 30 minutes on this. Test it. Revise. Test again.

Step 5: Make Your First Call

Your agent is ready. Make a test call to yourself first. Make sure the voice sounds natural, latency is acceptable, and the agent responds appropriately. Then try it with a friend who'll give honest feedback.

Step 6: Set Up Event Polling

When someone calls your agent's number or a call completes, you need to know about it. AgentLine has an event mailbox system. Your agent should poll GET /v1/events periodically to pick up call completions, transcripts, and inbound SMS.

What This Unlocks

Once your agent has a phone number, you can handle inbound support calls 24/7, make outbound sales follow-ups, send and receive SMS, build no-code workflows that trigger calls, and create multi-step sequences.

Pricing

Calls cost $0.10 per minute, billed per second. Phone numbers are $2.00 one-time. No hidden fees, no minimum commitment. A typical support call costs $0.30-0.50. Compare that to the cost of a human handling the same call.

Next Steps

Start with a test call. Then think about the one use case that would make the biggest difference for your team right now — support, sales, scheduling, whatever it is. Build that first. Once it's working, expand from there.

Ready to give your AI agent a phone number?

Get Started