Build and integrate
What belongs on the server for a browser-based voice agent?
Keep durable credentials and authorization for business actions on the server. A browser can manage device permissions and the media session without having unrestricted model or tool access.
Issue limited session access
If the provider documents short-lived client credentials, issue them server-side only after enforcing your application limits. Keep long-lived keys out of the browser bundle.
Validate each action independently
Use authenticated application context for access checks and verify tool inputs before changing bookings or records. The model's tool request is not permission to perform the action.
Fail clearly
Test denied microphone permission, expired credentials and a disconnected browser. A short-lived session should fail cleanly without leaving a partially executed task hidden from the user.
Sources and scope
Sources checked: .
- OpenAI: Realtime API overview
Introduces the Realtime API, bidirectional transports and media/application responsibilities.
- Google: Live API capabilities
Documents current Live API capabilities, session options, modalities and speech behaviour.