SMS OTP Verification API

Send a one-time passcode by SMS and verify the code your user types back, with two API calls. SMS reaches any phone with a mobile number, with no app to install and nothing to opt into.

Get Your API Key Free Read the docs
From $0.0009 per verification ยท priced per country199 countries with published ratesMobile network ยท no app or data connection needed

SMS is the channel to use when you know nothing about a user yet except their phone number. It works on smartphones and feature phones alike, and it's the only otp.com channel that depends on no app at all.

Integration is the same as every other channel. You call POST /otp/send with the recipient, the user receives the code, and you call POST /otp/verify with what they typed. Routing picks SMS from the recipient and the channel order you set in your dashboard. See Channels & routing.

01

POST /otp/send

Send with the recipient. Routing picks SMS from the recipient and the channel order you set in your dashboard.

curl -X POST https://api.otp.com/api/v1/otp/send \
  -H "Authorization: Bearer otp_live_โ€ขโ€ขโ€ข" \
  -H "Content-Type: application/json" \
  -d '{"recipient":"+14155552671","locale":"en","client_ip":"81.2.69.142"}'
02

Response

otp.com generates the code and delivers it; the code itself is never returned by the API.

{ "otp_id": "9f3c1b2a-โ€ฆ", "status": "pending", "channel": "sms", "masked_recipient": "+1****71" }
03

POST /otp/verify

When the user types the code, call POST /otp/verify with the otp_id and the code. A correct code sets the status to approved.

Verify Phone Numbers Across Your Apps

Scroll to playThe SMS arrives from OTP.comThe code is suggested above the keyboardOne tap fills the codePhone number verified
Sign-up. Confirm the user controls the number they gave you before the account is created. Mistyped numbers and many throwaway sign-ups stop at this step instead of reaching your database.
Login. Use the code as the login itself (passwordless), so there's no password for the user to forget or for you to store and reset.
Password reset. Send a code to the number on file before allowing a reset, so an attacker who knows only the email address can't take over the account.
Transaction confirmation. Ask for a code before a sensitive action such as changing a payout account, confirming an order or deleting data.
Two-factor authentication (2FA). Add a code as the second factor behind an existing password. It works for every user with a phone, including those who never set up an authenticator app.

A note on risk: SMS proves the user controls a phone number at that moment. It doesn't prove legal identity, and a number can be moved to another SIM. For the highest-risk actions, combine it with other signals rather than relying on SMS alone.

Why Choose Our SMS OTP Service?

Two API calls, one integration.

POST /otp/send and POST /otp/verify are the whole flow, and they're the same for SMS, WhatsApp, Telegram and Email. Official server SDKs cover Node.js, Python, Go and PHP, and the MCP server lets an AI coding assistant send and verify against a sandbox key while it writes your integration.

Build and test before you spend anything.

Test keys run in the sandbox: the full send and verify flow works, nothing is delivered and nothing is charged. The fixed code 123456 verifies, any other code exercises your failure path. Going live means swapping the key, with no other code change. Start with the quickstart.

Fallback in one call.

If an SMS doesn't arrive, or the user never enters it, your app calls POST /otp/resend. otp.com moves the same OTP to the next channel in your order, and the otp_id stays the same, so your verify call doesn't change. You write no retry logic or per-channel bookkeeping. Each resend is a new verification, charged at the rate of the channel it lands on, so factor resends into your retry policy. A cooldown applies between resends (429 with Retry-After), and once attempts are used up resend returns 409.

Protection against SMS pumping.

Platform limits (always on). Pass the end user's IP as client_ip on each send: VPN, proxy, Tor and datacenter IPs are throttled, and known abusive IPs are refused. Destination countries with heavy pumping and toll fraud are paused platform-wide; if your product needs one, request access for your account from the Routes screen.

Rate limits. App-wide rate limits and per-IP rate limits, both on by default for new apps.

Numbers per IP. A cap on how many different numbers one IP can reach in an hour.

IP rules. Requiring client_ip. Blocking VPN, proxy, Tor or datacenter IPs. IP allow and deny lists.

client_ip required
VPN ยท proxy ยท Tor blocked
allow 203.0.113.0/24
deny 198.51.100.7

Spend cap. A daily cap on sends or on spend in USD.

Try a rule safely. Run any rule in Monitor mode to see what it would block, then switch it to Enforce. A send refused by a rule is never sent and never billed. Blocked attempts are listed under Recent events in the dashboard. See Security.

SMS OTP Pricing

SMS is priced per country, because the cost of delivering through each country's operators is different. You pay per verification sent, from a prepaid credit balance. There is no setup fee, no monthly minimum and no subscription.

DESTINATIONSMS RATE PER VERIFICATION
Colombia (lowest)$0.0009
Tรผrkiye$0.0012
United States$0.0132
United Kingdom$0.0352
Germany$0.0480

