Mikey
04/02/2026, 11:28 AMAI Evy
04/02/2026, 11:28 AMAI Evy
04/02/2026, 11:29 AMjavascript
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 phone number you send SMS from must be a number purchased from Retell or imported to Retell with SMS capability.
## Creating Chat Completions
To generate responses in an SMS conversation, use the Create Chat Completion API: [(3) ]()
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const response = await client.chat.createChatCompletion({
chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
content: 'hi how are you doing?',
}) ;
console.log(response.messages) ;AI Evy
04/02/2026, 11:29 AMAI Evy
04/02/2026, 11:29 AMAI Evy
04/02/2026, 11:29 AM