Hello Realtime is a OpenAI Realtime app that supports both WebRTC and SIP (telephone) users. You can access the app via WebRTC at 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
.
/rtc
endpoint handles SDP negotiation with OpenAI/sip
endpoint verifies webhook and accepts callGET /
- serves the WebRTC-based appPOST /rtc
- creates a new WebRTC-based Realtime API sessionPOST /sip
- handles an incoming Realtime API SIP callPOST /observer
- internal endpoint to establish a Realtime API websocket for
session control├── frontend/
│ └── index.html # HTML/JS application for WebRTC
├── main.tsx # Main entrypoint for the val.town app
└── routes/
|
├── agent.ts # Realtime API session configuration and tools
├── observer.ts # Server-side session control for SIP & WebRTC
├── rtc.ts # WebRTC session setup
├── sip.ts # SIP webhook handling and session setup
└── utils.ts # Various HTTP helpers