First integration in five minutes
Auth SDK, OTP SDK, curl or MCP — one platform, two namespaces.
Auth + OTP SDK
Sessions via @kolayotp/auth-client / @kolayotp/react; OTP via @kolayotp/sdk.
npm i @kolayotp/auth-client @kolayotp/sdk
MCP server
Ready-made MCP integration so AI agents can send and verify OTPs.
npx @kolayotp/mcp
OpenAPI
OTP and Auth schemas served separately; ready for client generation.
GET /v1/openapi.json
$ curl -X POST https://api.kolayotp.com/v1/auth/sign-in/email-password \
-H "X-KolayOTP-Publishable-Key: pk_live_..." \
-H "Content-Type: application/json" \
-d '{"email":"you@acme.com","password":"••••••••"}'
# Session cookies: __session (JWT) + __client (refresh)
# Optional AAL2: POST /v1/auth/sign-in/mfa/totp
$ curl -X POST https://api.kolayotp.com/api/v1/otp/send \
-H "Authorization: Bearer kotp_live_..." \
-H "idempotency-key: $(uuidgen)" \
-d '{"recipient":"+905551234567","locale":"tr"}'import { AuthClient } from "@kolayotp/auth-client";
import { KolayOTP } from "@kolayotp/sdk";
const auth = new AuthClient({
publishableKey: process.env.PK_KEY!,
baseUrl: "https://api.kolayotp.com",
});
const session = await auth.signInEmailPassword({
email: "you@acme.com",
password: process.env.USER_PASSWORD!,
});
// Cookies / JWT minted by KolayOTP — no local session.create()
const kotp = new KolayOTP({ apiKey: process.env.KOTP_KEY });
const otp = await kotp.send({ recipient: "+905551234567", locale: "tr" });
await kotp.verify({ id: otp.id, code: "482913" });{
"mcpServers": {
"kolayotp": {
"command": "npx",
"args": ["-y", "@kolayotp/mcp"],
"env": {
"KOLAYOTP_API_KEY": "kotp_test_..."
}
}
}
}
# Tools exposed to the agent:
# otp_send otp_verify
# otp_resend otp_status
# balance_get| Endpoint | Purpose | Note |
|---|---|---|
| POST /v1/auth/sign-in/* | Sign in | pk_* · cookie/JWT session |
| POST /v1/approvals/request | WYSIWYS approval | Push + step-up token |
| POST /api/v1/otp/send | Send a code | channel optional; routing |
| POST /api/v1/otp/verify | Verify a code | 5 attempts, 10-min TTL |
| GET /v1/openapi.json | Auth OpenAPI | OTP: /api/v1/openapi.json |
SDK & MCP
The TypeScript SDK and MCP server use the same API endpoints. MCP configuration is in the tabs above.MCP demo →
Send your first OTP in five minutes.
No credit card. Start on a sandbox key and switch to live when you're ready.