kartik_72139
11/16/2025, 9:30 AMAI Evy
11/16/2025, 9:30 AMAI Evy
11/16/2025, 9:30 AMcreate-chat API endpoint [(2) ]()
3. Generate responses using the create-chat-completion API endpoint
Here's an example of creating a chat session :
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 :
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) ]() .
**AI Evy
11/16/2025, 9:30 AMAI Evy
11/16/2025, 9:30 AMkartik_72139
11/16/2025, 9:32 AMAI Evy
11/16/2025, 9:32 AMAI Evy
11/16/2025, 9:32 AMcreate-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 SMSAI Evy
11/16/2025, 9:32 AMAI Evy
11/16/2025, 9:32 AMAI Evy
11/16/2025, 9:32 AM