High-performance, secure OTP delivery and verification service for applications, portals, and student verification.
All API endpoints require authentication via an API Key provided in the X-API-Key request header. All requests must use HTTPS and submit JSON-encoded payloads.
Production API Base: https://api.nextedu.live/v1 Local API Base: https://api.nextedu.live/v1
Authenticate requests by passing your live API key in the X-API-Key HTTP header.
X-API-Key: NE_live_8f72a394bc881940ef9012cd Content-Type: application/json
* Bearer token format is also accepted: Authorization: Bearer NE_live_...
Dispatches a 6-digit numeric verification code to an Indian 10-digit mobile number.
/v1/otp/send
| Header | Type | Required | Description |
|---|---|---|---|
X-API-Key |
string | Yes | Your assigned NE_live_... key |
Content-Type |
string | Yes | application/json |
{
"phone": "9876543210"
}
{
"success": true,
"message": "OTP sent successfully"
}
{
"success": false,
"error": "Please wait before requesting another OTP.",
"retry_after": 42
}
Validates a 6-digit verification code entered by the user.
/v1/otp/verify
{
"phone": "9876543210",
"otp": "123456"
}
{
"success": true,
"message": "OTP verified successfully"
}
{
"success": false,
"error": "Invalid or expired OTP."
}
To prevent abuse, the gateway enforces multi-layer protection:
| HTTP Status | Meaning | Explanation |
|---|---|---|
200 OK |
Success | Operation completed successfully. |
400 Bad Request |
Invalid Request | Invalid phone number, invalid 6-digit OTP format, or expired code. |
401 Unauthorized |
Invalid API Key | API key is missing or invalid. |
402 Payment Required |
Insufficient Balance | Client wallet balance is below ₹0.10. Recharge required to continue dispatching OTPs. |
403 Forbidden |
Access Denied / Pending | Client account or key is disabled, expired, or pending Admin approval. |
429 Too Many Requests |
Rate Limited | Cooldown in effect or rate limit quota exceeded. Includes retry_after. |
502 Bad Gateway |
Upstream Failure | Upstream provider telecommunication error. |
NextEdu Gateway operates on a transparent, pay-as-you-go micro-billing model:
₹0.10 per successfully dispatched OTP./v1/otp/verify) are 100% free of charge.import requests
API_KEY = "NE_live_xxxxxxxxxxxxxxxxxxxxxxxx"
BASE_URL = "https://api.nextedu.live/v1"
headers = {
"X-API-Key": API_KEY,
"Content-Type": "application/json"
}
# 1. Send OTP
send_res = requests.post(
f"{BASE_URL}/otp/send",
headers=headers,
json={"phone": "9876543210"}
)
print("Send Response:", send_res.json())
# 2. Verify OTP
verify_res = requests.post(
f"{BASE_URL}/otp/verify",
headers=headers,
json={"phone": "9876543210", "otp": "123456"}
)
print("Verify Response:", verify_res.json())
<?php
$apiKey = 'NE_live_xxxxxxxxxxxxxxxxxxxxxxxx';
$baseUrl = 'https://api.nextedu.live/v1';
function callGateway($url, $payload, $apiKey) {
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, [
'Content-Type: application/json',
'X-API-Key: ' . $apiKey
]);
$res = curl_exec($ch);
curl_close($ch);
return json_decode($res, true);
}
// Send OTP
$sendResult = callGateway("$baseUrl/otp/send", ['phone' => '9876543210'], $apiKey);
print_r($sendResult);
// Verify OTP
$verifyResult = callGateway("$baseUrl/otp/verify", ['phone' => '9876543210', 'otp' => '123456'], $apiKey);
print_r($verifyResult);
const API_KEY = "NE_live_xxxxxxxxxxxxxxxxxxxxxxxx";
const BASE_URL = "https://api.nextedu.live/v1";
// 1. Send OTP
async function sendOtp(phone) {
const res = await fetch(`${BASE_URL}/otp/send`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": API_KEY
},
body: JSON.stringify({ phone })
});
return await res.json();
}
// 2. Verify OTP
async function verifyOtp(phone, otp) {
const res = await fetch(`${BASE_URL}/otp/verify`, {
method: "POST",
headers: {
"Content-Type": "application/json",
"X-API-Key": API_KEY
},
body: JSON.stringify({ phone, otp })
});
return await res.json();
}