Tubussie
01/13/2026, 7:12 PMAI Evy
01/13/2026, 7:12 PMAI Evy
01/13/2026, 7:13 PMdata-agent-version attribute is optional—if unset, it uses the latest version. [(1) ]()
To find the version number for your chat agent, you can use the Get Chat Agent Versions API endpoint:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatAgentResponses = await client.chatAgent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(chatAgentResponses) ;
[(2) ]()
This returns an array of all versions for that agent. Each version object includes a version field (integer) that you can use for data-agent-version.
Example widget setup with a specific version:
html
<script
id="retell-widget"
src="<https://dashboard.retellai.com/retell-widget.js%22>
data-public-key="key_xxxxxxxxxxxxxxxxxxxxx"
data-agent-id="agent_xxxxxxxxxxxxxxxxxxx"
data-agent-version="0"
></script>
[(1) ]()AI Evy
01/13/2026, 7:13 PMAI Evy
01/13/2026, 7:13 PMTubussie
01/13/2026, 7:20 PMAI Evy
01/13/2026, 7:20 PMAI Evy
01/13/2026, 7:20 PM{agent_id} with your actual chat agent ID.
Using the SDK (recommended) :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatAgentResponse = await client.chatAgent.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
}) ;
console.log(chatAgentResponse.agent_id) ;
[(1) ]()
The agent_id returned (e.g., oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD) is what you'd use in the endpoint URL.
Making the API call:
You need to include your API key in the Authorization header with format Bearer YOUR_RETELL_API_KEY.
So the full request would be:
- Method: GET
- URL: `
- Header: Authorization: Bearer YOUR_RETELL_API_KEY
Your agent ID can be found in your Retell dashboard when viewing your chat agent, or from the response when you created the agent.AI Evy
01/13/2026, 7:20 PMAI Evy
01/13/2026, 7:20 PMTubussie
01/13/2026, 7:22 PMAI Evy
01/13/2026, 7:22 PMAI Evy
01/13/2026, 7:22 PMAuthorization header required error means your API request is missing the authentication header. [(1) ]()
You need to include your API key in the request headers with this format: Authorization: Bearer YOUR_RETELL_API_KEY [(2) ]()
If using cURL or a REST client:
Authorization: Bearer YOUR_RETELL_API_KEY
If using the SDK (recommended) :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
[(3) ]()
You can find your API key in the Retell dashboard. [(1) ]()AI Evy
01/13/2026, 7:22 PMAI Evy
01/13/2026, 7:22 PMAI Evy
01/15/2026, 6:52 PM