https://retellai.com/?utm_source=discord&utm_medium=seo logo
can i deploy the chat agent in a website
# ❓・ai-evy-support
d
@AI Evy can i deploy the chat agent in a website?
a
Thanks for tagging me @dzei2234. I'll look through relevant sources and get back to you shortly.
### Answer Yes, you can deploy a chat agent on a website using the Retell Website Widget [(1) ]() . The chat widget provides text-based conversations through a chat interface and is embeddable via a single
<script>
tag . To set up the chat widget, you need : - A chat agent created using the Create Chat Agent guide - Your Retell Public Key - Your Retell agent ID (chat agent) Add this script tag to your HTML within the
<head>
tag :
Copy code
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"
 data-dynamic='{"key": "value"}'
 data-recaptcha-key="YOUR_GOOGLE_RECAPTCHA_SITE_KEY"
></script>
The widget uses the Retell public key system, allowing direct API calls from the frontend with no backend proxy required [(1) ]() [(2) ]() .
​ To learn more, see the sources I considered: [[1] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) [[2] Retell AI Chat Agent – Real-Time Web Chat Automation Widget | Retell AI](https://www.retellai.com/blog/meet-retell-chat-agents-build-smarter-web-chats) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy okay how can i send sms from the chat agent?
a
Thanks for the follow-up, @dzei2234. I'll get back to you soon.
### Answer To send SMS from a chat agent, you can use the Create Outbound SMS API endpoint [(1) ]() . Here's how to implement it using JavaScript:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.createSMSChat({
 from_number: '+12137771234',
 to_number: '+14155551234',
}) ;
console.log(chatResponse.agent_id) ;
The API requires these key parameters : - `from_number`: The phone number to send SMS from in E.164 format (must be a Retell number with SMS capability) - `to_number`: The phone number to send SMS to in E.164 format You can also include optional parameters like : - `override_agent_id`: Override the agent used for this particular chat - `metadata`: Store arbitrary data associated with the chat - `retell_llm_dynamic_variables`: Add dynamic variables for personalization The SMS functionality works with phone numbers that have SMS enabled, and currently only Retell Twilio numbers can enable SMS [(2) ]() . You'll need to enable SMS capability for your phone number first by following the [Enable SMS guide](/deploy/enable-sms) [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Outbound SMS](https://docs.retellai.com/api-references/create-sms-chat) [[2] Send SMS](https://docs.retellai.com/build/single-multi-prompt/send-sms) [[3] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy how can i Create Outbound SMS API endpoint using JavaScript
a
Thanks for the follow-up, @dzei2234. I'll get back to you soon.
​ To learn more, see the sources I considered: [[1] Create Outbound SMS](https://docs.retellai.com/api-references/create-sms-chat) ​
### Answer To create an outbound SMS API endpoint using JavaScript, you can use the Retell SDK [(1) ]() . Here's the exact implementation:
Copy code
javascript
import Retell from 'retell-sdk';
const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.createSMSChat({
 from_number: '+12137771234',
 to_number: '+14155551234',
}) ;
console.log(chatResponse.agent_id) ;
The API endpoint is
POST /create-sms-chat
. The required parameters are: - `from_number`: The phone number to send SMS from in E.164 format (must be a number purchased from Retell or imported to Retell with SMS capability) - `to_number`: The phone number to send SMS to in E.164 format Optional parameters include: - `override_agent_id`: Override the agent used for this particular chat - `override_agent_version`: Override the agent version used - `metadata`: An arbitrary object for storage purposes - `retell_llm_dynamic_variables`: Add optional dynamic variables in key value pairs The API will return a response containing the
chat_id
,
agent_id
,
chat_status
, and other details about the SMS chat session .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
d
@AI Evy the chatbot is not responding after deploying in the website
a
Thanks for the follow-up, @dzei2234. I'll get back to you soon.
### Answer Based on the sources, here are the most common troubleshooting steps for a non-responsive chat widget: 1. Verify Prerequisites Make sure you have [(1) ]() [(2) ]() : - Created a chat agent (not a voice agent) - Your Retell Public Key - Your chat agent ID 2. Check Script Tag Setup Ensure your script tag includes the required attributes [(1) ]() :
Copy code
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"
></script>
3. Verify Agent Type Chat agents are different from voice agents [(2) ]() . If you converted a voice agent to a chat agent, note that voice-specific functions like call transfers and DTMF are automatically removed during conversion . 4. Test Chat Widget The documentation mentions testing functionality, though specific testing steps aren't detailed in the available sources [(1) ]() . 5. Check reCAPTCHA Configuration If you're using reCAPTCHA protection, ensure you've included the Google reCAPTCHA v3 script and enabled reCAPTCHA protection for your public key . One Discord user mentioned having similar issues with the chat widget not working [(3) ]() , suggesting this is a known issue that others have experienced. If these steps don't resolve the issue, I'd recommend checking the browser console for any JavaScript errors or visiting [Contact Sales]() for additional support.
​ To learn more, see the sources I considered: [[1] Retell Website Widget](https://docs.retellai.com/deploy/chat-widget) [[2] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[3] Discord message from @10v32616 on 2025-08-18](https://discord.com/channels/1186424376300679209/1294891368505937952/1406859866408226937) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.