Get started
Authentication
OTPRelay authenticates every request with a bearer API key. Keep live keys secret, and use test keys while you build.
Pass your API key in the Authorization header as a bearer token. All requests must be made over HTTPS - calls over plain HTTP fail, and requests without a valid key return 401.
Authorization header
Key types
Each account has two key pairs. Test keys run against the sandbox and never deliver a real message; live keys send real OTPs and are billed.
sk_test_…test keyoptional- Sandbox mode. No real SMS is sent and the code 000000 is always accepted. Use this everywhere except production.
sk_live_…live keyoptional- Production mode. Sends real OTPs over live delivery routes and counts toward billing.
Making an authenticated request
bash
Keep live keys server-side
A leaked
sk_live_… key lets anyone send OTPs on your account. Never embed it in a mobile app, single-page app, or public repo. Call OTPRelay from your backend, and rotate keys from the dashboard if one is exposed.Authentication errors
A missing, malformed or revoked key returns 401 Unauthorized with an authentication_error body.
401 Unauthorized
See Errors for the full list of error types and codes.
Coming soon
Dashboard key management, rotation and IP allowlists are on the way.