# Turn your Android phone into an SMS gateway

Install Sparetext on an Android phone with a SIM, scan a QR code, and your code sends and receives texts from that phone's own number: by REST API, signed webhooks, or an MCP server for AI agents. The phone sends in the background and reports each text as sent, delivered or failed. It's free for 1 phone and 300 texts a month, with no per-text fee.

![Sparetext's Texts tab on an Android phone: All, Failed and Waiting filters, and today's texts with their status: a received reply, a scheduled reminder, a failed text with why it failed, and two delivered](https://sparetext.dev/screens/android-texts.webp)

Texts: every status, and why one failed

## What an Android SMS gateway is

It's an app that takes texts from an API and hands them to the phone's radio, so they leave from the SIM's own number, the way a text you typed would. There's no number to rent and no sender to register first. When people reply, the reply comes back to the same phone and on to your code.

Sparetext is the hosted kind: the app pairs with your account, and the API, the queue and the dashboard run on our servers. Your SIM's plan pays for the texts.

## Set it up

You need a phone on Android 8 or newer, a SIM with a texting plan, and Wi-Fi or mobile data. A spare phone left on a charger works best.

1. On the phone, get the Android app from the download page and install it. Sparetext isn't on the Play Store yet, so Android asks you to allow the install; the page walks through each warning.
2. Open the app, allow SMS and notifications, and let it run in the background.
3. In the dashboard, open Phones › Add phone and scan the QR code with the app. The phone shows Online within seconds.
4. Make a key on the API keys page and send a text:

```bash
curl -X POST https://sparetext.dev/api/v1/messages \
  -H "x-api-key: $SPARETEXT_API_KEY" -H "content-type: application/json" \
  -d '{"to": "+12025550123", "text": "Your table for 2 is at 7pm. Reply C to cancel."}'
```

## Call it from a script

Anything that makes an HTTP request can send. The same text from Python, with requests:

```python
import os, requests

r = requests.post(
    "https://sparetext.dev/api/v1/messages",
    headers={"x-api-key": os.environ["SPARETEXT_API_KEY"]},
    json={"to": "+12025550123", "text": "Your table for 2 is at 7pm. Reply C to cancel."},
)
print(r.json())
```

## What happens to one text

What makes a phone gateway dependable happens between your request and the carrier. On our test phone, a Samsung Galaxy M13, a short text went from queued to sent in 8 seconds and was delivered 4 seconds later. This is the path it took:

1. Your request gets an id and the status queued at once.
2. The server wakes the phone over a connection the app keeps open, so the text leaves within seconds. A check once a minute is the safety net, and none of it needs Google Play services.
3. The phone hands the text to the radio on the SIM you chose. Android allows an app 30 message parts a minute, so the app counts parts and makes the rest wait their turn. A burst of 50 texts sent 30 in the first minute and the rest after it, and all 50 were delivered.
4. If there's no signal, or airplane mode is on, the text is held and tried again for up to 30 minutes. That happens only when nothing went out, so nobody gets it twice.
5. The radio reports sent, and the carrier's delivery report marks it delivered, part by part. A failure carries the reason the carrier gave.
6. Each change can reach your server as a signed webhook, and so does every reply.

## What the API gives you

Send one text or many in a call, schedule a text, or give it a time to live, so a late one-time code is never sent. Choose the SIM on a dual-SIM phone, and set sending hours per phone, so texts queued at night wait for morning.

Receive every incoming text as a webhook signed with HMAC and tried 10 times over 3 days, with each request and answer in a log. Pictures go both ways by MMS.

Connect Claude or ChatGPT to the hosted MCP server, and an AI agent can send a text and wait for the reply. With private mode on, texts are encrypted on your devices with AES-256-GCM, and we hold only ciphertext of their words.

## What it costs

Free covers 1 phone and 300 texts a month. Pro is $12.74 a month or $84.99 a year for 5 phones and 10,000 texts. Neither has a per-text fee: the texts go out on your SIM's plan.

A long text counts once, however many parts it's sent in, and received texts never count.

## When a phone gateway is the wrong tool

Carriers treat business texts sent by software as application traffic, even from a personal SIM, and they filter bulk sends. A phone gateway suits reminders, one-time codes, alerts and conversations with people who expect to hear from your number. For marketing blasts, short codes or a delivery guarantee, use a carrier API such as Twilio.

Sparetext is hosted only. If texts must never leave your own servers, textbee, httpSMS and SMS Gateway for Android are open source and can be self-hosted.

## Questions people ask

**How can I turn my Android phone into an SMS gateway I can call from a script?**

Install Sparetext on the phone, pair it by scanning a QR code, and make an API key. Then any script sends a text with one HTTP POST to https://sparetext.dev/api/v1/messages, from Python, Node.js, Bash or anything else that speaks HTTP, and reads replies by webhook. It's free for 1 phone and 300 texts a month, with no Twilio account.

**Do I need a dedicated phone?**

No. Sparetext runs in the background on a phone you use every day. A spare phone on a charger and Wi-Fi is steadier, because nobody switches it off or carries it out of coverage.

**How many texts can one Android phone send?**

Android lets an app hand the radio 30 message parts a minute, which is about 30 short texts, and Sparetext paces itself under that. Your plan sets the month: 300 texts on Free, 10,000 on Pro across up to 5 phones. Your carrier's own fair-use limits apply too.

**Will my carrier block my SIM?**

It can, if your texts look like bulk marketing. Send to people who expect your texts, keep volumes modest and honor STOP. Sparetext has no registration step, but carriers' rules for business texts still apply.

**Can it receive SMS too?**

Yes. The app forwards incoming texts to your webhook, and you can read them by API, in the dashboard or through MCP. A new phone keeps replies only from people you've texted, so personal texts stay on the phone. Switch it to Everyone if customers text you first.

**Does it need Google Play services?**

No. The app keeps its own connection to the server and also checks in once a minute, so it works on phones without Google's services.

**Does the phone have to stay awake?**

No, the screen can be off. Samsung, Xiaomi, Huawei and other makers stop background apps harder than Android itself does, so the app shows the battery settings to change for your phone's maker. After a restart with a screen lock, Android keeps the app stopped until someone enters the PIN, and texts wait on the server meanwhile.

**Is there an iPhone version?**

Yes, within what Apple allows: a Mac relay sends automatically from the iPhone's number, a Shortcut sends while the app is open, or you tap Send for each text.

**I'm on textbee. How hard is it to switch?**

Change the base URL and the key. Sparetext answers at textbee's send and read paths with textbee's fields, so the code you have keeps working.

## Try it on the phone you have

Free for 1 phone and 300 texts a month. An Android pairs in two minutes.

[Get started free](https://sparetext.dev/signup)

---

This is the Markdown copy of https://sparetext.dev/android-sms-gateway for AI agents. Every public page has one: add .md to its address (the home page is https://sparetext.dev/index.md). Sparetext for agents in one file: https://sparetext.dev/llms.txt
