Call (V2)
Phone Number
Agent
Retell LLM Response Engine (for single / multi prompt agent)
Knowledge Base
Batch call
Account
Custom Telephony
Custom LLM
Chat
Create Chat Completion
Create a chat completion message
POST
/
create-chat-completion
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
async function main() {
const response = await client.chat.createChatCompletion({
chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
content: 'hi how are you doing?',
});
console.log(response.messages);
}
main();
{
"messages": [
{
"message_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"role": "agent",
"content": "hi how are you doing?",
"created_timestamp": 1703302428855
}
]
}
Authorizations
Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"
Body
application/json
Response
201
application/json
Successfully created chat completion.
The response is of type object
.
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
});
async function main() {
const response = await client.chat.createChatCompletion({
chat_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
content: 'hi how are you doing?',
});
console.log(response.messages);
}
main();
{
"messages": [
{
"message_id": "Jabr9TXYYJHfvl6Syypi88rdAHYHmcq6",
"role": "agent",
"content": "hi how are you doing?",
"created_timestamp": 1703302428855
}
]
}
Assistant
Responses are generated using AI and may contain mistakes.