---
name: otp
description: Integrate otp.com OTP verification (send and verify a one-time code) into this project.
---

Source: https://otp.com/ai/prompt.md

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.