otp.com in Cursor

Save the otp.com rules file in your repo and Cursor can pull it in when you work on OTP verification, so the agent follows the same integration steps every time.

Get Your API Key Free
mkdir -p .cursor/rules && curl -fsSL https://otp.com/ai/files/cursor/otp.mdc -o .cursor/rules/otp.mdc
Cursor
Ready
  1. Loaded the otp rule .cursor/rules/otp.mdc
  2. Read the API key OTP_API_KEY · server env
  3. Added the send call
    SMSWhatsAppTelegramEmail
  4. Added the verify call POST /otp/verify
Add otp.com phone verification to the signup flow.
Cursor · Rules file

Set up otp.com in Cursor

Create an API key in the panel (API Keys). Start with an otp_test_ key. Install the rules file with the command below, or download it and save it at .cursor/rules/otp.mdc. Ask for the integration. The agent writes the send and verify calls into your code, with the key read from OTP_API_KEY on the server.

mkdir -p .cursor/rules && curl -fsSL https://otp.com/ai/files/cursor/otp.mdc -o .cursor/rules/otp.mdc
Download otp.mdc

A Cursor rule with a description, so the agent can pull it in when you work on OTP verification.

What to ask once the file is in place

my-app · cursor-agent · 80×24
james@macmy-app% cursor-agent
> Add phone verification to sign-up with otp.com: send a code when the user submits their number, then verify it.
● Reading .cursor/rules/otp.mdc
● Editing src/auth/signup.ts
✓ Send and verify calls added
EXAMPLE PROMPT

Add phone verification to sign-up with otp.com: send a code when the user submits their number, then verify it.

my-app · cursor-agent · 80×24
james@macmy-app% cursor-agent
> Read https://otp.com/ai/prompt.md and integrate otp.com OTP verification into this project.
● Fetching otp.com/ai/prompt.md
● Step 1: POST /otp/send
✓ Step 2: POST /otp/verify wired in
OR POINT IT AT THE FILE

Read https://otp.com/ai/prompt.md and integrate otp.com OTP verification into this project.

Full integration prompt as Markdown →

Frequently Asked Questions

Is my API key safe?

Keep the key in an environment variable or a secret on your server (OTP_API_KEY), never in the rules file or the prompt, and never commit it. Use a test key (otp_test_) while you build.

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.

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.