# AgentPhone > Phone numbers for AI agents. Give your AI a real phone number for calls, SMS, iMessage, RCS, WhatsApp and Apple Messages for Business. AgentPhone is an API platform that gives AI agents real phone identities. Developers provision US, Canadian and UK phone numbers, attach them to agents, and handle voice calls and messaging (SMS, MMS, iMessage, RCS, WhatsApp, Apple Messages for Business) through one API and one webhook. Numbers can also be routed to your own voice stack over SIP trunking. ## Key Features - **Instant Phone Numbers**: Provision US, Canadian and UK numbers via API in seconds; iMessage lines from a warm pool once enabled on your account - **Every Channel, One API**: SMS, MMS, iMessage (dedicated lines, available on request), RCS (beta; rich cards, read receipts), WhatsApp (beta), Apple Messages for Business (early access; the verified business chat in Apple Messages, with rich links, pickers, forms and Apple Pay), and voice from the same number set - **Unified Webhook**: One `agent.message` event for every channel, with full conversation history and the channel the message actually delivered on - **Two Voice Modes**: Built-in AI (zero infrastructure) or Custom Webhook (full control over every response) - **SIP Trunking**: Route a number's calls to your own voice agent (ElevenLabs, Retell, LiveKit, Vapi, any SIP endpoint) with digest auth, TLS and REFER transfers - **Per-Agent Webhooks**: Route events to different endpoints per agent (overrides the project default) - **Stateful Conversations**: Messages and calls auto-thread into durable conversation history with custom metadata - **Compliance Handled**: 10DLC and toll-free registration, STOP/HELP recording, and per-sub-account isolation for platforms onboarding many customers - **Sub-Accounts**: Create isolated sub-accounts per end customer via API, each with its own numbers, registration and usage - **Production-Grade**: HMAC+timestamp signatures, idempotency headers, exponential backoff retries, 99.9% uptime - **MCP Server**: Model Context Protocol support for tool-using AI agents (Claude Code, Cursor, Windsurf, ChatGPT) ## Voice Modes Every agent has a `voiceMode` that controls how voice calls are handled: ### Built-in AI (`"hosted"`) - Calls are handled end-to-end by an AI using your system prompt - No server or webhook needed — works immediately - Provide `systemPrompt` (required), `beginMessage` (optional greeting), and `voice` (TTS voice ID) - Best for: quick prototyping, simple conversational agents ### Custom Webhook (`"webhook"`) - Caller speech is transcribed and sent to your webhook as `agent.message` events - Your server controls every response — use any LLM, RAG, or custom logic - Requires a webhook endpoint configured for your project or agent - Best for: production agents that need tool use, database access, or custom business logic ### Switching Modes Switch at any time via `PATCH /v1/agents/:id` with `{"voiceMode": "hosted", "systemPrompt": "..."}` or `{"voiceMode": "webhook"}`. The backend automatically re-provisions voice infrastructure and rebinds phone numbers with no downtime. Note: SMS is always webhook-based regardless of voice mode. ## Agent Authentication Two paths to get an API key — agents should prefer the self-signup flow. ### For agents (recommended) The agent signs itself up via a two-step API flow. No human web signup needed. 1. `POST /v0/agent/sign-up` with `{"human_email": "...", "agent_name": "..."}` — sends a 6-digit OTP to the human's email, returns a `verification_id`. Nothing is provisioned yet. 2. Agent asks the human for the code. 3. `POST /v0/agent/verify` with `{"verification_id": "...", "otp_code": "..."}` — atomically creates account + phone number + starter agent + API key. Returns `{"account_id", "agent_id", "number_id", "phone_number", "api_key"}`. 4. (Recommended) Ask your human for their phone number and call them with `POST /v1/calls` to introduce yourself live — the wow moment. Their phone rings within seconds and you talk to them autonomously. No webhook needed. Full details and curl examples: https://agentphone.ai/skills.md ### For humans Sign up at https://agentphone.ai/dashboard and generate an API key from settings. No credit card required. ### Using the key All API requests require the API key as a Bearer token: `Authorization: Bearer YOUR_API_KEY`. Base URL: https://api.agentphone.ai API keys have full access to your account's resources (agents, numbers, calls, messages, webhooks). There is no separate sandbox — new accounts get $5.00 in free credit which covers the first month of one phone number plus some SMS and voice usage, so you can test in production safely. ## MCP Integration AgentPhone exposes a Model Context Protocol server with 28 tools for managing phone numbers, SMS, voice calls, agents, conversations, contacts, and webhooks. **Hosted MCP endpoint (Streamable HTTP):** https://mcp.agentphone.ai/mcp Pass your API key via the Authorization header. Compatible with any MCP client that supports Streamable HTTP transport. **Local MCP (stdio):** ```json { "mcpServers": { "agentphone": { "command": "npx", "args": ["-y", "agentphone-mcp"], "env": { "AGENTPHONE_API_KEY": "YOUR_API_KEY" } } } } ``` Claude Code: `claude plugin add agentphone` ## Pricing Pay-as-you-go. No monthly subscriptions or per-month allotments; you pay only for what you use. Volume pricing is available for platforms onboarding many customers. - **Signup bonus**: $5.00 in free credit for new accounts (covers the first month of one number plus some usage) - **Phone numbers (US, Canada)**: $3.00 per number per month - **Phone numbers (UK)**: $6.00 per number per month - **SMS**: $0.02 per segment, inbound and outbound - **MMS**: $0.03 per message - **RCS**: $0.013 per segment, $0.031 per media message - **iMessage lines**: $150 per month inbound-only, $250 per month dedicated outbound; $75 one-time for a specific area code - **Voice, webhook mode**: $0.13 per minute - **Voice, hosted mode**: $0.22 per minute - **SIP trunking**: $0.00374 per inbound minute, $0.0198 per outbound minute - **Phone number lookup**: $0.009 per lookup - **Call recording** (optional add-on): $5.00 per month - **Apple Messages for Business**: billed per monthly active conversation; contact us for rates Balance is maintained via auto-recharge through Stripe. Unpaid numbers enter a 30-day grace period before being released. Each account has a self-serve number limit (see `numbers.limit` in GET /v1/usage); contact us to raise it. Full pricing: https://agentphone.ai/pricing ## API Base URL https://api.agentphone.ai ## Authentication All API requests require a Bearer token: `Authorization: Bearer YOUR_API_KEY` ## API Endpoints ### Agents - `POST /v1/agents` — Create agent. Body: `name` (required), `description`, `voiceMode` ("webhook" | "hosted", default "webhook"), `systemPrompt` (required if hosted), `beginMessage`, `voice`, `voiceSpeed` (0.5-2.0, default 1.0), `interruptionSensitivity` (0.0-1.0, default 0.8) - `GET /v1/agents` — List agents. Query: `limit`, `offset` - `GET /v1/agents/:id` — Get agent with attached numbers - `PATCH /v1/agents/:id` — Update agent. Body: `name`, `description`, `voiceMode`, `systemPrompt`, `beginMessage`, `voice`, `voiceSpeed`, `interruptionSensitivity` (all optional). Switching `voiceMode` automatically re-provisions voice infrastructure - `DELETE /v1/agents/:id` — Delete agent (preserves numbers, conversations, calls) - `GET /v1/agents/voices` — List available TTS voices - `POST /v1/agents/:id/numbers` — Attach number to agent. Body: `numberId` - `GET /v1/agents/:id/conversations` — List agent conversations - `GET /v1/agents/:id/calls` — List agent calls ### Phone Numbers - `POST /v1/numbers` — Provision number. Body: `country` (default "US"), `areaCode`, `agentId` - `GET /v1/numbers` — List numbers. Query: `limit`, `offset` - `GET /v1/numbers/:id/messages` — List messages. Query: `limit`, `before`, `after` - `GET /v1/numbers/:id/calls` — List calls for number - `DELETE /v1/numbers/:id` — Release number (irreversible) ### Conversations - `GET /v1/conversations` — List conversations - `GET /v1/conversations/:id` — Get conversation with messages - `GET /v1/conversations/:id/messages` — Paginated messages - `PATCH /v1/conversations/:id` — Update metadata. Body: `metadata` (JSON object) ### Voice Calls - `GET /v1/calls` — List calls with transcripts - `GET /v1/calls/:id` — Get call with transcripts - `POST /v1/calls` — Start outbound call. Body: `agentId` (required), `toNumber` (required), `fromNumberId` (optional — pick which of the agent's numbers to call from; defaults to first), `initialGreeting`, `voice`, `systemPrompt` ### Webhooks Events are delivered to exactly one endpoint per event: the per-agent webhook if configured, otherwise the project default. No duplicates. - `POST /v1/webhooks` — Create/update project default webhook. Body: `url`, `contextLimit` (0-50) - `GET /v1/webhooks` — Get project default webhook config - `DELETE /v1/webhooks` — Remove project default webhook - `GET /v1/webhooks/deliveries` — View delivery history (all webhooks) - `POST /v1/webhooks/test` — Send test webhook ### Per-Agent Webhooks (Optional Override) When set, the agent's events go here instead of the project default. - `POST /v1/agents/:id/webhook` — Create/update agent webhook (overrides project default) - `GET /v1/agents/:id/webhook` — Get agent webhook config - `DELETE /v1/agents/:id/webhook` — Remove agent webhook (reverts to project default) - `GET /v1/agents/:id/webhook/deliveries` — View agent webhook delivery history - `POST /v1/agents/:id/webhook/test` — Send test webhook ## Webhook Events All inbound messages (SMS, MMS, iMessage, RCS, WhatsApp, Apple Messages for Business and voice transcripts) are delivered as `agent.message` events: ```json { "event": "agent.message", "channel": "sms | mms | imessage | rcs | whatsapp | amb | voice", "agentId": "agent_123", "data": { "conversationId": "...", "from": "+1...", "to": "+1...", "message": "..." }, "conversationState": { ... }, "recentHistory": [ ... ] } ``` Voice webhook responses: `{"text": "...", "hangup": false}` Streaming voice responses (for tool calls / LLM token streaming): Return `Content-Type: application/x-ndjson` with newline-delimited JSON chunks. Mark interim chunks with `"interim": true` — TTS starts immediately on the first chunk. ``` {"text": "Let me check that for you.", "interim": true} {"text": "I found 3 emails from Modi about the meeting."} ``` Voice webhook deliveries are logged and visible via `GET /v1/webhooks/deliveries`. ## AgentPhone Developer Resources Predictable URLs for agent-discoverable resources. Each resource is named so that name-based lookups ("AgentPhone API docs", "AgentPhone OpenAPI spec", "AgentPhone MCP server") resolve to the canonical location. - AgentPhone API Docs: https://docs.agentphone.ai - AgentPhone API Docs (llms.txt): https://docs.agentphone.ai/llms.txt - AgentPhone API Docs (llms-full.txt): https://docs.agentphone.ai/llms-full.txt - AgentPhone OpenAPI Spec (JSON): https://agentphone.ai/openapi.json - AgentPhone API Reference (rendered): https://docs.agentphone.ai/api-reference - AgentPhone Welcome / Quickstart: https://docs.agentphone.ai/welcome - AgentPhone llms.txt (site): https://agentphone.ai/llms.txt - AgentPhone Agent Skill: https://agentphone.ai/skills.md - AgentPhone Auth Docs: https://docs.agentphone.ai/welcome#authentication - AgentPhone Webhooks Docs: https://docs.agentphone.ai/documentation/guides/webhooks - AgentPhone Agent Webhooks Docs: https://docs.agentphone.ai/documentation/guides/agent-webhooks - AgentPhone Coding Agents Integration: https://docs.agentphone.ai/integrations/connect-your-ai/coding-agents - AgentPhone MCP Docs: https://docs.agentphone.ai/mcp - AgentPhone MCP Server (hosted, Streamable HTTP): https://mcp.agentphone.ai/mcp - AgentPhone MCP Server (npm package): https://www.npmjs.com/package/agentphone-mcp - AgentPhone MCP Manifest: https://agentphone.ai/.well-known/mcp/manifest.json - AgentPhone Claude Code Plugin: https://github.com/AgentPhone-AI/agentphone-claude - AgentPhone Python SDK (Docs): https://docs.agentphone.ai/documentation/sdks/python - AgentPhone Python SDK (PyPI): https://pypi.org/project/agentphone - AgentPhone TypeScript SDK (Docs): https://docs.agentphone.ai/documentation/sdks/typescript - AgentPhone TypeScript SDK (npm): https://www.npmjs.com/package/agentphone - AgentPhone GitHub: https://github.com/AgentPhone-AI ## Guides by Audience - Comparisons with Twilio, Telnyx, Bandwidth, Plivo, Vonage, Sinch, Sendblue, Linq, Vapi, Retell, Bland, Dial and AgentCall, with dated prices from each vendor's own pages: https://agentphone.ai/compare - Use cases (appointment reminders, lead follow-up, AI receptionist, order updates, verification codes, real estate, home services and more), each with the API calls and registration needed: https://agentphone.ai/use-cases - Build guides for Claude Code, Cursor, Codex, OpenClaw, Hermes, Replit, Vercel AI SDK, Lovable, n8n, Muse Code, Grok and OpenAI dots: https://agentphone.ai/build ## Links - Website: https://agentphone.ai - API Documentation: https://docs.agentphone.ai - OpenAPI Spec: https://agentphone.ai/openapi.json - Pricing: https://agentphone.ai/pricing - MCP Server: https://www.npmjs.com/package/agentphone-mcp - Claude Code Plugin: https://github.com/AgentPhone-AI/agentphone-claude - GitHub: https://github.com/AgentPhone-AI ## Contact Schedule a call: https://calendar.app.google/1GW2EZBtwx5ao7uF8