kker4m
09/05/2025, 12:49 PMAI Evy
09/05/2025, 12:49 PMAI Evy
09/05/2025, 12:50 PMAI Evy
09/05/2025, 12:50 PMAI Evy
09/05/2025, 12:50 PMAI Evy
09/05/2025, 12:50 PMkker4m
09/05/2025, 12:50 PMAI Evy
09/05/2025, 12:50 PMAI Evy
09/05/2025, 12:51 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
The API creates a chat session using your existing voice agent's configuration, including its response engine, prompts, and tools . This allows you to test the conversational logic of your voice agent through text-based chat messages before deploying it for voice calls .
The response includes details like chat_id, agent_id, chat_status, transcript, and message history with tool calls . This gives you the same testing capabilities you see in the UI, but programmatically accessible through the API .AI Evy
09/05/2025, 12:51 PMAI Evy
09/05/2025, 12:51 PMAI Evy
09/05/2025, 12:51 PMkker4m
09/05/2025, 12:51 PMAI Evy
09/05/2025, 12:51 PMAI Evy
09/05/2025, 12:52 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
[(1) ]()
If you want to test your voice agent's conversational logic through text, you'll need to convert it to a chat agent first, which will create a separate agent optimized for text-based interactions [(2) ]() .AI Evy
09/05/2025, 12:52 PMAI Evy
09/05/2025, 12:52 PM