Voice and messaging
Twilio API for AI agents: send SMS, place calls and check phone numbers
How an agent sends SMS, places calls and validates numbers with Twilio, what each call returns and what it costs per message, minute and lookup.
Agents that book appointments, chase invoices or confirm deliveries eventually need to reach a phone. Twilio covers the three jobs that come up most: sending an SMS, placing a voice call, and checking whether a number is real and what kind of line it is before you spend money on it.
What Twilio returns
Sending an SMS creates a Message resource. The fields an agent cares about:
sid: the message ID, starting withSMorMMstatus:queued,sending,sent,delivered,undelivered,failedand a few others; the first response is usuallyqueued, so delivery has to be checked later or pushed to aStatusCallbackURLnum_segments: how many segments the body was split into, which is what you are billed onpriceandprice_unit: often empty at first, because the price is filled in after sendingerror_codeanderror_message: set when the status isfailedorundelivered
Placing a call creates a Call resource with a sid starting with CA, a status (queued, ringing, in-progress, completed, busy, failed, no-answer or canceled), a duration in seconds once the call ends, and answered_by (human or machine) if you turned on MachineDetection. What the call actually says is defined by TwiML, passed inline as Twiml or fetched from a Url.
Looking up a number with Lookup v2 returns valid, phone_number in E.164, national_format, country_code and calling_country_code, plus validation_errors when it fails. Add Fields=line_type_intelligence or Fields=caller_name to get the paid data packages.
How to call it from your agent
AMXP is in private preview, so this is how it works through AMXP once it opens. The agent finds the Twilio tool, reads its spec, then runs it with the same field names Twilio uses:
const [tool] = await amxp.discover({ query: "send an SMS", provider: "twilio" })
const spec = await amxp.inspect(tool.id) // params, price per call, examples
const run = await amxp.execute(tool.id, {
To: "+14155550123",
From: "+14155550100",
Body: "Reminder: your appointment is tomorrow at 10:00. Reply C to confirm.",
StatusCallback: "https://example.com/hooks/sms-status",
})
// run.output.sid, run.output.status ("queued"), run.output.num_segmentsA good habit for agents: run a basic Lookup on any number a user typed before texting or calling it. Basic validation is free and catches typos early.
For comparison, the direct call to Twilio's own API is a form-encoded POST to https://api.twilio.com/2010-04-01/Accounts/{AccountSid}/Messages.json with To, From (or MessagingServiceSid) and Body, authenticated with your Account SID and auth token.
What it costs
Twilio's US list prices, as of October 2026:
- SMS: $0.0083 per outbound SMS and $0.0083 per inbound SMS in the US on long codes, toll-free and short codes. Messages are charged per segment, so a long body billed as three segments costs three times as much. US carrier fees are added on top and vary by carrier.
- MMS: $0.022 per outbound MMS in the US.
- Voice: $0.0140 per minute to make calls and $0.0085 per minute to receive calls on a US local number; receiving on a toll-free number is $0.0220 per minute.
- Lookup: basic formatting and validation is free; line type intelligence is $0.008 per request and US caller name is $0.01 per request.
Worked example: 100 single-segment reminders in the US is 100 × $0.0083 = $0.83 before carrier fees. A line type check on each number first adds 100 × $0.008 = $0.80.
Through AMXP, inspect shows the price per call before the agent runs anything, and it is charged to your prepaid balance.
When to use something else
- You need a number of your own. Sending SMS needs a sender, and Twilio lists a US long code at $1.15 per month. If your agent sends from a fixed brand number, registered campaigns or high volume, your own Twilio account is the better choice. AMXP is for the gaps: occasional sends, prototypes, and agents that should not hold carrier credentials.
- You want the agent to hold a conversation on the call. Twilio places the call; something else has to listen and talk. Vapi, Retell AI and Bland AI run the voice agent, and Saperly handles phone calls for agents.
- You only need email. AgentMail gives agents their own inboxes.
- Price or coverage elsewhere. Telnyx and Plivo offer similar SMS and voice APIs and are worth comparing for your destination countries.
Common questions
Can an AI agent send SMS without a Twilio account?
Once AMXP opens, an agent will be able to call Twilio's messaging tool from its AMXP balance without its own Twilio credentials. Today you need your own Twilio account and a sending number.
Why is price empty in the response?
Twilio fills in price after the message is sent, so it can be blank in the first response. Fetch the message again later, or use a StatusCallback.
How do I check whether a number is a mobile before texting it?
Use Lookup v2 with Fields=line_type_intelligence. It costs $0.008 per request as of October 2026, while basic validation alone is free.
References
- Twilio SMS pricing in the United States, Twiliowww.twilio.com/en-us/sms/pricing/us
- Twilio Voice pricing in the United States, Twiliowww.twilio.com/en-us/voice/pricing/us
- Twilio Lookup pricing, Twiliowww.twilio.com/en-us/user-authentication-identity/pricing/lookup
- Message resource, Twiliowww.twilio.com/docs/messaging/api/message-resource
- Call resource, Twiliowww.twilio.com/docs/voice/api/call-resource
- Lookup v2 API, Twiliowww.twilio.com/docs/lookup/v2-api
Cite as: AMXP, “Twilio API for AI agents: send SMS, place calls and check phone numbers,” AMXP, October 31, 2026. https://amxp.ai/blog/twilio-api-for-ai-agents · Markdown version