Public
Like
12
hello-realtime
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.
Viewing readonly version of main branch: v196View latest version
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.
- WebRTC Flow: Browser connects to frontend → creates WebRTC offer →
/rtc
endpoint handles SDP negotiation with OpenAI → observer monitors session - SIP Flow: Phone calls trigger webhook →
/sip
endpoint verifies and accepts call → observer monitors session - Monitoring: Observer establishes WebSocket connection to OpenAI for real-time session logging
frontend/index.html
- Web interface with WebRTC client, audio handling, and real-time connection statusmain.tsx
- Main Hono application entry point that sets up routing and serves the frontendroutes/observer.ts
- WebSocket observer that connects to OpenAI's realtime API for session monitoring and loggingroutes/rtc.ts
- WebRTC endpoint that handles SDP offer/answer negotiation with OpenAI's realtime APIroutes/sip.ts
- SIP webhook endpoint that verifies and accepts incoming phone calls via OpenAI's telephony integrationroutes/utils.ts
- Shared utilities including OpenAI API configuration, session setup, and voice agent instructions