delightful_parrot_58955
08/07/2025, 6:36 AMAI Evy
08/07/2025, 6:36 AMAI Evy
08/07/2025, 6:36 AMjavascript
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) ;
Then, use the returned chat_id for the chat completion request [(2) ]() :
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
08/07/2025, 6:36 AMchat_id you're using exists and has "ongoing" status [(4) ]()
- The content parameter is included in your request (it's required) [(2) ]()
If you continue experiencing this error after verifying these elements, I'd recommend checking if there are any remaining voice-specific configurations in your converted agent that might be causing conflicts.AI Evy
08/07/2025, 6:36 AMAI Evy
08/07/2025, 6:36 AMdelightful_parrot_58955
08/07/2025, 6:40 AMAI Evy
08/07/2025, 6:40 AMAI Evy
08/07/2025, 6:40 AMAI Evy
08/07/2025, 6:40 AMallow_user_dtmf and user_dtmf_options parameters that control how keypad input is processed [(2) ]() [(3) ]() [(4) ]() :
json
"allow_user_dtmf": true,
"user_dtmf_options": {
"digit_limit": 25,
"termination_key": "#",
"timeout_ms": 8000
}
[(2) ]() [(3) ]()
Since chat agents don't have phone keypads, these DTMF nodes and configurations become incompatible and can cause internal server errors when the system tries to process them in a chat context [(1) ]() [(5) ]() .
When converting voice agents to chat agents, it's important to remove or replace any DTMF-related functionality before the conversion to avoid these errors. Your experience confirms this is a critical step in the conversion process.AI Evy
08/07/2025, 6:40 AMAI Evy
08/07/2025, 6:40 AM