summerpuppet471
12/15/2025, 7:47 PMAI Evy
12/15/2025, 7:48 PMAI Evy
12/15/2025, 7:48 PMjavascript
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) ;
The content field is the user message you want to inject, and the endpoint returns the new messages generated by the agent in response.
Note that the chat must have a chat_status of ongoing to receive new messages and generate responses. [(3) ]()AI Evy
12/15/2025, 7:48 PMAI Evy
12/15/2025, 7:48 PMsummerpuppet471
12/15/2025, 7:49 PMAI Evy
12/15/2025, 7:49 PMAI Evy
12/15/2025, 7:49 PMrole of user via the content field, which then triggers the agent to generate a response. [(1) ]()
The response object shows messages can have role values of agent or user, but the API input only accepts user content to prompt agent responses.
Check out these potentially useful sources for more details:
- [Create Chat Completion]()
- [Create Chat]()
- [Create chat agent]()
If you need this functionality (human takeover/agent impersonation) , you may want to reach out to Retell support directly via [Contact Sales]() to inquire if this is on the roadmap or available through another method.
Would you like me to try to provide a general answer based on my broader knowledge?AI Evy
12/15/2025, 7:50 PMAI Evy
12/15/2025, 7:50 PM