https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do i implement the chat agent in website , and...
# ❓・ai-evy-support
k
@AI Evy how do i implement the chat agent in website , and can it be integrated in sms as well
a
Thanks for tagging me @kartik_72139. I'll look through relevant sources and get back to you shortly.
### Answer Implementing Chat Agent in Website: Retell AI doesn't provide native integration with chat applications at this moment [(1) ]() . You can only interact with the chat agent via API . To implement chat functionality, you'll need to: 1. Create a chat agent in your Retell dashboard 2. Create a chat session using the
create-chat
API endpoint [(2) ]() 3. Generate responses using the
create-chat-completion
API endpoint Here's an example of creating a chat session :
Copy code
javascript
import Retell from 'retell-sdk';

const client = new Retell({
 apiKey: 'YOUR_RETELL_API_KEY',
}) ;

const chatResponse = await client.chat.createChat({
 agent_id: 'your_agent_id',
}) ;
SMS Integration: Yes, chat agents can be integrated with SMS [(3) ]() [(4) ]() . Retell supports SMS functionality through Twilio integration [(5) ]() . To use SMS capabilities: 1. Enable SMS for your Retell Twilio numbers or bring your own Twilio number 2. Create outbound SMS using the
create-sms-chat
API endpoint [(3) ]() Here's an example of creating an outbound SMS chat :
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',
}) ;
SMS capabilities are currently limited to US numbers only [(5) ]() . **
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[3] Create Outbound SMS](https://docs.retellai.com/api-references/create-sms-chat) [[4] Unlock AI Texting, SMS, & Chatbots with Retell AI Agents | Retell AI | Retell AI](https://www.retellai.com/blog/unlock-ai-texting-with-retell-ai-voice-agents) [[5] Enable SMS capabilities](https://docs.retellai.com/deploy/enable-sms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
k
@AI Evy explain the steps in detail and in easy language
a
Thanks for the follow-up, @kartik_72139. I'll get back to you soon.
### Answer --- ## How to Implement a Chat Agent (Step-by-Step) ### Step 1: Create a Chat Agent Before you can start chatting, you need to create a chat agent [(1) ]() . You have two options : Option A: Create a New Chat Agent 1. Go to the Agents section in your Retell dashboard 2. Click "Create New Agent" 3. Select "Chat Agent" as the agent type 4. Set up your agent settings and prompts Option B: Convert an Existing Voice Agent 1. Open an existing voice agent 2. Click "Convert to Chat Agent" 3. Review the conversion warnings Important: Chat agents don't support voice-specific functions like call transfers or DTMF (press digits) . These features will be automatically removed during conversion . --- ### Step 2: Create a Chat Session To start a conversation, use the
create-chat
API endpoint [(2) ]() . The API will return a
chat_id
that you'll need for the next steps . --- ### Step 3: Generate Responses To get responses from your chat agent, use the
create-chat-completion
API endpoint . The API returns the agent's response in the
messages
array . All conversation history is automatically stored in Retell's database, so you don't need to manage conversation context yourself . --- ### *Step 4: Retrieve Chat Details (Optional) * You can retrieve details about a chat session using the
get-chat
API endpoint . You can also list all chat sessions using the
list-chat
endpoint . --- ### Step 5: End the Chat Session When the conversation is complete, end the chat session using the
end-chat
API endpoint . If Auto-Close Inactive Chats is enabled, chat will automatically end when the timeout is triggered, or you can end them anytime with the
end-chat
API . --- ## SMS Integration Yes, Retell supports SMS
integration through Twilio [(3) ]() . Once you complete the SMS integration setup, you'll have access to [(2) ]() : - Make an outbound SMS button to start a new SMS session - Inbound SMS agent configuration - Outbound SMS agent configuration - Inbound webhook setup for receiving SMS messages Note: SMS capabilities are currently limited to US numbers only [(3) ]() . --- ### How to Enable SMS: You can enable SMS for Retell Twilio numbers or bring your own Twilio number . The setup involves : 1. Get approved for a business profile (free) 2. Get approved for the brand based on business profile ($4 one time application fee for low-volume, $45 one time application fee for standard) 3. Get approved for a SMS campaign ($15 one time application fee) To learn more about enabling SMS, refer to the [Enable SMS](/deploy/enable-sms) guide [(2) ]() . --- **
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[3] Enable SMS capabilities](https://docs.retellai.com/deploy/enable-sms) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.