otp.com in Lovable

Paste the integration prompt into Lovable and it builds the send and verify calls into your app. The prompt carries the whole API reference.

Get Your API Key Free API docs
Lovable
Ready
  1. Read the integration prompt otp.com/ai/prompt.md
  2. Read the API key edge-function secret
  3. Added the send call
    SMSWhatsAppTelegramEmail
  4. Added the verify call backend · POST /otp/verify
Integrate otp.com OTP verification into this project.
Lovable · Prompt

Set up otp.com in Lovable

Copy the integration prompt on this page and paste it into Lovable. Store the API key as a backend or edge-function secret, never in browser code. Use an otp_test_ key while you build. Call send and verify from that backend code, and check the verify result there before you treat the user as verified.

API docs

Paste this prompt into Lovable

The prompt carries the whole API reference, so the agent can build send and verify without leaving the editor.

INTEGRATION PROMPT
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?

Only if it stays on the server. Put it in a backend or edge-function secret and call otp.com from there. A key in browser code is visible to every visitor.

Does the agent see the code?

No. The API never returns the code. The user receives it on their phone or in their inbox, and your app verifies what they type against the otp_id from the send call.

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.