Messaging

How an SMS chatbot cuts support tickets and recovers no-shows

Learn how an SMS chatbot works, which phone number to use, and how to build one with AI. Covers healthcare use cases, free options, and platform selection.

sms chatbot featured image

Takeaways

  • An SMS chatbot is software that holds automated, AI-driven, two-way text conversations over standard SMS. No app download, no internet connection, works on any handset.
  • The mechanics are simple: an inbound text arrives on your phone number, a webhook delivers it to your application, an LLM generates a context-aware reply, and an SMS API sends the response.
  • Your number type shapes everything downstream. 10DLC long codes fit most two-way chatbots, toll-free numbers scale national support, and short codes buy maximum throughput at premium cost.
  • Truly free production numbers do not exist. Carrier fees and registration carry real costs, but free trial credits let you build and test a full chatbot before paying.
  • Platforms that run AI inference and SMS delivery on one owned network cut cost and latency compared with chatbot tools rented on top of aggregator telephony.

What is an SMS chatbot?

An SMS chatbot is software that holds automated, two-way text conversations with customers over standard SMS. It reads each inbound message, interprets it with rules or an AI model, and replies from your business phone number within seconds. Because it runs over conversational SMS rather than a web widget or a mobile app, it reaches every phone on every carrier, including feature phones with no data plan.

Most businesses do not start with a chatbot. They start with one-way notifications, such as an airline pushing flight disruption alerts from its reservation system or a clinic sending appointment confirmations. The chatbot is the natural second phase. The number, the messaging profile, and the carrier registration you set up for notifications carry over. You add reply handling and AI logic on top of infrastructure you already own. It is an upgrade path, not a rip-and-replace.

sms-chatbot-full-stack-flow-chart

How do SMS chatbots work?

An SMS chatbot works in four steps. A customer texts your number. The carrier delivers that message through an SMS gateway to your provider, which fires a webhook to your application with the message payload. Your application passes the text, along with prior conversation history, to a rules engine or an LLM that generates a reply. Your application then calls the SMS API to send that reply back to the customer's handset.

The step that separates a useful SMS chatbot from a frustrating one is conversation memory. SMS is stateless by nature. Each message arrives as an isolated event, so your application has to store the thread per phone number and feed it back to the model on every turn. Here is a working example that does exactly that, using Telnyx for both the messaging and the AI inference:

"""SMS Chatbot with Conversation Memory, persistent AI conversations over text with context retention."""

import os, json, time, requests, telnyx
from dotenv import load_dotenv
from flask import Flask, request, jsonify
import threading, time as _ttl_time

load_dotenv()
app = Flask(__name__)
client = telnyx.Telnyx(api_key=os.getenv("TELNYX_API_KEY"), public_key=os.getenv("TELNYX_PUBLIC_KEY"))

TELNYX_API_KEY = os.getenv("TELNYX_API_KEY")
TELNYX_PUBLIC_KEY = os.getenv("TELNYX_PUBLIC_KEY", "")
AI_MODEL = os.getenv("AI_MODEL", "moonshotai/Kimi-K2.6")
BOT_NUMBER = os.getenv("BOT_NUMBER")
INFERENCE_URL = "https://api.telnyx.com/v2/ai/chat/completions"

conversations = {}

def _start_ttl_cleanup(*stores, ttl_seconds=3600, interval=300):
    def _cleanup():
        while True:
            _ttl_time.sleep(interval)
            cutoff = _ttl_time.time() - ttl_seconds
            for store in stores:
                expired = [k for k, v in store.items()
                           if isinstance(v, dict) and v.get("_ts", _ttl_time.time()) < cutoff]
                for k in expired:
                    store.pop(k, None)
    threading.Thread(target=_cleanup, daemon=True).start()

_start_ttl_cleanup(conversations)

SYSTEM_PROMPT = """You are a helpful SMS assistant. You remember everything the user has told you across messages.
Keep responses under 160 characters when possible to fit in a single SMS. If you need more space, use up to 320 characters.
Be concise, helpful, and conversational. Reference previous messages when relevant."""

The full runnable project is in the conversation memory example on GitHub.

Why use an SMS chatbot for your business?

The business case rests on reach and attention. Industry benchmarks consistently put SMS open rates near 98 percent, while email averages closer to 20 percent, and most texts are read within minutes of delivery. There is no app to install, no login to remember, and no notification permission to grant. Gartner research has tracked steady growth in conversational automation across customer service channels, and SMS is the one channel that requires zero behavior change from the customer.

The revenue impact shows up in the workflows a chatbot can close on its own. A reminder that lets a patient reschedule by reply keeps the appointment slot filled. A shipping alert that answers "where is my order" avoids a support ticket. A flight disruption text that rebooks the passenger by SMS keeps them off the phone queue during an irregular operations event.

Note: If you already send transactional SMS, you are one webhook away from a chatbot. Point your existing number's inbound webhook at an application with LLM logic and the same number becomes conversational.

