renovia_70920
08/14/2025, 8:32 PMAI Evy
08/14/2025, 8:32 PMAI Evy
08/14/2025, 8:32 PMheaders, query_params, and response variables should be objects {} rather than empty arrays [] [(2) ]() .
For detailed guidance on agent creation structure, you can refer to the [Create Agent]() documentation [(1) ]() .
If you need the exact import schema, I'd recommend checking the official documentation or contacting support for the most current schema requirements.AI Evy
08/14/2025, 8:32 PMAI Evy
08/14/2025, 8:32 PMaparna_10250
08/16/2025, 7:38 PMAI Evy
08/16/2025, 7:38 PMAI Evy
08/16/2025, 7:38 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
The API endpoint is POST /create-agent . The required parameters are:
- response_engine - The Response Engine to attach to the agent, which needs to be created first [(2) ]()
- voice_id - Unique voice id used for the agent
The response_engine requires:
- type - set to "retell-llm"
- llm_id - id of the Retell LLM Response Engine
Once you have created the agent, you can then create chat sessions using the Create Chat API [(3) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
For a complete step-by-step guide on implementing chat functionality, refer to the Create Chat Completion documentation [(4) ]() .AI Evy
08/16/2025, 7:39 PMAI Evy
08/16/2025, 7:39 PMaparna_10250
08/16/2025, 7:39 PMAI Evy
08/16/2025, 7:39 PMAI Evy
08/16/2025, 7:39 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
Creates a voice agent because it includes the voice_id parameter . The same agent can then be used for chat interactions through the Create Chat API, but the agent itself is configured with voice capabilities from the start .
The Create Agent API is the unified endpoint for creating agents that can handle both voice calls and text-based chat interactions .AI Evy
08/16/2025, 7:39 PMAI Evy
08/16/2025, 7:39 PMaparna_10250
08/16/2025, 7:41 PMAI Evy
08/16/2025, 7:41 PMAI Evy
08/16/2025, 7:41 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponse = await client.chat.create({ agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD' }) ;
console.log(chatResponse.agent_id) ;
The required parameter for creating a chat is agent_id, which should be the ID returned when you created your agent .
Common issues that could cause API errors include:
1. **Invalid agent_id**: Make sure you're using the correct agent ID returned from the Create Agent API [(2) ]()
2. **Agent not published**: The agent might need to be published before it can be used for chats [(3) ]()
3. **Incorrect API key**: Ensure your API key is valid and has the proper permissions [(1) ]()
If you're still getting errors, could you share the specific error message you're receiving? This would help identify the exact issue with your chat creation request.AI Evy
08/16/2025, 7:41 PMAI Evy
08/16/2025, 7:41 PMaparna_10250
08/16/2025, 7:42 PM{
"status": "error",
"message": "Cannot start a chat session with selected agent."
}@AI EvyAI Evy
08/16/2025, 7:42 PMAI Evy
08/16/2025, 7:42 PMjavascript
const chatResponse = await client.chat.create({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
agent_version: 1
}) ;
2. Agent Configuration
Ensure your agent was created with the correct response engine configuration [(2) ]() . The agent needs a valid response engine attached .
3. Agent Status
Check if the agent exists and is properly configured by retrieving it first [(3) ]() :
javascript
const agentResponse = await client.agent.get('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
4. Dynamic Variables
If your agent uses dynamic variables, make sure to include them in the chat creation request [(1) ]() :
javascript
const chatResponse = await client.chat.create({
agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
retell_llm_dynamic_variables: {
"customer_name": "John Doe"
}
}) ;
To troubleshoot further, I'd recommend:
1. Verify the agent ID is correct
2. Check that the agent's response engine is properly configured [(2) ]()
3. Ensure the agent version exists if you're specifying one [(1) ]()AI Evy
08/16/2025, 7:42 PMAI Evy
08/16/2025, 7:42 PMaparna_10250
08/16/2025, 7:44 PMaparna_10250
08/16/2025, 7:44 PMAI Evy
08/16/2025, 7:44 PMAI Evy
08/16/2025, 7:44 PMAI Evy
08/16/2025, 7:45 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(agentResponse.agent_id) ;
Verify Agent Versions
Check what versions are available for your agent [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponses = await client.agent.getVersions('16b980523634a6dc504898cda492e939') ;
console.log(agentResponses) ;
Review Chat Status
You can also check existing chat sessions using the List Chat API [(3) ]() .
Since you've confirmed the agent ID is correct, the response engine is configured, and you've tried with dynamic variables, I'd recommend:
1. Visit [Contact Sales]()
2. Visit [)
Would you like a general answer based on my knowledge instead?AI Evy
08/16/2025, 7:45 PMAI Evy
08/16/2025, 7:45 PMaparna_10250
08/16/2025, 7:45 PMaparna_10250
08/16/2025, 7:45 PMAI Evy
08/16/2025, 7:45 PMAI Evy
08/16/2025, 7:46 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const chatResponses = await client.chat.list() ;
console.log(chatResponses) ;
[(2) ]()
3. Create Chat Completion - To generate responses from the chat agent, use the create-chat-completion API endpoint [(1) ]() .
The key issue might be that the agent you created is configured primarily for voice interactions (since it includes voice_id parameter) [(3) ]() , but chat functionality requires specific configuration that may not be compatible with all agent types.
For the exact requirements and troubleshooting this specific error, I'd recommend:
1. Visit [Contact Sales]()
2. Visit [)
Would you like a general answer based on my knowledge instead?AI Evy
08/16/2025, 7:46 PMAI Evy
08/16/2025, 7:46 PMaparna_10250
08/16/2025, 7:47 PMaparna_10250
08/16/2025, 7:47 PMAI Evy
08/16/2025, 7:47 PMAI Evy
08/16/2025, 7:47 PMvoice_id parameter is required when creating an agent [(1) ]() . The API structure shows:
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.create({
response_engine: { llm_id: 'llm_234sdertfsdsfsdf', type: 'retell-llm' },
voice_id: '11labs-Adrian',
}) ;
console.log(agentResponse.agent_id) ;
Based on the documentation, there isn't a separate "chat agent" creation endpoint - the Create Agent API creates agents that can handle both voice and text interactions . The voice_id parameter is marked as required in the API specification [(2) ]() .
However, looking at the response structure, agents are created with an is_published field that defaults to false [(1) ]() . This might be related to your chat session issue. When an agent is not published, it may not be available for certain operations.
The documentation doesn't show a way to create an agent without a voice_id parameter, as it's listed as required [(2) ]() . All agents in Retell AI appear to be created with voice capabilities, but can then be used for both voice calls and chat interactions.
For the specific error you're encountering with chat sessions, I don't have detailed troubleshooting information in the available sources. I'd recommend:
1. Visit [Contact Sales]()
2. Visit [)
Would you like a general answer based on my knowledge instead?AI Evy
08/16/2025, 7:48 PMAI Evy
08/16/2025, 7:48 PMrenovia_70920
08/18/2025, 7:40 PMAI Evy
08/18/2025, 7:40 PMAI Evy
08/18/2025, 7:41 PMheaders, query_params, and response variables should be objects {} rather than empty arrays [] .
Another issue reported was with the "Wait" tool where parameters must be formatted as objects [(4) ]() .
For detailed guidance on agent structure, you can refer to the [Create Agent]() documentation [(2) ]() , which shows the expected format for agent configuration.
Since I don't have the exact import schema in the available sources, I'd recommend:
1. Visit [Contact Sales]()
2. Visit [)
Would you like a general answer based on my knowledge instead?AI Evy
08/18/2025, 7:41 PMAI Evy
08/18/2025, 7:41 PM