https://retellai.com/?utm_source=discord&utm_medium=seo logo
how do i find the correct create chat completion e...
# ❓・ai-evy-support
j
@AI Evy how do i find the correct create chat completion endpoint for my Retell account
a
Thanks for tagging me @jalin_10455. I'll look through relevant sources and get back to you shortly.
### Answer The Create Chat Completion endpoint for your Retell account is a POST request to
/create-chat-completion
[(1) ]() . Here's how to use it with the Retell SDK :
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) ;
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" .
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/api-references/create-chat-completion) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
Is v1 or v2 needed in the URL based on my account type?
@AI Evy is v1 or v2 needed in the URL based on my account type?
a
Thanks for the follow-up, @jalin_10455. I'll get back to you soon.
### Answer --- Based on the available sources, I don't have specific information about whether v1 or v2 is needed in the URL based on your account type for the chat completion endpoint. However, I can note that according to a Discord discussion, Retell is transitioning from V1 to V2 of their Call API, with V1 being deprecated and scheduled to stop working after January 1, 2025 [(1) ]() . The sources indicate you should use V2 endpoints for calls rather than the deprecated V1 version . For the most accurate information about which API version to use for chat completion endpoints specifically based on your account type, I'd recommend: Check out these potentially useful sources: - [API Key Overview]() - [Create Web Call]() Would you like me to try to provide a general answer based on my knowledge instead? ---
​ To learn more, see the sources I considered: [[1] Discord message from @gregb5117 on 2024-12-09](https://discord.com/channels/1186424376300679209/1186462578310910112/1315781838907641856) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
what about for chat api
@AI Evy what about for chat api
a
Thanks for the follow-up, @jalin_10455. I'll get back to you soon.
### Answer Based on the documentation, the Chat API endpoints do not require a version number (v1 or v2) in the URL [(1) ]() . The Create Chat Completion endpoint is simply
/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) ]() .
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
@AI Evy so the full URL for chat api would be this https://api.retellai.com/v1/create-chat-completion ?
a
Thanks for the follow-up, @jalin_10455. I'll get back to you soon.
### Answer No, the Chat API endpoints do not include
/v1/
in the URL path [(1) ]() [(2) ]() . The correct full URL for the Create Chat Completion endpoint is:
Copy code
<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) ]() .
​ To learn more, see the sources I considered: [[1] Create Chat Completion](https://docs.retellai.com/deploy/create-chat-completion) [[2] Create Chat](https://docs.retellai.com/api-references/create-chat) [[3] Dashboard test chat results drastically different than create-chat-completion output](https://discord.com/channels/1186424376300679209/1385382711920820274) [[4] List Chat](https://docs.retellai.com/api-references/list-chat) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.