Messaging
Messages that show their working.
Send SMS with one request on carrier routes. Every reply carries the segment count and the exact cost, and the delivery receipt arrives as a signed webhook.
$0.00426
Lowest live rate, India
per segment
$0.001
Most the platform fee can be on a message
1,000
Messages in one bulk request
Overview
One POST sends a message and tells you what it cost
Messaging carries alerts, reminders, receipts and conversations over SMS. You choose a sender, we count the segments the way networks do, route the message by the strategy you pass and book the charge before it leaves.
At a glance
- Send
- POST /comms/sms
- Status
- GET /comms/sms/{messageId}
- Bulk
- POST /comms/sms/bulk, up to 1,000
- Auth
- Bearer API key, scope sms:send
- Body
- Up to 1,600 characters
- Throughput
- 10 send requests a second per key
Capabilities
Everything a transactional sender needs
Built for teams who reconcile every message against an invoice.
Segments counted before sending
GSM-7 fits 160 characters, or 153 per part once split. Unicode fits 70, or 67 per part. The count is done before the message leaves, so the cost is never a surprise.segments in every reply
The exact cost in the reply
Rate, segments and fee are booked together. If the route refuses the message the charge is reversed and the reply says so.cost, status in SmsResult
Your brand or your number as sender
Send from an alphanumeric name or a number. Each SMS route states which sender types it carries before you use it.from, up to 30 characters
Routing per message
Leave out the route and Smart Routing picks one for the destination by cheapest, best_quality or balanced. Or pin a route you bought on the marketplace.strategy or routeId
Retries that never double-send
Send an X-Idempotency-Key and a retried request replays the first reply for 24 hours instead of sending and billing again.X-Idempotency-Key header
Two-way on your own numbers
Texts to a number you hold are posted to your URL, and you reply from the same number. Conversations are kept per number.PUT /dids/{id}/sms-settings, POST /dids/{id}/messages
Bulk sends
Up to 1,000 messages in one request on an SMS route you bought, sent in order, with a status for each.POST /comms/sms/bulk
A sandbox on the real path
Test keys validate, route, count and price the message on a real route, then simulate the send against sandbox credit and mark it simulated.px_test_sk_ keys
Send a message
Your first message is one request
Pass the destination, the sender and the text. The reply carries the message ID, the segment count and the cost.
- Leave out routeId and Smart Routing picks the route. Pass strategy to choose cheapest, best_quality or balanced.
- The reply status is the send-time outcome. Delivered or failed follows from the carrier receipt, on routes that return one.
curl -X POST https://packetexchange.io/api/v1/comms/sms \
-H "Authorization: Bearer $PACKETEXCHANGE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)" \
-d '{
"to": "+447700900123",
"from": "Riverside",
"message": "Your order 1042 is out for delivery and arrives between 14:00 and 16:00."
}'import { randomUUID } from 'node:crypto';
const res = await fetch('https://packetexchange.io/api/v1/comms/sms', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.PACKETEXCHANGE_API_KEY}`,
'Content-Type': 'application/json',
'X-Idempotency-Key': randomUUID(),
},
body: JSON.stringify({
to: '+447700900123',
from: 'Riverside',
message: 'Your order 1042 is out for delivery and arrives between 14:00 and 16:00.',
}),
});
const { data } = await res.json();
console.log(data.messageId, data.segments, data.cost);import os, uuid
import httpx
res = httpx.post(
"https://packetexchange.io/api/v1/comms/sms",
headers={
"Authorization": f"Bearer {os.environ['PACKETEXCHANGE_API_KEY']}",
"X-Idempotency-Key": str(uuid.uuid4()),
},
json={
"to": "+447700900123",
"from": "Riverside",
"message": "Your order 1042 is out for delivery and arrives between 14:00 and 16:00.",
},
)
data = res.json()["data"]
print(data["messageId"], data["segments"], data["cost"])Response
{
"success": true,
"data": {
"messageId": "…",
"status": "accepted",
"segments": 1,
"cost": "…",
"submittedAt": "…"
}
}Two-way messaging
Receive and reply on your own number
Point a number you hold at your URL. Inbound texts are posted there as they arrive, and you answer from the same number with one request.
- Numbers come from the number store. Not every number type carries SMS; the store shows which do.
- Every inbound text also raises the number.sms.received webhook, signed like every other event.
# Texts to the number are POSTed to your URL.
curl -X PUT https://packetexchange.io/api/v1/dids/$NUMBER_ID/sms-settings \
-H "Authorization: Bearer $PACKETEXCHANGE_API_KEY" \
-H "Content-Type: application/json" \
-d '{ "smsEnabled": true, "forwardWebhookUrl": "https://example.com/inbound-sms" }'
# Reply from the same number.
curl -X POST https://packetexchange.io/api/v1/dids/$NUMBER_ID/messages \
-H "Authorization: Bearer $PACKETEXCHANGE_API_KEY" \
-H "Content-Type: application/json" \
-H "X-Idempotency-Key: $(uuidgen)" \
-d '{ "to": "+447700900123", "body": "Thanks, we have your message." }'import { randomUUID } from 'node:crypto';
const px = (method, path, body, headers = {}) =>
fetch(`https://packetexchange.io/api/v1${path}`, {
method,
headers: {
Authorization: `Bearer ${process.env.PACKETEXCHANGE_API_KEY}`,
'Content-Type': 'application/json',
...headers,
},
body: JSON.stringify(body),
}).then((r) => r.json());
// Texts to the number are POSTed to your URL.
await px('PUT', `/dids/${numberId}/sms-settings`, {
smsEnabled: true,
forwardWebhookUrl: 'https://example.com/inbound-sms',
});
// Reply from the same number.
await px('POST', `/dids/${numberId}/messages`,
{ to: '+447700900123', body: 'Thanks, we have your message.' },
{ 'X-Idempotency-Key': randomUUID() });import os, uuid
import httpx
px = httpx.Client(
base_url="https://packetexchange.io/api/v1",
headers={"Authorization": f"Bearer {os.environ['PACKETEXCHANGE_API_KEY']}"},
)
# Texts to the number are POSTed to your URL.
px.put(f"/dids/{number_id}/sms-settings", json={
"smsEnabled": True,
"forwardWebhookUrl": "https://example.com/inbound-sms",
})
# Reply from the same number.
px.post(
f"/dids/{number_id}/messages",
json={"to": "+447700900123", "body": "Thanks, we have your message."},
headers={"X-Idempotency-Key": str(uuid.uuid4())},
)On carrier routes
Routes you can see, priced before you send
Every SMS route on the marketplace states its rate, its sender types and whether it has returned delivery receipts lately. Smart Routing chooses among them per message.
Webhooks
Events, signed and retried
Subscribe an HTTPS endpoint once and every message reports back. Each delivery is signed and retried until your endpoint answers.
Each delivery carries X-PX-Signature, v1= followed by an HMAC SHA-256 of the timestamp and the raw body, with the timestamp in X-PX-Timestamp. Failed deliveries are retried with a growing back-off, and every attempt can be read and resent.
- sms.sentThe route accepted the message.
- sms.deliveredA carrier receipt confirmed delivery. Never inferred.
- sms.failedThe route refused it or the carrier reported it undelivered. The charge is refunded.
- number.sms.receivedA text arrived on a number you hold.
- balance.lowYour balance fell below your threshold.
Pricing
Per segment, at the route rate
A message is billed per segment at the rate of the route that carries it, plus a platform fee of 2% of that cost that never exceeds $0.001 for the whole message. A refused or failed message costs nothing.
- Account and API keys
- Free
- Platform fee
- 2% of carrier cost, at most $0.001 a message
- Failed or refused message
- Refunded
- Top up
- From $5 by card or crypto
Lowest live rates right now, per segment
- United States$0.0092 /msg
- India$0.00426 /msg
- Pakistan$0.03375 /msg
- Nigeria$0.0062 /msg
- Philippines$0.1573 /msg
Live rates are the cheapest listed route for an ordinary mobile number in each destination, read from the marketplace as this page was served. Look up any number on the pricing page.
In production
Built for production
The details that keep a messaging integration honest at volume.
- Delivered means deliveredA message moves to delivered only on a carrier receipt that says so, never by inference, and each route shows whether it has returned receipts in the last 30 days.
- No charge for a refused sendIf the route refuses the hand-off, the charge is reversed at once and the reply shows a cost of zero.
- Retries that never double-sendAn X-Idempotency-Key replays the original reply for 24 hours, so a retry never sends or bills the same message twice.
- Guardrails before routingEmbargoed destinations are refused before routing or billing, and your suppression list applies to every send.
- Events you can proveEvery webhook is signed with HMAC SHA-256 over the timestamp and body, retried with back-off, logged, and can be resent from the dashboard.
- A sandbox on the real pathTest keys validate, route, count segments and price on a real route, then simulate the send, so tests answer exactly like production.
Moving over
Your sends map across, field by field.
Coming from Twilio
The names you know, mapped
If you have built on Twilio, most of what you know carries over. These are the pieces that change for this product.
Twilio is a trademark of Twilio Inc. PacketExchange is not affiliated with or endorsed by Twilio.
Questions
Messaging, answered
How is a message billed?
Do I get delivery receipts?
Which sender IDs can I use?
Can people text me back?
Can I test without sending?
Is there a monthly fee?
Keep reading
- SMS APIThe quick tour, with live prices per destination
- Send an SMS quickstartFrom a new key to a delivered message, in eight programming languages
- API referenceEvery field of every SMS endpoint
- VerifyOne-time codes by SMS or voice on the same balance
- Phone numbersNumbers that receive texts and calls
- Moving from TwilioMessaging, step by step
Send your first message today
Free account, an API key on sign-up and carrier rates from the first message. No contract and no monthly fee.
Prefer to talk it through? Contact the team.




