← Home

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

OpenClaw agents can call any external HTTP API through skills (ClawHub has 3,200+) and MCP tools. SMS is wired in as an outbound notification channel, not a native conversation channel:

  • 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. They do not reply back into OpenClaw via SMS — that would require an inbound webhook setup outside the scope of this guide.

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

  1. Go to twilio.com and sign up for an account. New accounts receive a trial credit to test with.
  2. From your Twilio Console, navigate to Phone Numbers → Manage → Buy a number.
  3. 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.
  4. Note down your Twilio phone number (in E.164 format, e.g. +15551234567).

Step 2: Get Your Account SID and Auth Token

  1. In the Twilio Console, go to the Dashboard (or Account → General Settings).
  2. 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.json

The 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 text

Add 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

  1. Message your OpenClaw bot on Telegram (or whichever native channel you use): “Send an SMS to +1XXXXXXXXXX saying: test from my AI agent”
  2. Your agent calls the twilio-sms skill, which POSTs to Twilio's API.
  3. Within seconds, the target number receives the SMS.
  4. 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 skillTelegram / Discord (native)WhatsApp (native)
DirectionOutbound only (via this guide)Full two-way conversationFull two-way conversation
Setup complexityTwilio account + skill configBot token + one-click connectQR scan + one-click connect
Cost per messageTwilio per-message + carrier feesFree (included in OpenClaw plan)Free (included in OpenClaw plan)
No app requiredYes — broad reach to supported numbersRequires Telegram/Discord appRequires WhatsApp
China mainland deliveryLimited, expensiveBlocked (Telegram/Discord)Available
Best forOne-way alerts to supported numbersConversations, communitiesConversations, 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 more advanced integration not covered in this guide. For two-way conversations, use the native Telegram, WhatsApp, or Discord channels built into OpenClaw.

Is SMS a built-in OpenClaw channel?

No. OpenClaw's native managed channels are Telegram, Discord, WhatsApp, WeChat, Slack, and web chat. SMS is not a native inbound channel. The Twilio integration described here is an outbound-only pattern: your agent calls Twilio's API via a custom skill to send SMS messages. This distinction matters — users must interact with your agent on one of the native channels, not via SMS.

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?

Add Outbound SMS to Your AI Agent

Deploy an OpenClaw agent on Telegram or Discord — then wire Twilio for SMS alerts and notifications. Starting at $3/month.

Deploy with OpenClaw Launch