Quick Start Guide
This guide will help you set up Highway locally and create your first automated verification call in minutes.Prerequisites
Before you begin, ensure you have the following:Twilio Account
Sign up for a Twilio account and obtain:
- Account SID
- Auth Token
- Twilio Phone Number (with voice capabilities)
OpenAI API Key
Get your OpenAI API key from the OpenAI Platform.
You’ll need access to the GPT-4o Realtime API. Ensure your account has the necessary permissions.
Supabase Project
Installation
Install Backend Dependencies
Navigate to the backend directory and install dependencies:The backend uses the following key dependencies:
express- Web server frameworkexpress-ws- WebSocket support for Expresstwilio- Twilio SDK for phone callsopenai- OpenAI API client@supabase/supabase-js- Supabase client
Configuration
Configure Backend Environment
Create a
.env file in the highway-backend directory with your credentials:Configure Supabase Connection
Update the Supabase configuration in your backend and frontend code:Backend (Frontend (uses environment variables):
Create a
highway-backend/routes.js and highway-backend/websocket.js):.env.local file in highway-frontend:Running Highway
Start the Backend Server
In the You should see:The backend server handles:
highway-backend directory, start the Express server:- REST API endpoints for initiating calls
- WebSocket connections for real-time audio streaming
- Integration with Twilio and OpenAI
Start the Frontend Development Server
In a new terminal, navigate to The frontend will be available at
highway-frontend and start the Next.js development server:http://localhost:3001 (or the port shown in the terminal).Create Your First Verification
Access the Dashboard
Open your browser and navigate to
http://localhost:3001. You’ll see the Highway dashboard with the “Pending Verifications” table.Add a Verification
Click the “Add verification” button and fill in the form:Click “Add verification” to create the record.
- Name: Customer’s name (e.g., “John Doe”)
- Phone Number: 10-digit phone number (e.g., “5551234567”)
- Background: Context for the call (e.g., “customer signed up for a loan”)
- Verification Data: JSON object with data to verify
Initiate the Call
In the verifications table, find your newly created verification and click the “Initiate call” button.The system will:
- Create a call record in the database
- Initiate a Twilio call to the specified phone number
- Establish a WebSocket connection for audio streaming
- Connect to OpenAI’s Realtime API
- Begin the AI-powered verification conversation
Answer the Call
When the phone rings, answer it. You’ll hear the AI agent:
- Introduce itself as an agent from Olive Financial
- Explain the purpose of the call
- Ask verification questions based on your data
- Conduct a natural conversation
- Thank you and hang up when complete
The AI uses OpenAI’s “shimmer” voice and is configured to be cheerful and professional.
View Call Results
Navigate to the “Calls” page (if available) or check your Supabase database to see the call status:
- successful_call: Identity verified successfully
- unsuccessful_call: Identity not verified
- user_hung_up: Customer ended the call early
- system_error: Technical error occurred
- in_progress: Call is ongoing
- Customer name and phone number
- Call status with color-coded badges
- Timestamp of the call
- Verification data that was used
What’s Happening Under the Hood?
When you initiate a call, here’s the flow:- Frontend sends a POST request to
/call-customerwith phone number and verification ID - Backend creates a call record in Supabase with status “in_progress”
- Twilio initiates the phone call with TwiML containing a WebSocket stream URL
- WebSocket connection establishes between Twilio and your backend at
/media-stream/:id/:numid - Backend connects to OpenAI Realtime API and fetches verification data from Supabase
- Audio streaming begins bidirectionally:
- Customer audio → Twilio → Backend WebSocket → OpenAI
- OpenAI response → Backend WebSocket → Twilio → Customer
- AI conversation proceeds based on the session configuration and verification data
- Status updates occur when the AI calls the
call_reflection_datafunction - Call ends when the AI calls
hang_up_callor the customer hangs up
Next Steps
Architecture Overview
Learn about Highway’s system architecture and component interactions
Customize AI Behavior
Customize the AI agent’s voice, instructions, and conversation flow
API Reference
Explore all available API endpoints and WebSocket events
Deployment Guide
Deploy Highway to production with cloud providers
Troubleshooting
Call not connecting
Call not connecting
- Verify your Twilio credentials are correct in
.env - Ensure your Twilio phone number has voice capabilities
- Check that your backend is publicly accessible (use ngrok for local testing)
- Verify the WebSocket URL in the TwiML is correct
No AI response during call
No AI response during call
- Check that your OpenAI API key is valid and has Realtime API access
- Verify the WebSocket connection to OpenAI is established (check logs)
- Ensure verification data exists in Supabase for the given ID
- Check backend logs for any error messages
Frontend can't reach backend
Frontend can't reach backend
- Verify the API_BASE_URL in
src/utils/api.tsis correct - Check CORS configuration in backend
index.js - Ensure backend server is running on the expected port
- Test the backend health endpoint:
GET /
Supabase connection errors
Supabase connection errors
- Verify your Supabase URL and anon key are correct
- Ensure the
verificationsandcallstables exist - Check Row Level Security (RLS) policies allow the operations
- Verify your Supabase project is active