hello-realtime

Hello Realtime is a OpenAI Realtime app that supports both WebRTC and SIP (telephone) users. You can access the app via WebRTC at https://hello-realtime.val.run, or via SIP by calling 425-800-0042.

This demo shows off the new SIP API, the new all-in-one WebRTC API, and the new server-side websocket interface.

If you remix the app, you'll just need to pop in your own OPENAI_API_KEY (from platform.openai.com), and if you want SIP, the OPENAI_SIGNING_SECRET.

Architecture

  1. WebRTC Flow: Browser connects to frontend → creates WebRTC offer → /rtc endpoint handles SDP negotiation with OpenAI → observer monitors session
  2. SIP Flow: Phone calls trigger webhook → /sip endpoint verifies and accepts call → observer monitors session
  3. Monitoring: Observer establishes WebSocket connection to OpenAI for real-time session logging

Files

  • frontend/index.html - Web interface with WebRTC client, audio handling, and real-time connection status
  • main.tsx - Main Hono application entry point that sets up routing and serves the frontend
  • routes/observer.ts - WebSocket observer that connects to OpenAI's realtime API for session monitoring and logging
  • routes/rtc.ts - WebRTC endpoint that handles SDP offer/answer negotiation with OpenAI's realtime API
  • routes/sip.ts - SIP webhook endpoint that verifies and accepts incoming phone calls via OpenAI's telephony integration
  • routes/utils.ts - Shared utilities including OpenAI API configuration, session setup, and voice agent instructions