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

How to Give Your AI Agent a Phone Number (Step by Step)

Updated 8 min read

By Sameer Srivastava

To give your AI agent a phone number, sign up at AgentLine, create an agent, provision a US or Canada number with POST /v1/numbers, connect the relay or a webhook for incoming calls and texts, and place a test call. It takes about 10 minutes and no telecom account. The steps below show each API call.

If you run OpenClaw or Hermes Agent, the OpenClaw and Hermes phone number guide covers the skill-based setup for those frameworks. For what the product does overall, start at AgentLine.

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 al_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 (friendly), female-2 (reassuring), female-3 (guide), male-1 (supportive), male-2 (thinker), male-3 (helpful). 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: included in your plan; additional numbers are $3.00/month. Pick an area code that matches your business location. Numbers are US or Canada. You'll get a number back immediately — it can make and receive calls, and send and receive SMS, 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: Receive Events

When someone calls your agent's number, a call completes, or an inbound text arrives, you need to know about it. Install the persistent relay, or configure an HTTPS webhook, so those events arrive in real time. Polling GET /v1/events is only a non-live fallback.

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, and build no-code workflows that trigger calls, and create multi-step sequences.

Pricing

Plans from $20/month include a number and minutes. Beyond the plan, calls cost $0.12 per minute, per-second after a one-minute minimum, and additional phone numbers are $3.00/month. SMS beyond the plan allowance is $0.02 per message, sent or received. A three- to five-minute support call beyond the plan costs $0.36 to $0.60. The cost breakdown works through monthly examples. 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.

Frequently Asked Questions

How do I connect an AI agent to a phone number?

Create an agent on AgentLine, provision a US or Canada number for it, and connect the persistent relay or an HTTPS webhook so the agent receives calls and texts as events. The agent places calls with POST /v1/calls. Setup takes about 10 minutes and needs no Twilio account or WebSocket code.

Where can I set up a single phone number that triggers an AI agent?

At agentline.cloud. Create an agent, provision one number, and point inbound events at the relay or a webhook. That one number handles outbound calls, inbound calls and SMS in both directions, so every call or text to it reaches the same agent.

How do I give an AI agent a phone number without Twilio or WebSockets?

Use AgentLine's hosted voice agent and relay. AgentLine handles the carrier, speech-to-text, text-to-speech and call control, and your agent receives each caller turn as a text event and replies with text. You never open a media stream or manage audio yourself.

How long does it take to give an AI agent a phone number?

About 10 minutes: a few seconds to provision the number, and the rest to create the agent, write its prompt and connect events. Plan extra time to test the prompt with real callers before you give the number out.

Does the AI agent's number work for calls and texts?

Yes. Each AgentLine number makes and receives calls and sends and receives SMS. Plans start at $20/month with one number, 100 minutes and 400 texts; beyond that, calls are $0.12/minute and texts $0.02 each.

Templates for this use case

Clone a working agent instead of starting from a blank prompt — each template ships the system prompt, greeting, and Python/Node code. See all 34 templates.

AI Scheduling Agent

Call your agent to book time — it knows your rules

AI Inbound Support Agent

Triage, respond, escalate, follow up, close

Ready to give your AI agent a phone number?

Get Started Free

Or see pricing and docs.

Claude Duet Phone Number: Give Duet Calls and SMS With AgentLine (2026)

Claude Duet watches your inbox and calendar and messages you first, but it cannot pick up a phone. Here is how to give Duet a real US or...

How Much Does It Cost to Give an AI Agent a Phone Number?

What an AI agent's phone number really costs per month: plan prices, per-minute and per-text rates, worked examples from light use to...

Hark Phone Number: Give Hark AI Calls and SMS With AgentLine (2026)

Hark books tables and pays bills through websites, but its plans include no phone number. Here is how to give Hark a real US or Canada...