Overview
Vapi is an AI voice platform that orchestrates real-time speech recognition, LLM reasoning, and neural text-to-speech synthesis into conversational voice agents. In BrokerOS, the Vapi integration is implemented inintegrations/voice/agents/vapi/src/index.ts under the Turborepo workspace package @brokeros/int-agent-vapi.
BrokerOS administrators configure and manage Vapi directly inside the Web UI at Dashboard -> Marketing -> Voice -> Settings. All API credentials are encrypted with AES-256-GCM and stored in PostgreSQL (VoiceAgentIntegration), requiring zero server restarts or .env modifications.
Architecture and Dispatch Sequence
The Vapi integration implements theIVoiceAgentProvider contract from @brokeros/types. Outbound calls can be dispatched either directly via Vapi’s telephone infrastructure or coupled with custom Twilio SIP credentials.
Step 1: Obtain Credentials from Vapi
- Log into your account at dashboard.vapi.ai.
- Navigate to API Keys in the left sidebar menu.
- Click Create API Key and copy your private key.
- (Optional) Under Phone Numbers, purchase a number or import your Twilio SIP credentials to dial using your firm’s caller ID.
Step 2: Connect in the BrokerOS Web Dashboard
In your BrokerOS dashboard:- Navigate to Dashboard -> Marketing -> Voice -> Settings.
- Select the Gateways & Voice Platforms tab (
/dashboard/marketing/voice/settings?tab=providers). - Click the AI Voice Platforms sub-tab.
- Click Add Platform and choose Vapi AI.
- Fill in the connection modal fields:
- Click Save & Verify Engine. BrokerOS immediately tests authentication via
GET https://api.vapi.ai/assistant, discovers configured assistants, encrypts the key with AES-256-GCM, and saves it inVoiceAgentIntegration.
Step 3: Webhook Telemetry Handling
BrokerOS automatically configures the webhook destination URL during outbound dispatch calls. When a call completes, Vapi posts anend-of-call-report event to:
parseVapiWebhookEvent parser automatically extracts:
- Audio recording URL (streamed to CRM timeline)
- Complete turn-by-turn speech transcript
- Customer sentiment analysis (Positive, Neutral, Negative)
- Qualification parameters (Budget, Timeline, Bedroom preferences)
- Disposition status (
COMPLETED,NO_ANSWER,BUSY,VOICEMAIL,FAILED)
Integration Implementation Details
The Vapi integration logic is maintained inintegrations/voice/agents/vapi/src/index.ts and integrations/voice/agents/vapi/src/vapi-dispatcher.ts.
Live Verification Engine
When saved in the UI,VapiAgentClient.validateCredentials() executes an authenticated health check: