OTP Generator API - Create Verification Codes via REST
Generate a cryptographically random numeric one-time password with configurable length (4-8 digits). Each OTP includes a suggested expiration time and a timestamp.
Code examples
curl -X POST https://api.botoi.com/v1/otp/generate \
-H "Content-Type: application/json" \
-d '{"length":6,"purpose":"email-verification"}'When to use this API
Generate verification codes for email or SMS confirmation
When a user signs up or resets their password, generate a 6-digit numeric OTP and send it via email or SMS. Verify it on submission. No need to build your own random number generator with proper entropy.
Create temporary access codes for guest Wi-Fi or kiosks
Generate alphanumeric OTPs as short-lived access codes for guest networks, shared kiosks, or temporary admin access. The built-in expiration window makes cleanup straightforward.
Add a second factor to your login flow
After the user enters their password, generate an OTP and deliver it via a side channel (SMS, email, push notification). Verify the code server-side before granting access.
Frequently asked questions
Are the generated OTPs cryptographically random?
Does the API store or track generated OTPs?
What does the expiresIn field mean?
What is the maximum OTP length?
How is this different from the TOTP endpoint?
Get your API key
Free tier includes 5 requests per minute with no credit card required. Upgrade for higher limits.