# AI voice agent for customer service: build guide | APIFleet

> Build an AI voice agent for customer service: bind a phone number, pick realtime or cascading speech, add HTTP tools, set human transfer rules and test calls.

Canonical URL: https://apifleet.dev/blog/ai-voice-agent-customer-service
Last updated: 2026-11-11
Markdown Mirror URL: https://apifleet.dev/blog/ai-voice-agent-customer-service.md
LLM index: https://apifleet.dev/llms.txt
MCP discovery: https://apifleet.dev/.well-known/mcp.json

An AI voice agent for customer service answers or places phone calls, understands the caller, looks up live data through tools, completes routine requests and transfers to a human when needed. To build one: bind a carrier number, choose a realtime or cascading pipeline, write scoped instructions, attach HTTP tools, define escalation, test, then monitor.

APIFleet team · 11 November 2026 · 7 min read

## What a customer service voice agent does on a call

A support call has three jobs: understand what the caller wants, get a verified answer or complete an action, and close or escalate cleanly. The model handles the conversation. Your systems remain the source of truth for orders, accounts and appointments, and the agent reaches them through tools rather than through its own memory.

Map each call type to the tool it needs before you write any prompt. If a request has no tool, the honest behavior is to collect details for follow-up. APIFleet's runtime rules already say this: when no live business tools are attached, the assistant collects details instead of claiming an action succeeded, and it only reports success after a tool returns success.

Static facts such as opening hours, returns policy or delivery zones can live in knowledge documents attached to the assistant (plain text, up to 50 KiB per document and 200 KiB injected in total). Anything that changes per customer belongs in a tool.

Common support call types and the tool each one needs

| Call type | Tool or mechanism | Read or write | Safe fallback |
| --- | --- | --- | --- |
| Order status | HTTP tool, e.g. lookup\_order(order\_number) | Read | Take the order number and promise a follow-up |
| Appointment booking or change | HTTP tools for availability, then create or update | Read, then write | Collect preferred times for the team to confirm |
| Password or account reset | HTTP tool that sends a reset link to the email or phone already on file | Write | Never read secrets aloud; route to a human |
| Billing question | HTTP tool returning invoice status and amount due | Read | Collect the account reference and the question |
| Opening hours, policies | Knowledge document | Read | Say the answer is unknown and take a message |
| Escalation to a person | Built-in transfer\_call to a configured number | Call control | Collect name, callback number and reason |

## Seven steps to build the agent

The steps below use APIFleet's REST API at https://apifleet.dev with a workspace key sent as Authorization: Bearer. Most of these operations also have a matching MCP tool on https://apifleet.dev/mcp, so a coding agent can do the same work. Saving an assistant does not place a call, and binding a number does not buy one from a carrier.

A minimal assistant body looks like this: {"name": "Support line", "pipeline\_mode": "realtime", "instructions": "You handle order status and returns for Example Store; use lookup\_order for any order question and transfer billing disputes to a human", "first\_message": "Hi, you've reached Example Store support, how can I help?"}.

Keep the instructions about business scope. APIFleet already adds runtime rules for tool use, read-backs of exact values, unclear audio and closing the call.

1. Number and carrier: bind an existing number to the assistant with PUT /numbers/{number} and a body of {"assistant\_id": "ASSISTANT\_ID", "provider": "twilio"}. The provider can be telnyx, twilio, voximplant or voipcloud. Configure the carrier's voice webhook separately.
2. Model pipeline: set pipeline\_mode to realtime (OpenAI Realtime or Gemini Live speech-to-speech) or cascading (separate stt\_provider, llm\_model and tts\_provider).
3. Instructions and intents: list the call types the agent handles, the tool for each and what it must never promise. Add a first\_message and attach knowledge documents for static policies.
4. Tools: create HTTP tools with POST /tools (name, description, public HTTPS url, method, JSON Schema parameters, timeout\_ms from 500 to 30000) and attach them with PUT /assistants/{id}/tools.
5. Escalation: add the human destinations as the assistant's transfer numbers. Then write in the instructions exactly which requests must be transferred and which become a callback.
6. Testing: create simulation personas and scenarios with transcript evaluations, run them in chat mode first, then voice, then place real test calls over the carrier route.
7. Monitoring: register a webhook for call.ended, read GET /calls for transcripts, outcomes and costs, and replay failed calls as new simulation scenarios.

