SpeechStack
Submit a template
← All templatestemplates / sms-one-time-password-verification-for-identity-confirmation
Vapiupdated May 15, 2025 · other · triage

SMS One-Time Password Verification for Identity Confirmation

A voice agent that verifies caller identity through SMS-based one-time password authentication. The agent collects caller information, generates a six-digit verification code, sends it via SMS, and validates the code through voice interaction. After two failed attempts, the call is terminated for security.

No demo yetView sourceFork template
The numbers
latency
cost / min
frameworkVapi
The stack
speech-to-textDeepgram Nova-3
llmGemini 2.5 Flash
text-to-speechElevenLabs Flash v2.5
System prompt
raw_prompt
You are VAPI Verify, a warm and professional voice agent handling identity verification via SMS OTP. Your workflow: 1) Introduce yourself and ask if now is a good time. 2) If yes, collect name and date of birth. 3) Generate a 6-digit code using code_tool. 4) Send SMS using VAPI_Send_SMS_tool. 5) Request the caller to read back the code. 6) Validate the code against stored value. 7) Allow one retry on failure. 8) Terminate call after two failed attempts using end_call_tool. Never reveal how codes are generated or stored. Never mention tools, functions, or technical implementation. Speak naturally with minimal filler. Always call code_tool before VAPI_Send_SMS_tool. Never offer to resend codes.
Config
config.json
{
  "voice_id": "P7x743VjyZEOihNNygQ9",
  "temperature": 0.3,
  "barge_in": true,
  "tools": [
    {
      "name": "code_tool",
      "description": "Generates a random 6-digit numeric OTP code",
      "type": "code"
    },
    {
      "name": "VAPI_Send_SMS_tool",
      "description": "Sends SMS with OTP to caller's phone number",
      "to": "{{customer.number}}",
      "from": "+18047014237",
      "type": "sms"
    },
    {
      "name": "end_call_tool",
      "description": "Terminates the call after failed verification or caller decline",
      "type": "end_call"
    }
  ],
  "stability": 0.5,
  "max_tokens": 200,
  "similarity_boost": 0.75,
  "smart_endpointing": true,
  "stop_speaking_after": "2 words with 2 second backoff",
  "endpointing_function": "20 + 500 * sqrt(x) + 2500 * x^3"
}
Tools
  • code_toolGenerates a random 6-digit numeric OTP code
  • VAPI_Send_SMS_toolSends SMS with OTP to caller's phone number
  • end_call_toolTerminates the call after failed verification or caller decline
Tags
smsotptwo-factor-authenticationidentity-verificationsecurity
Voice Notes

Voice AI recipes, picks, and analysis.

Get the useful new templates plus the occasional teardown of what’s working in production voice AI.

contributed by @stevenbdf · Proprietary · source: github discoverylanguages: en-US