The web widget lets your customers talk to your AI agent directly in their browser -- no phone call needed. It uses WebRTC technology for real-time audio streaming, delivering low-latency voice conversations from any modern browser.
The web widget appears in two places within Zentrix Agent Studio:
/agents/[slug] includes a "Try it" widgetYou can also embed the widget on your own website using the Widget Token API.
/api/widget/token endpointaccess_token and call_idThe VoiceWidget component goes through four states during a call:
| State | What the User Sees |
|---|---|
| Idle | A "Start Call" button. Microphone permission may be requested. |
| Connecting | A loading indicator while the WebRTC connection is established (typically 1-2 seconds). |
| Active | The call is live. The user sees mute and end call controls, plus a visual indicator that the agent is listening or speaking. |
| Ended | The call has finished. A summary or "Call Again" button is displayed. |
During an active call, the widget provides:
To add a voice widget to your own website, use the Widget Token API to create a call session, then connect using the Zentrix voice SDK:
<!-- Include the Zentrix Voice SDK -->
<script src="https://agentstudio.brtneura.com/widget-sdk.js"></script>
<button id="call-btn">Talk to AI Agent</button>
<script>
const btn = document.getElementById('call-btn');
btn.addEventListener('click', async () => {
// 1. Request a token from your backend
const res = await fetch('https://agentstudio.brtneura.com/api/widget/token', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ agentId: 'your-agent-id' }),
});
const { accessToken } = await res.json();
// 2. Start the call using the voice SDK
const voiceClient = new ZentrixVoiceClient();
await voiceClient.startCall({ accessToken });
// 3. Handle events
voiceClient.on('call_started', () => {
btn.textContent = 'Call in progress...';
});
voiceClient.on('call_ended', () => {
btn.textContent = 'Talk to AI Agent';
});
});
</script>Tip: The /api/widget/token endpoint requires a valid agent ID. Make sure you use the agent's database ID (UUID), not the slug. You can find the ID in your My Agents dashboard or via the admin panel.
POST /api/widget/token
Request body:
{
"agentId": "uuid-of-your-agent"
}Response:
{
"accessToken": "voice-access-token-xxx",
"callId": "call-id-xxx"
}The access token is single-use and expires after the call ends. Request a new token for each call session.
For full API details, see the Widget Token API reference.
The web widget requires:
Unlike phone calls, the web widget does not require a phone number or telephony setup. It connects directly to the voice platform over the internet. This makes it ideal for:
A Product by BRTNeura Technology LLP
Last updated: 2026-03-05