Setup Guide
OpenClaw + Twilio — Give Your AI Agent Outbound SMS & Notifications
OpenClaw's native messaging channels are Telegram, Discord, WhatsApp, WeChat, Slack, and web chat. SMS is not a built-in inbound channel — but your OpenClaw agent can send outbound SMS messages (alerts, reminders, 2FA codes, notifications) by calling Twilio's Programmable Messaging API through a custom skill. This guide walks you through the full setup.
What Is Twilio?
Twilio is a cloud communications platform (CPaaS) that lets applications send and receive SMS, MMS, voice calls, and more via REST APIs. Its Programmable Messaging API lets you POST to a single endpoint to deliver an SMS to supported phone numbers across the countries Twilio covers — as long as your Twilio account has a provisioned SMS-capable phone number, sufficient credit, and the destination is permitted (Twilio applies country, carrier, and trial-account restrictions).
Twilio charges per message plus a monthly fee for the phone number. Carrier fees vary by destination country. Deliverability and pricing in mainland China are limited and significantly more expensive than in the US or EU — Twilio is most useful for international SMS notifications.
How OpenClaw + Twilio Works
There are two different ways to put your agent on SMS, and this guide covers the simpler one. Pick deliberately:
- Outbound notifications, described on this page. The agent sends SMS through a Twilio skill. Nothing to expose, nothing for Twilio to reach, and it takes minutes.
- Two-way SMS as a real chat channel, where someone texts your number and the agent replies in the thread. Both OpenClaw and Hermes support this — OpenClaw through the official SMS plugin, Hermes through its Twilio SMS channel. It needs an inbound webhook that Twilio can reach over public HTTPS, so it is more setup than what follows here. Contact support if that is what you want and we will help wire it up.
The rest of this guide is the outbound pattern, where SMS acts as a notification channel rather than a conversation:
- Your bot lives on Telegram, Discord, WhatsApp, or another native channel and converses with users there.
- When the agent decides it needs to send an SMS — an alert, a reminder, a one-time code — it calls your Twilio skill, which POSTs to the Twilio Messages API.
- The recipient receives the SMS on their phone. With this outbound-only setup they cannot reply back into the agent by text — that is what the two-way SMS channel above is for, and it needs the inbound webhook this guide does not cover.
This pattern is perfect for: server-down alerts, appointment reminders, daily digests sent to a phone, 2FA or verification codes, and any “fire and forget” notification.
Step 1: Create a Twilio Account and Get a Phone Number
- Go to twilio.com and sign up for an account. New accounts receive a trial credit to test with.
- From your Twilio Console, navigate to Phone Numbers → Manage → Buy a number.
- Search for an SMS-capable number in your target country (US numbers are cheapest and have wide deliverability). Purchase it — monthly rental is typically a few dollars.
- Note down your Twilio phone number (in E.164 format, e.g.
+15551234567).
Step 2: Get Your Account SID and Auth Token
- In the Twilio Console, go to the Dashboard (or Account → General Settings).
- Copy your Account SID (starts with
AC) and your Auth Token. Treat the Auth Token like a password — do not expose it in public repositories or logs.
Step 3: Add a Twilio Skill to Your OpenClaw Agent
OpenClaw agents call external HTTP APIs through skills. You need to create a skill (or install a compatible one from ClawHub) that POSTs to the Twilio Messages API endpoint:
POST https://api.twilio.com/2010-04-01/Accounts/YOUR_ACCOUNT_SID/Messages.jsonThe request uses HTTP Basic Auth with your Account SID as the username and Auth Token as the password. The POST body (form-encoded) needs three fields:
From=+15551234567 # your Twilio number
To=+1XXXXXXXXXX # recipient's number in E.164 format
Body=Your message here # the SMS textAdd your Account SID, Auth Token, and Twilio phone number to your agent's skill configuration so the skill can authenticate without exposing credentials in the conversation:
{
"skills": {
"twilio-sms": {
"accountSid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
"authToken": "your_auth_token_here",
"fromNumber": "+15551234567"
}
}
}You can also supply these as environment variables in your OpenClaw instance configuration on OpenClaw Launch, keeping credentials out of the JSON config file entirely.
Step 4: Tell Your Agent When to Send SMS
Give your OpenClaw agent clear instructions about when it should fire an SMS. Add a note to your agent's system prompt, for example:
When the user asks you to send them a reminder or alert via SMS,
use the twilio-sms skill to send the message to their phone number.
Always confirm the phone number with the user before sending.
Note that SMS is for outbound notifications only — users cannot
reply to you via SMS; they should message you here on Telegram.With this instruction, a user can say “remind me at 3pm via SMS that I have a meeting” and your agent will schedule and send the SMS without any extra code.
Step 5: Test the Integration
- Message your OpenClaw bot on Telegram (or whichever native channel you use): “Send an SMS to +1XXXXXXXXXX saying: test from my AI agent”
- Your agent calls the twilio-sms skill, which POSTs to Twilio's API.
- Within seconds, the target number receives the SMS.
- Check the Twilio Console under Monitor → Messaging → Logs to confirm delivery status.
If the SMS does not arrive, check the Twilio logs for error codes. Common issues: trial accounts can only send to verified numbers; the recipient number must be in E.164 format; some country routes require additional carrier approval.
Use Cases
Outbound Alerts and Monitoring
Have your agent monitor a service or data feed and text you when something needs attention — price thresholds crossed, system errors, form submissions. The agent stays silent until the trigger fires, then sends one SMS.
Scheduled Reminders
Users can ask the agent to remind them at a specific time via SMS. The agent handles the scheduling; Twilio handles the delivery. No separate reminder app needed.
2FA and Verification Codes
If you are building an app that your OpenClaw agent helps manage, you can use the Twilio skill to send one-time verification codes. For production 2FA at scale, Twilio also offers a dedicated Verify API — the same Account SID and Auth Token applies; you would adjust the skill to call that endpoint instead.
Digest Reports
Have your agent compile a daily or weekly summary and send it as an SMS. Keep the message short to stay within carrier length limits (160 characters for a single SMS segment; longer messages are split into multiple segments and billed accordingly).
SMS vs Native Channels: What to Expect
| SMS via Twilio skill | Telegram / Discord (native) | WhatsApp (native) | |
|---|---|---|---|
| Direction | Outbound only (via this guide) | Full two-way conversation | Full two-way conversation |
| Setup complexity | Twilio account + skill config | Bot token + one-click connect | QR scan + one-click connect |
| Cost per message | Twilio per-message + carrier fees | Free (included in OpenClaw plan) | Free (included in OpenClaw plan) |
| No app required | Yes — broad reach to supported numbers | Requires Telegram/Discord app | Requires WhatsApp |
| China mainland delivery | Limited, expensive | Blocked (Telegram/Discord) | Available |
| Best for | One-way alerts to supported numbers | Conversations, communities | Conversations, support |
A Note on Costs
Twilio bills you separately for message delivery — this is in addition to your OpenClaw Launch subscription. Costs depend on the destination country and message volume. Check the Twilio pricing page for current rates. For high-volume sending, Twilio offers Messaging Services with sender pool management and better deliverability.
Mainland China SMS via Twilio is limited in availability and significantly more expensive than US/EU routes. If your primary audience is in China, consider whether the WeChat native channel (built into OpenClaw) better serves your notification needs.
Troubleshooting
Authentication Errors (401)
Double-check that your Account SID starts with AC and that your Auth Token is copied exactly from the Twilio Console. Auth Tokens can be regenerated in the Console — if yours was rotated, update the skill config.
Trial Account Restrictions
Twilio trial accounts can only send SMS to verified phone numbers. Verify test numbers in the Twilio Console under Phone Numbers → Verified Caller IDs, or upgrade to a paid account to send to other eligible numbers.
Message Not Delivered
Check the Twilio Console message logs for error codes. Common causes: recipient number in wrong format (must be E.164 with country code), destination country not supported by your Twilio number, or carrier filtering. For US sending, ensure your number is registered for 10DLC if required by US carriers.
Skill Not Firing
If the agent does not call the Twilio skill when expected, check that your system prompt includes clear instructions for when to use it. You can also prompt the agent explicitly: “Use your twilio-sms skill to send the following SMS to +1XXXXXXXXXX: ...”
Deploy on OpenClaw Launch
On OpenClaw Launch, you configure your agent's skills and environment variables through the Dashboard. Add your Twilio credentials as secure environment variables (they are encrypted at rest), then add the twilio-sms skill definition. No server management needed — OpenClaw Launch runs your agent 24/7 in a managed Docker container.
First month from $3, then Lite at $6/mo or Pro at $20/mo. Your Telegram, Discord, or WhatsApp channel is included in the plan; Twilio SMS costs are billed separately by Twilio based on your usage.
Frequently Asked Questions
Can my OpenClaw agent receive inbound SMS replies?
Not with the setup described here. This guide covers outbound SMS only — your agent sends notifications; users cannot reply back into the agent via SMS. Inbound SMS handling requires configuring a Twilio webhook that forwards incoming messages to a public endpoint, which is a different setup with its own page: two-way SMS. Telegram, WhatsApp and Discord remain the easiest two-way channels, since they need no public webhook at all.
Is SMS a built-in OpenClaw channel?
Not as a one-click connection, but yes as a channel. The platforms you connect from the dashboard in a couple of clicks are Telegram, Discord, WhatsApp, WeChat, Slack and web chat. SMS is supported through the official SMS plugin, which registers an inbound webhook so people can text your Twilio number and the agent replies in the thread — that needs a webhook Twilio can reach, so it is more setup than the outbound pattern on this page. The Twilio integration described here is outbound-only: your agent calls Twilio's API via a custom skill to send messages, and recipients cannot reply into it.
Does Twilio work in China?
Twilio can send SMS to Chinese mainland numbers, but availability is limited and per-message costs are significantly higher than US or EU routes. For audiences primarily in mainland China, the WeChat channel (a native OpenClaw channel) is a better fit for notifications.
Do I need a Twilio paid account?
A Twilio trial account works for testing, but trial accounts can only send to verified numbers and include a trial watermark message. For production use — sending to real users — you need to upgrade to a paid Twilio account and purchase a phone number. Monthly number rental is typically a few dollars, and you pay per message sent.
What's Next?
- Browse ClawHub skills — thousands of skills including HTTP, scheduling, and notification patterns
- MCP tools for OpenClaw — another way to extend your agent with external APIs
- Telegram channel setup — the most popular native conversation channel
- Discord channel setup — for communities and team servers
- See pricing — Deploy your agent starting at $3/month