mehxbot
10/07/2025, 11:27 AMAI Evy
10/07/2025, 11:27 AMAI Evy
10/07/2025, 11:27 AMAI Evy
10/07/2025, 11:27 AMAI Evy
10/07/2025, 11:27 AMAI Evy
10/07/2025, 11:27 AMmehxbot
10/07/2025, 11:32 AMAI Evy
10/07/2025, 11:32 AMAI Evy
10/07/2025, 11:32 AMretell_llm_dynamic_variables in the Create Phone Call API [(1) ]() . The variables are defined as key-value pairs of strings :
json
{
"retell_llm_dynamic_variables": {
"mode_basic_screening": "true",
"mode_interview_scheduling": "true",
"mode_in_depth_analysis": "false"
}
}
## Variable Injection into Prompts
Dynamic variables are injected into your agent's prompts and tool descriptions using the {{variable_name}} syntax [(2) ]() . You can reference them in:
- **Prompts**: Agent instructions and personality
- **Begin message**: Opening greeting
- **Tool configurations**: Custom function URLs, tool descriptions, property descriptions
For example, in your prompt:
"Based on the selected modes: {{mode_basic_screening}}, {{mode_interview_scheduling}}, {{mode_in_depth_analysis}}, adapt your conversation approach accordingly."
## Agent-Level Default Variables
You can also set default values at the agent level using default_dynamic_variables [(3) ]() . These serve as fallbacks when specific variables aren't included in the call request [(2) ]() :
json
{
"default_dynamic_variables": {
"mode_basic_screening": "false",
"mode_interview_scheduling": "false",
"mode_in_depth_analysis": "false"
}
}AI Evy
10/07/2025, 11:32 AMretell_llm_dynamic_variables must be strings [(1) ]() . Numbers, booleans, or other data types are not supported . The spaces around variable names are trimmed when evaluating .
This approach allows you to use a single agent that dynamically adapts its behavior based on the selected modes, avoiding the need for multiple agent configurations.AI Evy
10/07/2025, 11:32 AMAI Evy
10/07/2025, 11:32 AMmehxbot
10/07/2025, 11:34 AMAI Evy
10/07/2025, 11:34 AMAI Evy
10/07/2025, 11:34 AMYou are a professional recruiter assistant. Your behavior adapts based on the selected conversation modes:
ACTIVE MODES:
- Basic Screening: {{mode_basic_screening}}
- Interview Scheduling: {{mode_interview_scheduling}}
- In-Depth Analysis: {{mode_in_depth_analysis}}
CONDITIONAL LOGIC:
If {{mode_basic_screening}} is "true", focus on:
- Collecting basic candidate information
- Verifying job fit and interest level
- Asking screening questions relevant to the role
If {{mode_interview_scheduling}} is "true", focus on:
- Coordinating interview times and availability
- Confirming interview format preferences
- Sending calendar invitations
If {{mode_in_depth_analysis}} is "true", focus on:
- Conducting detailed technical assessments
- Exploring career motivations and goals
- Evaluating cultural fit
BEHAVIOR GUIDELINES:
- Always check which modes are active before proceeding
- Adapt your questioning style based on active modes
- If multiple modes are active, prioritize based on conversation flow
- Use the candidate's name: {{candidate_name}} when available
## Implementation with API Call
When making your API call, pass the mode selections as dynamic variables [(2) ]() :
json
{
"retell_llm_dynamic_variables": {
"mode_basic_screening": "true",
"mode_interview_scheduling": "true",
"mode_in_depth_analysis": "false",
"candidate_name": "John Smith"
}
}AI Evy
10/07/2025, 11:34 AM{{variable_name}} syntax and can be used in prompts, begin messages, and tool configurations [(1) ]() . You can also set agent-level default values as fallbacks when specific variables aren't included in the call request .
This approach allows one agent to handle multiple conversation flows based on the dynamic input, eliminating the need for separate agents for each mode combination.AI Evy
10/07/2025, 11:34 AMAI Evy
10/07/2025, 11:34 AMmehxbot
10/07/2025, 11:42 AMAI Evy
10/07/2025, 11:42 AMAI Evy
10/07/2025, 11:42 AMjson
{
"retell_llm_dynamic_variables": {
"mode_basic_screening": "true",
"mode_interview_scheduling": "false",
"mode_in_depth_analysis": "true"
}
}AI Evy
10/07/2025, 11:42 AMdefault_dynamic_variables [(3) ]() , which serve as fallbacks when specific variables aren't included in the call request [(1) ]() .
This approach eliminates the need for 9 separate agents while maintaining the flexibility to handle all your conversation modes dynamically.AI Evy
10/07/2025, 11:42 AMAI Evy
10/07/2025, 11:42 AMmehxbot
10/07/2025, 11:43 AMAI Evy
10/07/2025, 11:43 AMAI Evy
10/07/2025, 11:44 AM{
"mode_basic_screening": "true",
"mode_interview_scheduling": "true",
"mode_in_depth_analysis": "false"
}AI Evy
10/07/2025, 11:44 AMAI Evy
10/07/2025, 11:45 AMAI Evy
10/07/2025, 11:45 AMmehxbot
10/07/2025, 11:46 AMAI Evy
10/07/2025, 11:46 AMAI Evy
10/07/2025, 11:46 AMAI Evy
10/07/2025, 11:46 AMAI Evy
10/07/2025, 11:46 AMmehxbot
10/07/2025, 2:14 PMAI Evy
10/07/2025, 2:14 PMAI Evy
10/07/2025, 2:15 PMAI Evy
10/07/2025, 2:15 PM{{current_time}} - Current time in America/Los_Angeles
- {{current_time_[timezone]}} - Current time in specified timezone, for example: {{current_time_Australia/Sydney}}
- {{current_calendar}} - 14-day calendar in America/Los_Angeles
- {{current_calendar_[timezone]}} - 14-day calendar in specified timezone, for example: {{current_calendar_Australia/Sydney}}
## Example Usage in Prompts
You can use these variables directly in your agent prompts :
"The current time is {{current_time}}. Based on the time of day, adjust your greeting accordingly."
## Important Timezone Considerations
Based on community feedback, there are some limitations with the {{current_time}} variable [(2) ]() . The default {{current_time}} returns time in PST (Pacific Standard Time) , not UTC as some might expect .
For more precise timezone control, you can:
1. Use the timezone-specific format: {{current_time_[your_timezone]}} [(1) ]()
2. Send custom time variables via retell_llm_dynamic_variables when initiating calls [(2) ]()
## Custom Time Variables
If you need more control over timezone handling, you can also pass custom time variables through the API when creating calls, ensuring your agent works with the exact timezone and format you need .AI Evy
10/07/2025, 2:15 PMmehxbot
10/07/2025, 2:21 PMAI Evy
10/07/2025, 2:21 PMAI Evy
10/07/2025, 2:21 PM{{current_time}} variable doesn't provide UTC time by default [(1) ]() . The default {{current_time}} returns time in America/Los_Angeles timezone .
## Built-in Time Variables
Retell provides these system variables automatically :
- {{current_time}} - Current time in America/Los_Angeles
- {{current_time_[timezone]}} - Current time in specified timezone, for example: {{current_time_Australia/Sydney}}
## Custom UTC Time Solution
To get UTC time, you have a few options:
1. **Use a specific UTC timezone variable**: {{current_time_UTC}}
2. **Pass custom UTC time via API**: When creating calls, send UTC time through retell_llm_dynamic_variables
json
{
"retell_llm_dynamic_variables": {
"utc_time": "2024-01-15T14:30:00Z"
}
}
## Known Issues
Based on community feedback, there can be inconsistencies with the {{current_time}} variable where it sometimes shows incorrect dates [(2) ]() . This happens both in LLM testing and actual calls, and appears to be intermittent .
For reliable UTC time handling, I'd recommend passing the current UTC time as a custom dynamic variable when initiating calls rather than relying solely on the built-in time variables.AI Evy
10/07/2025, 2:21 PMAI Evy
10/07/2025, 2:21 PMmehxbot
10/07/2025, 2:43 PMAI Evy
10/07/2025, 2:43 PMAI Evy
10/07/2025, 2:43 PM{{current_time}} variable has documented inconsistencies where it can show incorrect dates, and this affects both LLM testing and actual calls [(1) ]() . Community members have reported similar issues where the agent shows wrong dates despite using the built-in time variables.
## Alternative Solutions
Here are some workarounds for reliable time handling:
### 1. Pass Custom Time Variables via API
When creating calls, send the current UTC time through retell_llm_dynamic_variables :
json
{
"retell_llm_dynamic_variables": {
"current_utc_time": "2025-01-15T14:30:00Z",
"current_date": "2025-01-15"
}
}AI Evy
10/07/2025, 2:43 PM{{current_time}} variables [(1) ]() . This ensures your agent has accurate, consistent time information for scheduling and time-aware responses.
Would you like help setting up the custom time variables in your API calls?AI Evy
10/07/2025, 2:43 PMAI Evy
10/07/2025, 2:43 PMmehxbot
10/07/2025, 2:44 PMmehxbot
10/07/2025, 2:44 PMAI Evy
10/07/2025, 2:44 PMAI Evy
10/07/2025, 2:44 PM{{current_time}} - Current time in America/Los_Angeles
- {{current_time_[timezone]}} - Current time in specified timezone, for example: {{current_time_Australia/Sydney}}
- {{current_calendar}} - 14-day calendar in America/Los_Angeles
- {{current_calendar_[timezone]}} - 14-day calendar in specified timezone, for example: {{current_calendar_Australia/Sydney}}
## Example Format
The {{current_time}} variable returns time in this format: "Thursday, March 28, 2024 at 11:46:04 PM PST"
## Known Issues
However, based on community reports, there are intermittent issues with the {{current_time}} variable showing incorrect dates [(2) ]() . This happens both in LLM testing and actual calls randomly . Some users have reported that the current_time function "messes up 70% of the time" [(3) ]() .
## Alternative Approach
If the built-in variables are unreliable, you can pass your own live time data using retell_llm_dynamic_variables when creating calls [(4) ]() :
json
{
"retell_llm_dynamic_variables": {
"current_utc_time": "2025-01-15T14:30:00Z"
}
}
The built-in time variables should work for live date and time, but given the reported reliability issues, you may want to test them thoroughly or use custom time variables as a backup.AI Evy
10/07/2025, 2:44 PMAI Evy
10/07/2025, 2:44 PMmehxbot
10/08/2025, 11:57 AMmehxbot
10/08/2025, 11:57 AMAI Evy
10/08/2025, 11:57 AMAI Evy
10/08/2025, 11:58 AMjson
{
"general_prompt": "You are ...",
"states": [
{
"name": "information_collection",
"state_prompt": "You will follow the steps below to collect information...",
"edges": [
{
"destination_state_name": "appointment_booking",
"description": "Transition to book an appointment."
}
]
}
],
"starting_state": "information_collection",
"begin_message": "Hey I am a virtual assistant calling from Retell Hospital.",
"default_dynamic_variables": {
"customer_name": "John Doe"
}
}
## JSON Schema for Custom Functions
You can also define custom function parameters using JSON schema format [(2) ]() :
json
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city of the weather"
}
},
"required": [
"city"
]
}
## Function Calling with JSON
Function calling uses structured JSON to communicate between the LLM and your systems [(3) ]() . The agent can output JSON to trigger external functions and receive JSON responses.
This JSON-based approach gives you programmatic control over your agent's configuration, prompts, and function definitions through the Retell AI API.AI Evy
10/08/2025, 11:58 AMAI Evy
10/08/2025, 11:58 AMmehxbot
10/08/2025, 11:59 AMAI Evy
10/08/2025, 11:59 AMAI Evy
10/08/2025, 11:59 AMEquation: {{user_name}} exists
Result: True if variable is set
## Nested Variables Support
Retell supports nested variables for more complex logic :
{{current_time_{{my_timezone}} }}
If you set my_timezone to America/Los_Angeles, this evaluates to {{current_time_America/Los_Angeles}} first, then to the actual time .
## Implementation Approach
Based on your single input, you can:
1. Set multiple dynamic variables when creating the call :
json
{
"retell_llm_dynamic_variables": {
"flow_type": "screening",
"priority_level": "high",
"department": "sales"
}
}
2. Use conditional logic in prompts to handle different flows :AI Evy
10/08/2025, 11:59 AMIf {{flow_type}} appears with curly braces, use a generic approach.
Otherwise, follow the specific flow for {{flow_type}}.
3. Configure conversation flow nodes with dynamic transitions based on your variables [(3) ]() , [(4) ]() .
This approach eliminates the need for multiple separate agents while giving you dynamic control over conversation paths based on your single input.AI Evy
10/08/2025, 11:59 AMAI Evy
10/08/2025, 11:59 AMmehxbot
10/08/2025, 12:03 PMAI Evy
10/08/2025, 12:03 PMAI Evy
10/08/2025, 12:04 PM- {{user_age}} > 18
- {{current_time}} > 9 AND {{current_time}} < 18
- {{user_location}} == "New York"
- {{user_location}} != "New York"
- "New York, Los Angeles" CONTAINS {{user_location}}
- "New York, Los Angeles" NOT CONTAINS {{user_location}}
- {{user_age}} < 18 OR {{user_location}} == "New York"
- {{name}} exists
## Checking Variable Existence
You can check whether a dynamic variable exists using equation conditions :
- {{variable_name}} exists - Returns true if the variable is defined and has a value
- {{variable_name}} does not exists - Returns true if the variable is undefined or has no value
## Default Dynamic Variables in Conversation Flow
When creating conversation flows, you can set default_dynamic_variables [(3) ]() , [(4) ]() :AI Evy
10/08/2025, 12:04 PMjson
{
"default_dynamic_variables": {
"company_name": "Retell Inc",
"support_hours": "9 AM - 5 PM"
}
}
[(3) ]()
## Potential Issues
Based on community feedback, there can be issues with dynamic variables in conversation flows. Some users report that dynamic variables populate successfully in multi-prompt agents but not in conversation flow agents, even when using the same webhook endpoint [(5) ]() .
The multi-flow approach using dynamic variables and conversation flow should work well for your recruiter assistant scenario, allowing you to control different conversation paths based on your single input variable.AI Evy
10/08/2025, 12:04 PMAI Evy
10/08/2025, 12:04 PMmehxbot
10/15/2025, 9:32 AMAI Evy
10/15/2025, 9:32 AMAI Evy
10/15/2025, 9:32 AMcall_analyzed webhook for all calls regardless of outcome [(1) ]() . There are specific conditions that affect when this webhook is triggered:
## When call_analyzed is NOT sent
The call_analyzed webhook will not be triggered for [(2) ]() :
- Non-connected calls
- Calls where no conversation happened
## Specific Call Types Affected
When calls do not connect (such as calls with dial_failed, dial_no_answer, dial_busy disconnection reasons) , they will not have their call_started webhook triggered, but they will still have their call_ended and call_analyzed webhook triggered [(1) ]() .
## What call_analyzed Contains
When the call_analyzed webhook is triggered, it contains full call data including the call_analysis object . The webhook payload includes [(2) ]() :
json
{
"event_type": "call_analyzed",
"call": {
// Call object with call_analysis field populated
}
}
## Additional Considerations
Based on community feedback, there can be reliability issues with the call_analyzed webhook for longer calls [(3) ]() . For calls longer than 5 minutes, approximately 50% may not receive the call_analyzed webhook event due to payload size limitations that can cause HTTP 413 "request entity too large" errors.
The call_analyzed webhook is specifically designed to provide post-call analysis data, but it's only sent when there's meaningful conversation data to analyze [(2) ]() .AI Evy
10/15/2025, 9:32 AMAI Evy
10/15/2025, 9:33 AMmehxbot
10/15/2025, 2:06 PMAI Evy
10/15/2025, 2:06 PMAI Evy
10/15/2025, 2:06 PMcall_ended event before the call_analyzed event [(1) ]() . This is the normal sequence of webhook events in Retell AI.
## Webhook Event Sequence
The webhooks are triggered in this order :
1. call_started - Triggered when a new call begins (if the call connects)
2. call_ended - Triggered when a call completes, transfers, or encounters an error
3. call_analyzed - Triggered when call analysis is complete
## Why call_analyzed Comes Later
The call_analyzed webhook is sent after the call analysis processing is complete [(2) ]() . This analysis takes additional time because it includes:
- Call summary generation
- Sentiment analysis
- Custom analysis data extraction
- Other post-call processing
## Webhook Behavior Details
The webhook system is designed so that [(1) ]() :
- Webhooks are triggered in order but are not blocking
- If the call_started webhook fails, the call_ended webhook can still be triggered
- The call_analyzed webhook contains full call data including the call_analysis object [(2) ]()
## Real Example from Community
Based on community logs, you can see this sequence in action [(3) ]() :AI Evy
10/15/2025, 2:06 PM2025-07-30 17:30:17.643 call_89b9c83bce9588096a3bbd74505 info: Ending call
2025-07-30 17:30:19.080 call_89b9c83bce9588096a3bbd74505 info: Webhook triggered for call_ended
2025-07-30 17:30:19.288 call_89b9c83bce9588096a3bbd74505 info: Webhook response received for call_ended
2025-07-30 17:30:23.102 call_89b9c83bce9588096a3bbd74505 info: Webhook triggered for call_analyzed
This shows call_ended being triggered first, followed by call_analyzed several seconds later after the analysis processing completes.AI Evy
10/15/2025, 2:06 PMAI Evy
10/15/2025, 2:06 PMmehxbot
10/23/2025, 5:20 AMAI Evy
10/23/2025, 5:20 AMAI Evy
10/23/2025, 5:20 AMAI Evy
10/23/2025, 5:20 AMAI Evy
10/23/2025, 5:20 AMmehxbot
10/28/2025, 9:45 AMAI Evy
10/28/2025, 9:45 AMAI Evy
10/28/2025, 9:46 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
## Resolution
To fix this issue, you'll need to:
1. Create a new Response Engine (LLM)
2. Update your agent to use the new Response Engine
When creating or updating agents, ensure the response_engine object points to a valid LLM [(3) ]() :
json
{
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
}
}
This is a known issue with how Retell manages object lifecycles when LLMs are shared across multiple agents [(1) ]() .AI Evy
10/28/2025, 9:46 AMAI Evy
10/28/2025, 9:46 AMmehxbot
10/28/2025, 9:46 AMOmar Ashraf | Community Lead
10/28/2025, 10:12 AMmehxbot
10/28/2025, 10:42 AMAI Evy
10/28/2025, 10:42 AMAI Evy
10/28/2025, 10:43 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
The response will include the response_engine object with the llm_id :
json
{
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
}
}
## Via API - Get Retell LLM
You can also retrieve LLM details directly if you know the LLM ID [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The LLM ID is the unique identifier for your Retell LLM Response Engine . If your agent is showing "not found" in the dashboard, it's likely because the LLM connected to it was deleted, as mentioned in the previous response.AI Evy
10/28/2025, 10:43 AMAI Evy
10/28/2025, 10:43 AMmehxbot
10/28/2025, 10:44 AMAI Evy
10/28/2025, 10:44 AMAI Evy
10/28/2025, 10:44 AMllm_id in the response [(3) ]() [(4) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({
general_prompt: "You are ...",
start_speaker: "user",
begin_message: "Hey I am a virtual assistant calling from Retell Hospital."
}) ;
console.log(llmResponse.llm_id) ;
[(4) ]()
## Getting the LLM ID
The llm_id is returned in the response when you create a new Retell LLM [(3) ]() [(4) ]() . The response will include:
json
{
"llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"model": "gpt-4.1"
}
[(3) ]()
## Updating Your Agent
Once you have the new llm_id, update your agent to use it [(2) ]() [(5) ]() :
javascript
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', {
response_engine: {
llm_id: 'llm_234sdertfsdsfsdf',
type: 'retell-llm'
}
}) ;AI Evy
10/28/2025, 10:44 AMAI Evy
10/28/2025, 10:44 AMmehxbot
10/28/2025, 10:57 AMAI Evy
10/28/2025, 10:57 AMAI Evy
10/28/2025, 10:57 AMllm_id [(1) ]() [(2) ]() [(3) ]() . The response_engine object with a valid llm_id is a required field when creating an agent.
## Required Fields for Creating an Agent
When you create an agent via the API, the response_engine parameter is required and must include an llm_id :
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) ;
[(1) ]()
## Response Engine Structure
The response_engine object requires [(2) ]() [(3) ]() :
- `type`: Must be "retell-llm"
- `llm_id`: The ID of your Retell LLM Response Engine (required)
- `version`: Optional version number
## Workflow
Based on community experience, the correct workflow is [(4) ]() :
1. First, create a Retell LLM Response Engine (which gives you an llm_id)
2. Then, use that llm_id when creating your agent
If you receive a 404 error when creating an agent, verify that the llm_id you're using exists and is valid .AI Evy
10/28/2025, 10:57 AMAI Evy
10/28/2025, 10:57 AMmehxbot
10/28/2025, 10:58 AMAI Evy
10/28/2025, 10:58 AMAI Evy
10/28/2025, 10:58 AMresponse_engine object that includes your LLM configuration [(1) ]() [(2) ]() . Since you're using GPT-4.1 Fast, you'll need to create a Retell LLM Response Engine first (which will generate an llm_id for you) , and then use that llm_id when creating your agent [(4) ]() .
The response_engine object structure requires [(1) ]() [(2) ]() [(3) ]() :
- `type`: Set to "retell-llm"
- `llm_id`: The ID of your Retell LLM Response Engine (required)
- `version`: Optional version number
Here's the code structure for creating an agent with your response engine [(1) ]() [(2) ]() :
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) ;AI Evy
10/28/2025, 10:58 AMllm_id when creating your agent
If you're experiencing issues where your agent shows "not found," it's likely because the LLM connected to it was deleted [(5) ]() . The best practice is to have a different LLM for each agent to avoid this issue .AI Evy
10/28/2025, 10:58 AMAI Evy
10/28/2025, 10:58 AMmehxbot
10/28/2025, 10:59 AMAI Evy
10/28/2025, 10:59 AMAI Evy
10/28/2025, 10:59 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
## Required Parameters
When creating a Retell LLM, you must specify :
- `start_speaker`: Must be either 'user' or 'agent' (required)
## Optional Configuration
You can also configure :
- `model`: Select the underlying text LLM (defaults to gpt-4.1 if not set)
- `general_prompt`: General prompt for the agent
- `begin_message`: First utterance by the agent
- `general_tools`: Tools the model can use
- `states`: Multi-state conversation flows
## Response
The API returns an llm_id that you'll use when creating or updating your agent :
json
{
"llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"model": "gpt-4.1"
}
Once you have the llm_id, you can use it in your agent's response_engine configuration [(2) ]() [(3) ]() .AI Evy
10/28/2025, 10:59 AMAI Evy
10/28/2025, 10:59 AMmehxbot
10/28/2025, 11:39 AMAI Evy
10/28/2025, 11:39 AMAI Evy
10/28/2025, 11:39 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
The response will include your new llm_id :
json
{
"llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"model": "gpt-4.1"
}
## Step 2: Update Your Agent
Once you have the new llm_id, update your existing agent to use it [(1) ]() [(2) ]() :
javascript
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { agent_name: 'Jarvis' }) ;
console.log(agentResponse.agent_id) ;
[(1) ]()
The response_engine object in your update should look like this [(1) ]() [(2) ]() :
json
{
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
}
}
This will reconnect your agent to a valid Response Engine and resolve the "not found" issue .AI Evy
10/28/2025, 11:39 AMAI Evy
10/28/2025, 11:39 AMmehxbot
10/28/2025, 11:46 AM{
"status": "error",
"message": "Cannot update response engine of agent version > 0"
}AI Evy
10/28/2025, 11:46 AMAI Evy
10/28/2025, 11:46 AMresponse_engine for agents with version > 0. This is a limitation in Retell AI's agent versioning system.
## Your Options
Since you cannot update the response_engine on an existing agent with version > 0, you have two options:
### Option 1: Create a New Agent
Create a completely new agent with the new Response Engine [(1) ]() [(2) ]() :
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) ;
[(1) ]()
### Option 2: Check Agent Version
First, verify your agent's version using the Get Agent endpoint [(3) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.retrieve('your_agent_id') ;
console.log(agentResponse.agent_id) ;
The response will show your agent's version [(3) ]() [(4) ]() [(5) ]() :
json
{
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
}
}AI Evy
10/28/2025, 11:46 AMresponse_engine updates for agents that have been modified (version > 0) . This is likely a design decision to maintain agent stability and prevent breaking changes to active agents.
## Recommended Approach
Create a new agent with the new Response Engine. This ensures a clean configuration and avoids version-related restrictions [(1) ]() [(2) ]() .AI Evy
10/28/2025, 11:46 AMAI Evy
10/28/2025, 11:46 AMmehxbot
10/28/2025, 11:50 AMAI Evy
10/28/2025, 11:50 AMAI Evy
10/28/2025, 11:50 AMjavascript
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) ;
## What You'll Get
The response includes the complete agent blueprint :AI Evy
10/28/2025, 11:50 AMjson
{
"agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"response_engine": {
"type": "retell-llm",
"llm_id": "llm_234sdertfsdsfsdf",
"version": 0
},
"agent_name": "Jarvis",
"voice_id": "11labs-Adrian",
"voice_model": "eleven_turbo_v2",
"fallback_voice_ids": [
"openai-Alloy",
"deepgram-Angus"
],
"voice_temperature": 1,
"voice_speed": 1,
"volume": 1,
"responsiveness": 1,
"interruption_sensitivity": 1,
"enable_backchannel": true,
"backchannel_frequency": 0.9,
"backchannel_words": [
"yeah",
"uh-huh"
],
"reminder_trigger_ms": 10000,
"reminder_max_count": 2,
"ambient_sound": "coffee-shop",
"ambient_sound_volume": 1,
"language": "en-US",
"webhook_url": "<https://webhook-url-here%22,>
"webhook_timeout_ms": 10000,
"boosted_keywords": [
"retell",
"kroger"
],
"data_storage_setting": "everything",
"opt_in_signed_url": true,
"pronunciation_dictionary": [
{
"word": "actually",
"alphabet": "ipa",
"phoneme": "ˈæktʃuəli"
}
],
"normalize_for_speech": true,
"end_call_after_silence_ms": 600000,
"max_call_duration_ms": 3600000,
"voicemail_option": {
"action": {
"type": "static_text",
"text": "Please give us a callback tomorrow at 10am."
}
},
"post_call_analysis_data": [
{
"type": "string",
"name": "customer_name",
"description": "The name of the customer.",
"examples": [
"John Doe",
"Jane Smith"
]
}
],
"post_call_analysis_model": "gpt-4o-mini",
"begin_message_delay_ms": 1000,
"ring_duration_ms": 30000,
"stt_mode": "fast",
"vocab_specialization": "general",
"allow_user_dtmf": true,
"user_dtmf_options": {
"digit_limit": 25,
"termination_key": "#",
"timeout_ms": 8000
},
"denoising_mode": "noise-cancellation",
"pii_config": {
"mode": "post_call",
"categories": []
},
"last_modification_timestamp": 1703413636133
}AI Evy
10/28/2025, 11:50 AMAI Evy
10/28/2025, 11:50 AMAI Evy
10/28/2025, 11:50 AMmehxbot
10/28/2025, 11:51 AMAI Evy
10/28/2025, 11:51 AMAI Evy
10/28/2025, 11:51 AMjavascript
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) ;
## Best Practice Going Forward
To avoid this issue in the future, it's recommended to have a separate LLM for each agent [(1) ]() . This way, deleting one agent won't affect others.AI Evy
10/28/2025, 11:51 AMAI Evy
10/28/2025, 11:51 AMmehxbot
10/28/2025, 11:52 AMAI Evy
10/28/2025, 11:52 AMAI Evy
10/28/2025, 11:52 AMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The response will include the general_prompt and other configuration details :
json
{
"llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"version": 0,
"is_published": false,
"model": "gpt-4.1",
"general_prompt": "You are ...",
"general_tools": [...],
"states": [...]
}
## If the LLM Was Deleted
Unfortunately, if the LLM was already deleted, you cannot retrieve the prompt through the API [(2) ]() . In this case, you'll need to:
1. Check if you have any backups or documentation of your original prompt
2. Recreate the prompt configuration manually
3. Create a new Retell LLM with your prompt configuration [(3) ]()
## Listing All Available LLMs
You can also list all your existing LLMs to see if the configuration is still available [(4) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponses = await client.llm.list() ;
console.log(llmResponses) ;AI Evy
10/28/2025, 11:52 AMAI Evy
10/28/2025, 11:53 AMmehxbot
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMmehxbot
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:02 PMAI Evy
10/28/2025, 12:03 PMresponse_engine on that existing agent [(1) ]() [(2) ]() . However, you have two options:
## Option 1: Create a New Agent (Recommended)
Since you cannot update the response_engine for agents with version > 0, the most straightforward approach is to create a new agent with your new LLM ID [(3) ]() [(4) ]() :
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) ;
[(3) ]()
## Option 2: Update Agent (Only Works for Version 0)
If your agent were version 0, you could update it using the Update Agent endpoint [(1) ]() [(2) ]() :
javascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const agentResponse = await client.agent.update('16b980523634a6dc504898cda492e939', { agent_name: 'Jarvis' }) ;
console.log(agentResponse.agent_id) ;AI Evy
10/28/2025, 12:03 PMresponse_engine object structure requires [(1) ]() [(2) ]() :
- `type`: Must be "retell-llm"
- `llm_id`: The ID of your new Retell LLM Response Engine (required)
- `version`: Optional version number
## Why You're Getting the Error
The error "Cannot update response engine of agent version > 0" occurs because Retell AI restricts response_engine updates for agents that have been modified (version > 0) . This is a design decision to maintain agent stability.
## Recommended Workflow
1. First, create a new Retell LLM Response Engine (which gives you an llm_id)
2. Then, create a new agent using that llm_id [(3) ]() [(4) ]()
3. Going forward, use a separate LLM for each agent to avoid deletion issues [(7) ]()AI Evy
10/28/2025, 12:03 PMAI Evy
10/28/2025, 12:03 PMmehxbot
10/28/2025, 12:03 PMAI Evy
10/28/2025, 12:03 PMAI Evy
10/28/2025, 12:04 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.retrieve('16b980523634a6dc504898cda492e939') ;
console.log(llmResponse.llm_id) ;
The response includes the general_prompt field :
json
{
"llm_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
"general_prompt": "You are ...",
"general_tools": [...],
"states": [...]
}
## If the LLM Was Already Deleted
If the LLM was deleted along with your agent, the prompt is no longer retrievable through the API [(1) ]() [(2) ]() . In this case, you'll need to:
1. Check if you have any backups or documentation of your original prompt
2. Recreate the prompt configuration manually
3. Create a new Retell LLM with your reconstructed prompt using the Create Retell LLM endpoint [(4) ]()
## Creating a New LLM with Your Prompt
Once you've reconstructed your prompt, create a new LLM :AI Evy
10/28/2025, 12:04 PMjavascript
import Retell from 'retell-sdk';
const client = new Retell({
apiKey: 'YOUR_RETELL_API_KEY',
}) ;
const llmResponse = await client.llm.create({ start_speaker: 'user' }) ;
console.log(llmResponse.llm_id) ;
You can include your general_prompt in the create request .
## Best Practice Going Forward
To avoid losing prompts in the future, consider keeping backups of your LLM configurations, and remember to use a separate LLM for each agent to prevent accidental deletion [(1) ]() [(2) ]() .
---AI Evy
10/28/2025, 12:04 PMAI Evy
10/28/2025, 12:04 PM