trxgames
01/07/2026, 1:28 PMAI Evy
01/07/2026, 1:28 PMAI Evy
01/07/2026, 1:28 PMauto_reconnect and respond to Retell's ping_pong events to keep the connection alive
- Stream partial responses earlier so there's no long silence
- Catch send errors and stop writing after the socket closes
- Ensure your server supports persistent websockets (not serverless with short timeouts)
Could you share more context about your setup? For example:
- Are you using a custom LLM or the Retell LLM?
- Is this happening on inbound/outbound calls or web calls?
- Any error messages you're seeing?
This would help narrow down the issue.AI Evy
01/07/2026, 1:28 PMAI Evy
01/07/2026, 1:28 PMtrxgames
01/07/2026, 1:29 PMtrxgames
01/07/2026, 2:14 PMtrxgames
01/07/2026, 2:15 PMAI Evy
01/07/2026, 2:15 PMAI Evy
01/07/2026, 2:15 PMAI Evy
01/07/2026, 2:15 PMAI Evy
01/07/2026, 2:15 PMtrxgames
01/07/2026, 2:19 PMAI Evy
01/07/2026, 2:19 PMAI Evy
01/07/2026, 2:19 PMdata attribute is a JSON object stringified. [(1) ]()
Your Server → Retell Events:
When responding to Retell, you send JSON with a response_type field. For responses, use:
json
{
"response_id": 0,
"content": "How may I help you?",
"content_complete": true,
"end_call": false
}
[(2) ]()
Retell → Your Server Events:
Retell sends JSON with an interaction_type field (update_only, response_required, reminder_required, ping_pong) . [(1) ]()
Key Protocol Points:
- Your server must send the first message upon WebSocket connection (set content to empty string if you want the user to speak first) [(3) ]()
- When interaction_type is response_required, you must send a response back
- You can stream responses or send them in one go (streaming recommended for lower latency) [(1) ]()
Example Response Handler:
javascript
const res: RetellResponse = {
response_id: request.response_id,
content: "I am sorry, can you say that again?",
content_complete: true,
end_call: false,
};
ws.send(JSON.stringify(res) ) ;
[(2) ]()
Check out the [Node Demo Repository]() or [Python Demo Repository]() for complete examples. [(3) ]()AI Evy
01/07/2026, 2:19 PMAI Evy
01/07/2026, 2:19 PMtrxgames
01/07/2026, 3:18 PMAI Evy
01/07/2026, 3:18 PMAI Evy
01/07/2026, 3:18 PMstt_mode which can be set to "fast" or "accurate") [(1) ]() , custom functions, and LLM response formats—but they don't detail the raw audio input format for the STT pipeline itself.
For the custom LLM WebSocket integration, **Retell handles the STT internally**—your custom LLM server receives already-transcribed text from Retell (as JSON with the transcript in the payload) , and you send back text responses. You don't send audio directly to Retell's STT in that flow.
If you're asking about sending raw audio to Retell, I'd recommend checking:
- [LLM WebSocket documentation]()
- [Contact Sales]()
- [Retell AI GitHub]()
Could you clarify your use case? Are you trying to:
1. Send audio directly to Retell's STT?
2. Receive transcriptions in your custom LLM server?
3. Something else?
This will help me point you to the right resources.AI Evy
01/07/2026, 3:18 PMAI Evy
01/07/2026, 3:18 PMtrxgames
01/07/2026, 3:24 PMAI Evy
01/07/2026, 3:24 PMAI Evy
01/07/2026, 3:25 PMconvertUnsigned8ToFloat32 and convertFloat32ToUnsigned8 for PCM audio representation. [(1) ]()
However, the typical Retell architecture handles STT internally—you connect via:
- Phone calls (SIP/PSTN) : Retell handles the audio and STT
- **Web calls**: The Web SDK handles audio capture and STT
- **Custom LLM**: You receive already-transcribed text from Retell
If you're trying to stream raw audio to Retell's STT outside of these standard flows, that's not a documented use case in my available sources.
Could you clarify your setup?
1. Are you using the Web SDK and trying to send custom audio?
2. Are you trying to bypass Retell's phone/web infrastructure entirely?
3. What's the source of your "live call audio"?
For direct support on custom audio streaming to STT:
- Visit [Contact Sales]()
- Visit [)
Would you like a general answer about common audio streaming formats for STT systems?AI Evy
01/07/2026, 3:25 PMAI Evy
01/07/2026, 3:25 PMtrxgames
01/17/2026, 3:49 PMAI Evy
01/17/2026, 3:49 PMAI Evy
01/17/2026, 3:49 PMRetellWebChat widget configuration in my available sources. The sources I have cover the Retell Web SDK for voice calls (using retell-client-js-sdk) , not the chat widget you're referencing.
For web voice calls, the documented approach uses:
javascript
import { RetellWebClient } from "retell-client-js-sdk";
const retellWebClient = new RetellWebClient() ;
[(1) ]()
A few things to check with your chat widget code:
1. Replace the placeholder — You have agentId: "YOUR_RETELL_AGENT_ID" which needs to be replaced with your actual agent ID
2. Agent configuration — Ensure your agent is configured for chat mode (not just voice calls)
3. Console errors — Check your browser's developer console for any JavaScript errors when the page loads
For the chat widget specifically, I'd recommend:
- Check out these potentially useful sources: [Connect to web call]() , [Create Web Call]()
- Visit [Contact Sales]()
- Visit [)
Would you like me to try providing a general answer about debugging embedded widget scripts, or can you share any error messages from your browser console?AI Evy
01/17/2026, 3:49 PMAI Evy
01/17/2026, 3:49 PMtrxgames
01/17/2026, 3:49 PMtrxgames
01/17/2026, 4:01 PMAI Evy
01/17/2026, 4:01 PMAI Evy
01/17/2026, 4:02 PM<https://dashboard.retellai.com/retell-widget.js>
[(1) ]()
Here's the correct chat widget code to embed in your HTML <head> tag:
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_CHAT_AGENT_ID"
data-agent-version="YOUR_AGENT_VERSION"
data-title="YOUR_CUSTOM_TITLE"
data-logo-url="YOUR_LOGO_URL"
data-color="YOUR_CUSTOM_COLOR"
data-bot-name="YOUR_BOT_NAME"
data-popup-message="YOUR_POPUP_MESSAGE"
data-show-ai-popup="true"
data-show-ai-popup-time="5"
data-auto-open="false"
></script>AI Evy
01/17/2026, 4:02 PMdata-public-key - Your Retell public key (get it from Dashboard → Keys → Public Keys) , [(2) ]()
- data-agent-id - Your chat agent ID [(1) ]()
Optional attributes:
- data-agent-version - Agent version (defaults to latest if unset)
- data-title - Custom chat window title
- data-logo-url - URL of your logo image
- data-color - Hex color code for widget theme (e.g., "#FFA07A")
- data-bot-name - Bot name for popup messages
- data-popup-message - Popup message before users open chat
- data-show-ai-popup - Set to "true" to enable popup messages
- data-auto-open - Set to "true" to auto-open chat widget on page load
Important: You need a Retell Public Key (not an API key) for the chat widget. Create one in Dashboard → Keys → + Add Key → Public Key, and specify your website domain. [(2) ]()AI Evy
01/17/2026, 4:02 PMAI Evy
01/17/2026, 4:02 PMtrxgames
01/17/2026, 4:25 PMAI Evy
01/17/2026, 4:25 PMAI Evy
01/17/2026, 4:25 PMdata-agent-version is set to "0".
[(2) ]()
3. Check your Public Key configuration
Make sure your public key is configured with the correct domain where the widget is embedded.
[(1) ]()
4. Correct widget setup
Confirm your script looks like this in the <head> tag:
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
type="module"
data-public-key="YOUR_RETELL_PUBLIC_KEY"
data-agent-id="YOUR_CHAT_AGENT_ID"
data-agent-version="0"
data-title="YOUR_CUSTOM_TITLE"
></script>
, [(3) ]()
5. Test your agent in the dashboard first
Use Manual Chat or AI Simulated Chat in the agent builder to confirm your agent responds correctly before embedding.
Troubleshooting steps:
- Check your browser's developer console for any JavaScript errors
- Verify the agent ID and public key are correct (no typos)
- Ensure the domain in your public key settings matches where you're testing
If the agent works in the dashboard but not in the widget, the issue is likely with the public key domain configuration or the agent ID.
Would you like help verifying any of these specific items?AI Evy
01/17/2026, 4:25 PMAI Evy
01/17/2026, 4:25 PMtrxgames
01/17/2026, 4:51 PMAI Evy
01/17/2026, 4:51 PMAI Evy
01/17/2026, 4:51 PMAI Evy
01/17/2026, 4:51 PMAI Evy
01/17/2026, 4:51 PMlocalhost to your allowed domains list
2. Path-Based Domain Limitation
If your site loads on a subpath (like website.com/page/) , you may only be able to whitelist the root domain (website.com) . One user reported this exact issue with Google Sites and WordPress sites loading on subpaths. [(1) ]() , [(3) ]()
3. Check Browser Console for Specific Errors
Open DevTools (F12) and look for:
- create-chat 401 error → Public key/domain mismatch
- get-chat/undefined error → Missing or incorrect agent ID, or the widget script loading before config
4. Verify Agent is a Chat Agent
Confirm in your Retell dashboard that you're using a chat agent ID, not a voice agent ID.
5. Test Agent in Dashboard First
Use the built-in testing in the agent builder to confirm your agent responds before embedding.
If you're still stuck, could you share:
- The exact error message from your browser console?
- What domain you're embedding on vs. what's in your public key settings?
- Whether the agent responds when tesAI Evy
01/17/2026, 4:51 PMtrxgames
01/17/2026, 5:05 PMAI Evy
01/17/2026, 5:05 PMAI Evy
01/17/2026, 5:05 PMcreate-chat 401 error → Public key/domain mismatch [(3) ]()
- get-chat/undefined error → Missing or incorrect agent ID, or the widget script loading before configuration is ready
Once you share the specific error, I can help you troubleshoot the exact issue.AI Evy
01/17/2026, 5:05 PMAI Evy
01/17/2026, 5:05 PM