https://retellai.com/?utm_source=discord&utm_medium=seo logo
we are using "create-chat-completion" API and in t...
# ❓・ai-evy-support
m
@AI Evy we are using "create-chat-completion" API and in the middle of the chat conversion it responded with "status": "error", "message": "Internal Server Error". What could be the cause?
a
Thanks for tagging me @mpunk. I'll look through relevant sources and get back to you shortly.
### Answer Based on the available sources, there are several potential causes for Internal Server Error when using the create-chat-completion API [(1) ]() : Common causes include: 1. Invalid chat_id - The chat session may not exist or may have already ended 2. Authentication issues - Verify your API key is correct in the Authorization header 3. Malformed request body - Ensure required fields
chat_id
and
content
are properly formatted Known system issues: The sources show that Internal Server Errors have been reported by other users for various API endpoints [(2) ]() [(3) ]() . In some cases, these were related to JSON length limits or system-level issues that required team intervention [(3) ]() . Troubleshooting steps: 1. Verify the chat session is still active using the get-chat API [(4) ]() 2. Check that your request format matches the documented structure [(1) ]() :
Copy code
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) ;
3. Ensure the chat session hasn't exceeded any limits or timeouts [(4) ]() If the issue persists after verification, it may be a system-level problem that requires support team assistance, as similar Internal Server Errors have been reported and resolved by the Retell team [(2) ]() [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/api-references/create-chat-completion) [[2] internal server error on create knowledge base by API](https://discord.com/channels/1186424376300679209/1391417148215136376) [[3] [Critical] Creating Any Node Results in Internal Server Error](https://discord.com/channels/1186424376300679209/1407954535355383869) [[4] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
m
I see. Is it not because we are using Agent Transfer in chat agent? @AI Evy
a
Thanks for the follow-up, @mpunk. I'll get back to you soon.
### Answer Based on the available sources, there's an important limitation regarding transfer functionality in chat agents. According to the documentation, chat agents do not support certain voice-specific functions like call transfers [(1) ]() . The sources specifically state that "Chat agents do not support certain voice-specific functions like call transfers, DTMF (press digits) , or telephony features. During conversion, such nodes or functions will be automatically removed" . Additionally, the transfer call feature documentation confirms that "This feature only works during phone calls instead of web calls" [(2) ]() , and the troubleshooting guide emphasizes that "Call transfer is only supported for phone calls, **not web calls**" [(3) ]() . So yes, attempting to use Agent Transfer in a chat agent could indeed be the cause of your Internal Server Error. The system may be encountering an error when trying to process transfer functionality that isn't supported for chat-based interactions. To resolve this, you would need to either: 1. Remove the transfer functionality from your chat agent 2. Use a voice agent instead if transfer capabilities are required for your use case
​ To learn more, see the sources I considered: [[1] Create chat agent](https://docs.retellai.com/build/create-chat-agent) [[2] Transfer call](https://docs.retellai.com/build/single-multi-prompt/transfer-call) [[3] Debug call transfer failure](https://docs.retellai.com/reliability/call-performance) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.