Build your SMS chatbot on one networkThe Telnyx SMS API gives you two-way messaging, smart routing, and built-in compliance on direct carrier connections, with AI inference on the same platform.

Explore the SMS API

SMS chatbots in healthcare

Healthcare is where a healthcare chatbot over SMS earns its keep fastest. Missed appointments cost providers billable hours that cannot be recovered, prescription refills lapse when patients forget to request them, and intake forms delay visits. Each of these problems reduces to a short text exchange that software can handle, on the one channel every patient already uses.

Appointment reminders and rescheduling

A plain reminder text reduces no-shows. A healthcare chatbot that handles the reply eliminates the follow-up work. When a patient answers "can't make it," the bot offers open slots, books the new time, and updates the schedule without a staff member touching the thread. Non-responders get escalated to an automated voice call, so the practice covers patients who ignore texts without adding headcount.

healthcare-sms-chatbot-reminder-thread

This workflow is multichannel by design. The example below sends SMS first, then places an AI-handled voice call to anyone who has not responded, with the model instructed to confirm, reschedule, or cancel:

"""AI Appointment Reminder, SMS first, voice call for non-responders, AI handles rescheduling."""

import os, json, time, requests, telnyx
from dotenv import load_dotenv
from flask import Flask, request, jsonify
import threading, time as _ttl_time

load_dotenv()
app = Flask(__name__)
client = telnyx.Telnyx(api_key=os.getenv("TELNYX_API_KEY"), public_key=os.getenv("TELNYX_PUBLIC_KEY"))
TELNYX_PUBLIC_KEY = os.getenv("TELNYX_PUBLIC_KEY", "")

TELNYX_API_KEY = os.getenv("TELNYX_API_KEY")
AI_MODEL = os.getenv("AI_MODEL", "moonshotai/Kimi-K2.6")
FROM_NUMBER = os.getenv("FROM_NUMBER")
CONNECTION_ID = os.getenv("CONNECTION_ID")
INFERENCE_URL = "https://api.telnyx.com/v2/ai/chat/completions"

appointments = []  # {patient_name, phone, datetime, service, status, reminder_stage}
active_calls = {}

SYSTEM_PROMPT = """You are a friendly appointment reminder assistant. You're calling to confirm an upcoming appointment.
If they want to reschedule, offer available times. If they confirm, thank them. If they cancel, acknowledge gracefully.
Keep responses under 2 sentences, this is a phone call."""

The complete project is in the appointment reminder example on GitHub.

HIPAA compliance and patient data

Texting protected health information triggers obligations under HIPAA regulations. Standard SMS is not encrypted end to end, so covered entities keep PHI out of message bodies where possible, obtain documented patient consent for text communication, and sign a business associate agreement with any vendor that transmits or stores patient data on their behalf.

This is where the underlying platform matters more than the bot logic. If your chatbot tool rents telephony from an aggregator, your patient data crosses an extra vendor boundary, and you need agreements and audits covering every party in the chain. A platform that carries the message, hosts the webhook, and runs the AI inference itself gives you one data processor to vet and one BAA to sign.

Warning: Consent for appointment reminders does not automatically cover marketing texts. Track consent per use case and honor STOP requests across all of them.

Choosing a phone number for your AI SMS chatbot

The AI SMS chatbot number decision comes before any line of chatbot code, and it shapes throughput, deliverability, and how customers perceive your messages. Telnyx phone numbers activate instantly across 140+ countries, which matters when your launch date is fixed by a system integration going live, not by how long provisioning takes.

Long codes (10DLC) vs toll-free vs short codes

A 10DLC long code is a standard 10-digit local number registered for business messaging. It is the default choice for a two-way AI SMS chatbot number because it looks like a number a human would text, supports voice on the same line, and costs a few dollars a month. Toll-free numbers offer higher default throughput after verification and carry national brand recognition, which suits support lines and alert systems. Short codes deliver the highest throughput in the industry but cost thousands per month and read as broadcast, not conversation.

Number typeThroughputBest fit
10DLC long codeModerate, tied to campaign trust scoreTwo-way conversational chatbots
Toll-freeHigh after verificationNational support and alerts
Short codeHighest availableMass one-way campaigns

ai-sms-chatbot-number-comparison-chart

Registration and compliance requirements

Unregistered traffic gets filtered. In the US, 10DLC numbers require brand and campaign registration with The Campaign Registry, where your declared use case and trust score determine your throughput. Toll-free numbers require a verification submission describing your traffic. Both paths follow the CTIA messaging guidelines, which mandate clear opt-in, honoring STOP immediately, and responding to HELP.

Two practical steps protect deliverability once you are registered. First, submit registration early, because campaign vetting can take days and a hard launch date does not move for carrier review queues. Second, validate recipient numbers with number lookup before sending, so you do not burn throughput and reputation texting landlines or disconnected numbers.

Note: Telnyx supports self-service 10DLC registration and toll-free verification from the portal, so number provisioning and campaign registration run in parallel with your build.

