otp.com in Replit Agent
Paste the integration prompt into Replit Agent and it builds the send and verify calls into your app. The prompt carries the whole API reference.
- Read the integration prompt otp.com/ai/prompt.md
- Read the API key Replit Secrets · OTP_API_KEY
- Added the send callSMSWhatsAppTelegramEmail
- Added the verify call server-side · POST /otp/verify
Set up otp.com in Replit Agent
Copy the integration prompt on this page and paste it into Replit Agent. Add OTP_API_KEY to Replit Secrets. Use an otp_test_ key while you build. Keep both calls (send and verify) in server-side code, so the key never reaches the browser.
API docsPaste this prompt into Replit Agent
The prompt carries the whole API reference, so the agent can build send and verify without leaving the editor.
Integrate otp.com OTP verification into this project.
API docs: https://otp.com/docs
Base URL: https://api.otp.com/api/v1
Auth: Bearer token in the Authorization header
## Step 1: Send a code
POST /otp/send
Body: { "recipient": "+14155552671", "locale": "en", "client_ip": "<end user's IP>" }
→ Returns { "otp_id": "9f3c1b2a-…", "status": "pending", "channel": "sms" }
## Step 2: Verify the code the user entered
POST /otp/verify
Body: { "otp_id": "9f3c1b2a-…", "code": "123456" }
→ Returns { "otp_id": "9f3c1b2a-…", "status": "approved", "matched": true }
Notes:
- recipient is a phone number (E.164) or an email; your account routing picks the channel.
- client_ip is the END USER's IP from the request context (e.g. req.ip), never the server's own; requests without it share a much tighter rate limit.
- The code is never returned by the API.
Sandbox test keys (otp_test_…) accept the fixed code 123456 on the default 6-digit length. Frequently Asked Questions
Is my API key safe?
Store it in Replit Secrets as OTP_API_KEY and read it on the server. Never paste the key into the prompt or into front-end code.
Can I test without sending real messages?
Yes. A test key (otp_test_) runs in the sandbox: send returns a real otp_id and a pending status, but nothing is delivered and nothing is charged. Verify accepts the fixed code 123456 on the default 6-digit length.
How is it billed?
Per verification sent: one charge per code, at the published per-country rate. Verifying is free, and a resend counts as a new verification. Test keys are never charged.