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.
Hello Live is an OpenAI GPT-Live app that supports WebRTC voice calls. You can access the app at hello-live.val.run.
This demo shows off the GPT-Live WebRTC session API and the server-side sideband
websocket used to observe and control a session. It uses Responses
delegation: gpt-live-1 handles the spoken conversation while a backend
Responses model (gpt-5.6-luna) handles reasoning and tool calls (e.g.
end_call). Demo calls are limited to 3 minutes.
If you remix the app, you'll just need to pop in your own OPENAI_API_KEY (from
platform.openai.com).
- WebRTC Flow:
- Browser connects to frontend and creates a WebRTC offer
/rtcendpoint posts the offer + session config toPOST /v1/live/sessionsand returns the SDP answer + session ID- sideband observer attached to monitor the session
- Delegation:
- GPT-Live delegates tool use to the Responses backend
- Function calls arrive on the sideband wrapped in
response.event - The observer returns results with
response.item.createand continues the backend withresponse.create
Rendering mermaid diagram...
GET /- serves the WebRTC-based appPOST /rtc- creates a new GPT-Live WebRTC session; body is the SDP offer, response is{ session: { id }, transport: { type: "webrtc", sdp } }POST /observer/:sessionId- internal endpoint to attach a GPT-Live sideband websocket for session control
├── frontend/
│ └── index.html # HTML/JS application for WebRTC
├── main.tsx # Main entrypoint for the val.town app
└── routes/
├── agent.ts # GPT-Live session configuration, delegation, and tools
├── observer.ts # Server-side sideband control for WebRTC
├── rtc.ts # WebRTC session setup
└── utils.ts # Various HTTP helpers
- Drive
audioActive/callEndingfrom reflectedsession.output_audio.deltaevents so hangup waits for the goodbye to finish playing - Send
session.closefrom the browser on Stop and wait forsession.closed - Render transcript deltas as captions