Can you get a free AI SMS chatbot number?

The honest answer is no, not for production. Carriers charge per-message fees, 10DLC campaigns carry registration costs, and toll-free verification takes real review time. Any AI SMS chatbot number free offer is either a trial, a shared number, or a cost hidden somewhere else in the pricing. What you can get free is everything you need to build and validate the chatbot before spending a dollar at scale.

What free trials actually include

Trial credits typically cover a test number, a limited volume of sends to verified recipients, and full API access. That is enough to wire up the webhook, test conversation memory, and demo the bot internally. Telnyx trial credit works this way. You build against the same SMS API you will run in production, on direct carrier connections, and flip to paid when you register your campaign.

Trial phaseProduction phase
Test number, limited sendsRegistered 10DLC or toll-free number
Verified recipients onlyAny opted-in recipient
No registration requiredCampaign registration and verification

Hidden costs and limitations of free options

Free options carry costs that surface later. Unregistered traffic gets filtered by carriers, so messages silently fail. Shared numbers pool your reputation with every other tenant, and one bad actor tanks deliverability for all of them. Free-tier chatbot tools often meter conversations, so the bill arrives the moment the bot succeeds and volume grows.

Pay-as-you-go is the honest alternative. With Telnyx there is no platform fee. You pay for the number and the messages you send, and the unit costs are visible before you commit. For a chatbot handling real customer conversations, predictable per-message pricing beats a free tier with a conversion trap.

How to choose the best SMS chatbot platform

Most roundups answer the best SMS chatbot question with a list of 25 tools. That format hides the actual decision, because nearly every tool on those lists sits on rented telephony. A better approach is a short evaluation framework applied to how the platform is built.

Evaluation criteria that actually matter

Six criteria separate platforms that survive production from platforms that survive demos:

  • Deliverability: Does the provider have direct carrier relationships, or does it resell an aggregator's routes?
  • AI flexibility: Can you choose your LLM, or are you locked to one model behind a proprietary flow builder?
  • Context handling: Does the platform support persistent conversation memory per phone number?
  • Compliance tooling: Are 10DLC registration, toll-free verification, and STOP/HELP handling built in?
  • Pricing model: Per-message and per-number pricing you can forecast, or per-conversation metering that scales against you?
  • API depth: Can developers reach webhooks, delivery receipts, and raw message events, or only a visual editor?

Why the underlying network matters

When your chatbot tool rents telephony from an aggregator, every message crosses at least two companies. Each boundary adds cost markup, adds latency between reply generation and delivery, and creates a support gap where the bot vendor blames the message layer and the message layer blames the bot. Telnyx removes the boundary. The number, the webhook, the LLM inference, and the SMS delivery run on one owned network, with a single bill and a single support team accountable for the whole loop.

Most Voice AI platforms sit on top of someone else's telephony stack. Telnyx runs the AI within our telephony layer.", Ian, Telnyx

The same architecture applies to messaging. The inference endpoint your chatbot calls lives on the same platform as the number receiving the text, so there is no cross-vendor hop between understanding a message and answering it. If you want to see it working, clone the appointment booking flow, a guided SMS booking bot with slot selection, and deploy it against your trial number today.

FAQ

Can you use ChatGPT to reply to a text message?
Yes. Point your number's inbound webhook at an application that forwards the message to an LLM API and sends the model's reply back through an SMS API. Telnyx offers hosted AI inference on the same platform as the messaging, so the reply never crosses a second vendor.
What are chatbots in text messages?
They are software agents that read inbound SMS messages and reply automatically from a business number. Simple versions match keywords like CONFIRM or STOP. AI versions use an LLM with conversation memory to handle open-ended questions, rescheduling, and multi-turn exchanges.
Are chatbots suitable for small businesses with limited budgets?
Yes. A 10DLC number costs a few dollars per month, messages are priced per send, and one-time campaign registration is modest. With pay-as-you-go pricing and no platform fee, a small business pays only for the numbers and messages it actually uses.
How secure is customer data when using a chatbot?
Security depends on how many vendors touch the data. Look for encryption in transit, webhook signature verification, clear data retention policies, and a provider willing to sign a business associate agreement if you handle health data. Fewer vendor boundaries mean fewer points of exposure.
How can I measure the success of my SMS chatbot?
Track response rate on outbound prompts, the share of conversations resolved without human handoff, opt-out rate, and the business metric the bot targets, such as no-show reduction or tickets deflected. Delivery receipts from your SMS API give you the denominator for all of these.

Launch your SMS chatbot todayGet a number, register your campaign, and connect your webhook on one platform. The Telnyx SMS API runs messaging and AI inference on one owned network with direct carrier connections.

Start building
Share on Social
Serhii
Serhii Omelchenko
Global AEO/SEO Manager

Serhii is Global AEO/SEO Manager at Telnyx, based in Amsterdam, he is focused on making communications infrastructure findable and credible across both traditional search and AI-driven discovery. He previously led SEO and GEO strategy for some of the world’s most recognized consu