jalin_10455
10/28/2025, 4:21 PMAI Evy
10/28/2025, 4:21 PMAI Evy
10/28/2025, 4:22 PM/create-chat-completion [(1) ]() .
Here's how to use it with the Retell SDK :
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) ;
You'll need :
- Your Retell API key (find it in your dashboard)
- A valid chat_id from an existing chat session
- The content field containing the user message
The endpoint requires an Authorization header with the format "Bearer YOUR_API_KEY" .AI Evy
10/28/2025, 4:22 PMAI Evy
10/28/2025, 4:22 PMjalin_10455
10/28/2025, 4:23 PMjalin_10455
10/28/2025, 4:24 PMAI Evy
10/28/2025, 4:24 PMAI Evy
10/28/2025, 4:24 PMAI Evy
10/28/2025, 4:24 PMAI Evy
10/28/2025, 4:24 PMjalin_10455
10/28/2025, 4:25 PMjalin_10455
10/28/2025, 4:25 PMAI Evy
10/28/2025, 4:25 PMAI Evy
10/28/2025, 4:26 PM/create-chat-completion , and other chat endpoints follow the same pattern:
- /create-chat for creating a chat session [(2) ]()
- /get-chat/{chat_id} for retrieving chat details [(3) ]()
- /list-chat for listing all chats [(4) ]()
These endpoints are accessed through the Retell SDK using client.chat.createChatCompletion(), client.chat.create(), and client.chat.retrieve() methods respectively [(1) ]() [(2) ]() [(3) ]() .
The version distinction (v1/v2) mentioned in the previous discussion appears to be specific to the Call API, not the Chat API [(5) ]() [(1) ]() [(2) ]() [(4) ]() .AI Evy
10/28/2025, 4:26 PMAI Evy
10/28/2025, 4:26 PMjalin_10455
10/28/2025, 4:27 PMAI Evy
10/28/2025, 4:27 PMAI Evy
10/28/2025, 4:28 PM/v1/ in the URL path [(1) ]() [(2) ]() .
The correct full URL for the Create Chat Completion endpoint is:
<https://api.retellai.com/create-chat-completion>
[(1) ]() [(3) ]()
Similarly, other Chat API endpoints follow the same pattern without version numbers:
- ` for creating a chat session [(2) ]()
- ` for listing chats [(4) ]()
The /v1/ or /v2/ versioning appears to be specific to the Call API, not the Chat API [(1) ]() [(2) ]() [(4) ]() .AI Evy
10/28/2025, 4:28 PMAI Evy
10/28/2025, 4:28 PM