TextPreflightGuide
SMS segment calculator API

Calculate billable segments before sending.

Visible character count is not the same as encoded message size. One character can change the alphabet, multipart capacity and total campaign cost.

What the API measures

TextPreflight identifies GSM-7 or UCS-2 encoding, counts encoded units, applies the selected sender profile and reports the exact number of billable segments. Add recipient count and your own per-segment price to estimate campaign spend.

Encoding/profileSingle partMultipart
GSM-7 standard160 septets153 per part
UCS-2 standard70 units67 per part
Toll-free US/CA profile160 / 70152 / 66

Analyze a campaign

curl -X POST \
  https://textpreflight.kadircoteli.workers.dev/api/v1/sms/analyze \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer TPF-YOUR-LICENSE-KEY" \
  -d '{"text":"Your delivery is ready.","recipients":10000,"unitPrice":0.0075,"currency":"USD"}'

The result includes encoding, units, segment count, remaining capacity, billable segments and estimated cost. Billing can vary by route and provider, so use your current contract price and the relevant profile.

Use it as a pre-send gate

Provider-neutral by design.

The calculation happens before the delivery request, so one integration can protect multiple messaging routes.

Test a real message.

Use the free analyzer, then add the same check to your application.

Technical references