## Looking up orders and CRM data mid-call

When the model decides to use a tool, APIFleet sends your endpoint a JSON body of {call\_id, name, arguments, context, created\_at}. The request is signed with an X-APIFleet-Signature header (sha256 HMAC of the raw body with the tool's secret), and the secret is returned once when you create the tool. Verify the signature before you touch customer data.

The URL must be public HTTPS, because private network targets are rejected. The default timeout is 8 seconds, and responses over 1 MiB are rejected.

Return small, explicit JSON that the agent can say out loud, for example {"status": "shipped", "carrier": "UPS", "eta": "2026-11-14"}. Separate read tools from write tools.

A timeout on a write is an unknown result, not a failure, so reconcile it before you retry. The voice agent tools checklist covers this in detail.

Webhooks and MCP do different jobs from tools. Webhooks deliver events such as call.ended to your backend after the fact. They are signed, retried on 429 and 5xx responses, and may arrive more than once, so deduplicate them.

The MCP server at https://apifleet.dev/mcp lets developer tools and agents manage assistants, numbers and tools. During a live call, the agent reaches your CRM through attached HTTP tools.

## When and how to hand off to a human

Escalate when the caller asks for a person, when a tool fails twice, when the request is outside the listed intents, or when it involves disputes, cancellations with fees or anything regulated. APIFleet's runtime rule is direct: if the caller asks for a human, use transfer\_call when it is available, and otherwise collect their name, preferred phone number and a short callback reason.

transfer\_call is a built-in tool. It only appears on Telnyx and Twilio phone calls where the assistant has transfer numbers configured, and the model can only choose a destination from that list. The agent announces the transfer before it invokes the tool.

A successful result means the carrier accepted the transfer command, not that a person answered. In the current code, if the carrier never completes the transfer and the media stream stays open, the runtime returns the caller to the assistant. On Twilio the call is updated with new instructions, so do not assume that happens on every carrier.

The built-in transfer moves the call. It does not pass a written summary to the person who picks up.

If your human agents need context, add your own HTTP tool, such as create\_handoff\_note, that writes the caller's issue to your helpdesk. Have the agent call it before transfer\_call, so the human has a ticket ready when they answer.

1. List the escalation triggers in the instructions in plain language.
2. Configure one transfer number per queue (support, billing) and name the queues in the instructions.
3. Optionally call a handoff-note HTTP tool with the caller's issue and identifiers.
4. Announce the transfer, then invoke transfer\_call with one of the configured destinations.
5. Test both outcomes: a human who answers and a destination that does not.

## Realtime or cascading for support calls, and cost per minute

Realtime speech-to-speech models keep turn-taking natural and are simple to configure. Cascading pipelines let you choose each stage: transcription tuned for order numbers and names, a specific language model, and a brand voice from ElevenLabs, Cartesia, Azure Speech, Amazon Polly, Deepgram or others. The speech-to-speech models guide compares the realtime options.

APIFleet charges USD 0.03 per connected AI minute, billed per second, from a USD 10 prepaid top-up with no subscription. Model, speech and carrier usage are separate.

An illustrative 10-minute call with USD 0.04 per minute of provider usage and USD 0.01 per minute of carrier usage comes to USD 0.30 + 0.40 + 0.10 = USD 0.80, or USD 0.08 per minute. These rates are placeholders, not vendor quotes. Put your own rates into the cost calculator.

Pipeline choice for customer service calls

| Factor | Realtime (speech-to-speech) | Cascading (STT, LLM, TTS) |
| --- | --- | --- |
| Configuration | pipeline\_mode realtime with OpenAI or Gemini | pipeline\_mode cascading with stt\_provider, llm\_model, tts\_provider |
| Voice choice | Voices offered by the realtime model | Any supported TTS adapter and voice ID |
| Exact values (order numbers, emails) | Test read-backs carefully | Add STT keyterms and tune endpointing |
| Cost components | Platform fee + realtime audio usage + carrier | Platform fee + STT + LLM tokens + TTS + carrier |
| Good first fit | Short, conversational support lines | Brand voice, multilingual or detail-heavy calls |

![Customer service voice agent workflow showing model, tool calls and spoken responses](https://apifleet.dev/content/voice-agent-workflow.svg)

## Continue with a practical next step

- [Read call-data answers to developer questions from Reddit](https://apifleet.dev/reddit)
- [Design tool success, failure and timeout responses](https://apifleet.dev/blog/voice-agent-tools)
- [Test interruptions, tools and task completion](https://apifleet.dev/blog/test-voice-agents)
- [Break down voice agent costs per minute](https://apifleet.dev/blog/voice-agent-costs)
- [Estimate your support call cost](https://apifleet.dev/tools/voice-agent-cost-calculator)
- [Connect a Twilio number](https://apifleet.dev/integrations/twilio)
- [Configure HTTP tools for lookups and actions](https://apifleet.dev/integrations/http-tools)
- [Receive call.ended webhooks](https://apifleet.dev/integrations/webhooks)
- [Manage assistants over MCP](https://apifleet.dev/docs/mcp)
- [Compare realtime speech-to-speech models](https://apifleet.dev/blog/speech-to-speech-models)

## Frequently asked questions

### What does an AI voice agent for customer service do?

It answers or places phone calls, works out what the caller needs, uses tools to check orders, bookings or accounts in your systems, completes routine requests and transfers to a human or takes a callback request when it cannot help.

### How do I connect a voice agent to my existing phone number?

Bind the number to the assistant with PUT /numbers/{number}, choosing telnyx, twilio, voximplant or voipcloud as the provider. Then point the carrier's voice routing at APIFleet. Binding does not buy or port a number.

### Can the AI voice agent transfer callers to a human agent?

Yes, on Telnyx and Twilio calls. Configure transfer numbers on the assistant and the built-in transfer\_call tool becomes available. It is a call transfer; pass context to your helpdesk with your own HTTP tool before transferring.

### How much does an AI customer service voice agent cost per minute?

APIFleet's platform fee is USD 0.03 per connected minute, billed per second. Model, speech and carrier usage are added on top, so the total depends on the providers you choose. Use the cost calculator with your own rates.

### How do I test a support voice agent before going live?

Run simulation scenarios with transcript evaluations in chat mode, then voice mode, then real calls over your carrier. Cover tool timeouts, a caller asking for a human and unclear order numbers before moving traffic.

## Sources and evidence

- [APIFleet API documentation](https://apifleet.dev/docs) · observed 2026-11-11
- [APIFleet API and MCP reference](https://apifleet.dev/docs/api) · observed 2026-11-11
- [Twilio Media Streams documentation](https://www.twilio.com/docs/voice/media-streams) · observed 2026-11-11

Prepared with AI assistance and checked against the linked evidence. Examples are illustrative unless explicitly documented as measured results.

## Next on your reading list.

[Voice agent tools: a practical checklist](https://apifleet.dev/blog/voice-agent-tools)[Test the conversation, not just the happy path](https://apifleet.dev/blog/test-voice-agents)[What does a voice agent actually cost?](https://apifleet.dev/blog/voice-agent-costs)

## Related

- [APIFleet](https://apifleet.dev/)
- [Documentation](https://apifleet.dev/docs)
- [Pricing](https://apifleet.dev/pricing)
