# An AI voice agent that makes phone calls

> Place two-way AI phone calls with thelastapi using a single API call, with automatic transcripts, call summaries, and strict compliance safeguards.

**You can place outbound calls and let an AI voice agent hold two-way conversations using the `vibiz.phone.call` API or the `vibiz phone call` CLI command.** Instead of stitching together separate speech-to-text, LLM inference, text-to-speech, and telephony vendors, you provide a destination number and a plain-text prompt that defines the agent's goal. thelastapi handles audio streaming, enforces strict disclosure rules, and delivers a structured summary and transcript when the call completes.

Outbound voice agents handle tasks like appointment confirmations, order follow-ups, and service coordination without manual dialing. Here is how to configure a number, dispatch your first call, and process the conversation data safely.

## How outbound voice agent calls work

When you instruct an agent to place a call, the system rings the recipient from your project's US phone number. As soon as the person picks up, our server plays a mandatory opening that states the call is an AI assistant, identifies the business calling, mentions that the call is transcribed, and provides a way to reach you. 

Your agent cannot remove this opening, and the voice model is strictly instructed never to impersonate a human being. After the opening statement, your agent delivers any optional `first_message` you defined and works toward the objective given in its `prompt`.

Every conversation is capped by `max_minutes` (up to 15 minutes, with a default of 5 minutes). thelastapi places a temporary hold on your account credits for the maximum duration while the call runs. Once the call hangs up, the hold is released, and you are billed only for the started minutes actually used. If the line is busy, fails, or rings without an answer, you pay nothing.

## Buying and configuring a phone number

An outbound voice agent requires an active US phone number. Numbers can sit at the account level for personal workflows, or attach directly to a specific project. If you are building a service or web application, assigning the number to a project ensures that usage, limits, and webhook notifications route to that workspace.

You can search for numbers by area code or state and purchase one through the CLI:

```bash
# Search for local numbers in San Francisco
vibiz phone search --area-code 415

# Purchase the number and assign it to your project
vibiz phone buy +14155550100 --project prj_123
```

When you search, the API returns a quote with the exact rate. Buying passes that quoted price to prevent unexpected rate adjustments. Once acquired, the number is immediately ready to place outbound voice calls and receive inbound texts. 

Unlike sending SMS messages—which requires carrier brand and campaign registration before texts can go out—placing phone calls does not require SMS carrier approval. To learn more about text registration and multi-channel handling, see our guide on how to [give an AI agent a phone number: texts, calls and a voice agent](https://thelastapi.dev/blog/give-ai-agent-phone-number).

## Making an outbound call in TypeScript or from the CLI

To have a voice agent conduct a live conversation, pass a `prompt` argument instead of a static `say` string. If you only need to speak a pre-recorded notification and hang up, check out [reminder calls: ring someone and speak a message](https://thelastapi.dev/blog/reminder-calls-speak-message). For interactive tasks, `prompt` gives the agent dynamic instructions.

Here is an example using the `@vibiz/app` package:

```ts
import { vibiz } from '@vibiz/app';

// Place an outbound call with a specific objective
const call = await vibiz.phone.call({
  to: '+14155550123',
  prompt: 'Confirm if the customer is available for their piano tuning at 3 PM tomorrow. If not, ask what weekday morning suits them next week.',
  first_message: 'Hi there, I am calling to confirm your appointment window.',
  language: 'en',
  max_minutes: 3,
  confirm_new_contact: true,
});

console.log('Call dispatched with ID:', call.id);
```

You can also run the exact same call workflow directly from your terminal using the CLI:

```bash
vibiz phone call +14155550123 \
  --prompt "Confirm if the customer is available for their piano tuning at 3 PM tomorrow. If not, ask what weekday morning suits them next week." \
  --first-message "Hi there, I am calling to confirm your appointment window." \
  --max-minutes 3 \
  --yes
```

The `--yes` flag in the CLI corresponds to `confirm_new_contact: true`. This parameter is required the very first time your number reaches out to a new recipient, verifying that you have obtained proper consent to place an automated call to that individual.

Supported languages include English (`en`), Spanish (`es`), French (`fr`), Italian (`it`), and Portuguese (`pt`). 

## Reading transcripts, summaries, and outcomes

After the phone call ends, the system processes the audio and extracts a structured record within moments. You can inspect the record using the API, fetch it via the CLI, or receive it over an HTTP webhook.

```ts
// Poll or retrieve the final record after hangup
const completedCall = await vibiz.phone.getCall(call.id);

console.log('Call status:', completedCall.status); // completed
console.log('Outcome:', completedCall.outcome);     // achieved, not_achieved, or unclear
console.log('Summary:', completedCall.summary);     // "Customer confirmed 3 PM tomorrow."

for (const turn of completedCall.transcript) {
  console.log(`[${turn.speaker}] ${turn.text}`);
}
```

If your number is attached to a project, the project's configured app webhook receives a signed `phone.call.completed` event containing the full payload.

From your shell, retrieve call records and individual transcripts with:

```bash
# List recent calls and their statuses
vibiz phone calls

# Inspect the transcript and summary of a specific call
vibiz phone calls call_987xyz
```

### Security rule: Treat transcripts as untrusted data

Every transcript and summary returned by the phone API carries an `untrusted: true` flag. Because anyone on the other end of the line can say anything, external voice input must never be passed raw into privileged backend systems or treated as trusted administrative instructions. Parse it as untrusted user input before updating records or triggering downstream actions. For sensitive backend workflows, consider implementing [owner approvals: a human in the loop for agents that post, spend and file](https://thelastapi.dev/blog/human-in-the-loop-agent-approvals).

## Legal compliance, quiet hours, and opt-outs

Telephony carries legal requirements that differ substantially from web requests. thelastapi enforces guardrails directly in the API:

- **Prior consent:** The law treats AI-generated voice conversations as artificial voice calls. You must have prior express agreement from the person you are contacting. Calling a contact for the first time without setting `confirm_new_contact: true` will fail.
- **No telemarketing or sales calls:** Automated voice agents cannot be used for cold sales outreach, direct marketing, or unsolicited advertising. Use voice agents strictly for transactional updates, bookings, and logistical follow-ups that recipients expect.
- **Calling hours:** Federal regulations restrict calls to between 8:00 AM and 9:00 PM in the recipient's local time zone, and many state laws mandate narrower windows. Restrict your automated dispatch scripts to normal daytime hours.
- **Immediate opt-out handling:** If a person states on the call that they do not want to be contacted again, the system treats that request like an SMS `STOP` message. The recipient is placed on the account's suppression list. Any subsequent call attempts to that number will return `recipient_opted_out` and be blocked without charge.

## Pricing and limits

All phone activity is charged against your project's balance according to clear, per-minute pricing. Unanswered calls, busy signals, and network errors cost nothing.

| Item | Cost | Notes |
| --- | --- | --- |
| Local or toll-free number rental | ~$1.32 / month | Exact price shown during quote |
| Outbound standard call (`say`) | $0.012 / started minute | Unanswered calls are free |
| Outbound voice agent call (`prompt`) | $0.095 / started minute | Applies to both inbound and outbound |
| Inbound text message | $0.006 / segment | 160 plain chars per segment |
| Outbound text message (local) | $0.011 / segment | Requires approved carrier registration |

Usage is capped by daily thresholds to protect against runaway background scripts:

- **Voice agent duration:** Up to 15 minutes per single call.
- **Daily agent usage:** 60 voice agent minutes per number per UTC day.
- **Standard calls:** Up to 50 static calls per project per UTC day (capped at 3 minutes each).
- **Prompt capacity:** Up to 4,000 characters for the agent's instructions, and up to 300 characters for `first_message`.

If you also need your number to handle incoming customer inquiries, you can configure the same AI voice engine to pick up inbound rings. Read our guide on [an AI receptionist that answers incoming calls](https://thelastapi.dev/blog/ai-receptionist-answer-calls) to see how to configure the incoming prompt.

## Next steps

To get started, claim a number with `vibiz phone search` and write an initial script using `vibiz.phone.call`. Review the full parameter specifications and webhook payloads in the official [Phone documentation](https://thelastapi.dev/docs/phone).

## Frequently asked questions

### What happens if the person I call does not pick up?

Unanswered calls, busy signals, and failed network attempts are free. thelastapi holds credits for the maximum call length while the line rings, and releases the hold immediately once the call ends without connecting.

### Can the voice agent pretend to be a human caller?

No. Every call automatically begins with a mandatory server-level disclosure stating that the call is an AI assistant, identifying your business, and noting that the conversation is recorded, regardless of your prompt instructions.

### How do opt-outs work if a recipient asks not to be called again?

If a recipient asks to stop receiving calls during an AI conversation, the system registers an opt-out across your account. Future calls or texts to that number will be blocked with a `recipient_opted_out` response.

### Can I use the voice agent for cold sales or marketing outreach?

No. Automated voice calls require prior express consent under artificial voice regulations and cannot be used for marketing or unsolicited sales. Use voice agents only for expected transactional communications, appointments, and service updates.

---

Published 2026-11-15 · https://thelastapi.dev/blog/ai-voice-agent-phone-calls