See the full list of 199 countries on the pricing page.

MONTHLY VERIFICATIONS
๐Ÿ‡บ๐Ÿ‡ธSMS per verification $0.0132
Estimated monthly $132.00
With 10% resends on SMS $145.20/mo WhatsApp in the United States $0.0041 ยท $41.00/mo Cheaper first channel WhatsApp, 69% less

Each published rate is the cheapest route we can deliver on for that country, so treat it as a starting point. The final cost of a code depends on the operator that accepts it and on your fallback chain.

What you're charged for

Charged: each code sent, once, at the rate for its country and channel. A code that doesn't arrive is still charged, because the send is what you pay for.

Charged again: a resend, at the rate of whichever channel it lands on.

Not charged: verifying a code (any number of attempts), a send rejected before anything goes out, and anything sent with a sandbox test key.

Volume pricing

Published rates don't change with volume: every verification is charged at the same rate as the one before it, with no tiers, allowances or overage fees, and resends are charged at the same rate as the first send. If your balance runs out, sends pause until you top up.

Worked example (illustrative)

10,000 US sign-ups a month on SMS cost 10,000 ร— $0.0132 = $132.00. If 10% of users ask for a resend and it goes out by SMS again, add 1,000 ร— $0.0132 = $13.20, for $145.20. The 10% resend rate is an assumption, not a measured figure, so budget with your own numbers.

Where SMS is expensive, route around it

In some countries another channel costs far less. In the Comoros, SMS is $0.4238 per verification and WhatsApp is $0.0093. A per-country override puts a cheaper channel first there, while the rest of the world keeps SMS first, with no code change.

Estimate a monthly cost with the pricing calculator โ†’

Frequently Asked Questions

What is SMS OTP?

An SMS OTP is a short, single-use code sent by text message to confirm that a user controls a phone number. The user types the code into your app, and your backend checks it. It's commonly used for sign-up, login, password resets, two-factor authentication and confirming sensitive actions.

How does SMS OTP verification work with otp.com?

Your backend calls POST /otp/send with the phone number in E.164 format (for example +14155552671) and gets back an otp_id. otp.com generates the code and delivers it; the code itself is never returned by the API. When the user types the code, you call POST /otp/verify with the otp_id and the code. A correct code sets the status to approved. A wrong code leaves the OTP pending until the attempts run out, and every code expires after its lifetime.

What's the difference between an SMS verification API and a phone verification API?

In practice the terms overlap. An SMS verification API proves a phone number by text message. A phone verification API proves the same thing but may use other channels to reach the number. otp.com does both through one endpoint: SMS, plus WhatsApp and Telegram for phone numbers and Email for addresses, chosen by your routing.

How much does SMS OTP cost?

It depends on the destination country. Published rates run from $0.0009 per verification (Colombia) to $0.4238 (Comoros); the United States is $0.0132. You're charged per code sent, not per successful verification. Verifying is free. See pricing for every country.

Do I pay if the SMS doesn't arrive?

Yes. The charge is for the send, so a code that doesn't arrive is still charged, and a resend is charged as a new verification. A send that's rejected before anything goes out isn't charged, and nothing sent with a sandbox test key is charged.

Are retries and resends charged?

Yes. Every resend sends a new message, so it is charged as a new verification at the published rate of the channel it lands on, even when it re-issues the same code. Only verifying is free, however many attempts the user needs. To keep resend costs down, keep the cooldown between resends and use your Security rules to stop automated retry loops.

Is there a free trial?

New accounts start with $3 in free credits, with no credit card required. Separately, test keys run in the sandbox, where the whole flow works without delivering or charging anything.

What happens if an SMS code doesn't arrive?

Your app calls POST /otp/resend with the otp_id. otp.com advances the same OTP to the next channel in your order, for example WhatsApp or Telegram, and the response tells you which channel it went to. On SMS, a resend re-issues the same code rather than generating a new one. If SMS is your only channel, a resend repeats SMS. Either way, each resend is charged as a new verification.

Can I choose the language of the SMS?

Yes. Pass locale (for example en) on the send. If you leave it out, your app's default language is used.

How do I protect my SMS budget from fraud?

Pass the end user's IP as client_ip on every send, set Security rules for your app, and keep an eye on Recent events on the Security page of the dashboard. High-risk destinations are paused platform-wide by default. See the send reference for the related errors.

How long does integration take?

The quickstart sends and verifies a first code in the sandbox in about ten minutes. Going live is a key swap.

Start Sending SMS OTP Codes

Ship verification with one prompt.

$3 free credits. No credit card. No sales call. Your first OTP in 10 minutes.

No credit card ยท No sales call ยท No subscription