Overview
Traditional voice AI systems stitch together three sequential technologies: Speech-to-Text (STT), a Large Language Model (LLM), and Text-to-Speech (TTS). Each handoff adds 150ms to 400ms of lag, resulting in noticeable latency and stripped vocal inflections. The OpenAI Realtime API (gpt-4o-realtime-preview) processes speech natively from audio input to audio output over a bidirectional WebSocket. In BrokerOS, the OpenAI Realtime integration is implemented in integrations/voice/agents/openai-realtime/src/index.ts under the Turborepo workspace package @brokeros/int-agent-openai-realtime.
BrokerOS administrators configure the OpenAI Realtime engine directly within the Web UI at Dashboard -> Marketing -> Voice -> Settings. All API keys are encrypted with AES-256-GCM and stored in PostgreSQL (VoiceAgentIntegration).
Architecture and Dispatch Sequence
The OpenAI Realtime integration implements theIVoiceAgentProvider contract from @brokeros/types. Audio streams over a full-duplex WebSocket connection between OpenAI and the BrokerOS Media Gateway.
Step 1: Obtain Credentials from OpenAI Platform
- Log into your account at platform.openai.com.
- Ensure your organization project has access to
gpt-4o-realtime-preview. - Navigate to API Keys in the left sidebar menu.
- Click Create new secret key and copy your private key (
sk-proj-...).
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 select OpenAI Realtime API.
- Fill in the modal connection fields:
- Click Save & Verify Engine. BrokerOS verifies the key via
GET https://api.openai.com/v1/models, encrypts it using AES-256-GCM, and saves it inVoiceAgentIntegration.
Native Voice Persona Selection
The integration exposes OpenAIβs eight native neural voice personas in the Agent Composer Studio:- Alloy: Balanced, versatile professional tone
- Ash: Warm, authoritative cadence
- Ballad: Soft, calm, and reassuring
- Coral: Energetic, engaging, and friendly
- Echo: Confident, articulate male voice
- Sage: Experienced, mature executive presence
- Shimmer: Expressive, clear, and upbeat
- Verse: Direct, dynamic, and crisp
Integration Implementation Details
The OpenAI Realtime client is defined inintegrations/voice/agents/openai-realtime/src/index.ts.
Live Verification Engine
When tested in the UI,OpenAIRealtimeAgentClient.validateCredentials() executes an authenticated health check: