sreehari_aalmosthuman
10/02/2025, 9:27 AMAI Evy
10/02/2025, 9:27 AMAI Evy
10/02/2025, 9:27 AMjavascript
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) ;AI Evy
10/02/2025, 9:27 AMAI Evy
10/02/2025, 9:27 AMAI Evy
10/02/2025, 9:27 AMsreehari_aalmosthuman
10/02/2025, 9:29 AMAI Evy
10/02/2025, 9:29 AMAI Evy
10/02/2025, 9:29 AMget_user_details
- Description: Get user details based on name and age
### Select HTTP Method
Choose from available HTTP methods :
- GET
- POST
- PATCH
- PUT
- DELETE
### Define Parameters
Use JSON schema format for function parameters :AI Evy
10/02/2025, 9:29 AMjson
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city of the weather"
}
},
"required": [
"city"
]
}
[(4) ]()
## Request & Response Handling
When a custom function is called, Retell sends a request to your specified URL with function name and parameters . The request includes :
- **Header**: X-Retell-Signature for request verification and Content-Type: application/json
- **Body**: Contains name (function name) , call (call context) , and args (function arguments)
Response formats supported include string, buffer, JSON object, or blob - all converted to string before sending to the LLM .
## Integration Benefits
Voice-to-voice API integration enables businesses to [(1) ]() [(2) ]() :
- Deliver hyper-personalized conversations at scale
- Automate complex, multi-step processes without human handoff
- Accelerate call resolutions by instantly accessing core business systems
- Maintain conversation context while executing backend actions
This creates voice agents that act as dynamic operators within your business, capable of retrieving CRM data, modifying records, and triggering workflows during live conversations [(2) ]() .AI Evy
10/02/2025, 9:29 AMAI Evy
10/02/2025, 9:29 AMsreehari_aalmosthuman
10/02/2025, 9:31 AMsreehari_aalmosthuman
10/02/2025, 9:31 AMAI Evy
10/02/2025, 9:31 AMAI Evy
10/02/2025, 9:32 AMwss://api.retellai.com/v1/agent/YOUR_AGENT_ID/ws is used for custom LLM integration with Retell AI [(1) ]() . This endpoint allows you to connect your own LLM to handle voice conversations through WebSocket communication .
## Implementation Steps
To use this WebSocket connection, you need to:
1. Set up a WebSocket server to handle the connection
2. Integrate with your chosen LLM for processing conversation logic
3. Handle function calling if you need your agent to take actions [(2) ]()
## Custom LLM Integration
When connecting to this WebSocket endpoint, you can integrate with various LLM providers [(1) ]() . The documentation provides examples for:
- Azure OpenAI
- OpenAI
- OpenRouter
## Function Calling Support
Through this WebSocket connection, you can implement function calling to let your voice agent take actions beyond talking [(2) ]() . This includes:
- Calling external APIs
- Booking appointments
- Transferring or ending calls
- Getting external knowledge
The WebSocket interface allows you to have full programmatic control over your agent's behavior while leveraging Retell AI's voice infrastructure for speech-to-text, turn-taking, and text-to-speech capabilities.AI Evy
10/02/2025, 9:32 AMAI Evy
10/02/2025, 9:32 AMsreehari_aalmosthuman
10/02/2025, 9:34 AMAI Evy
10/02/2025, 9:34 AMAI Evy
10/02/2025, 9:34 AMdocs.retellai.com/api-references/ [(1) ]() . For example, the List Phone Numbers endpoint is documented at [List Phone Numbers]() .
## API Authentication
To use Retell AI APIs, you'll need an API key for authentication [(2) ]() . The API key should be included in request headers as:
Authorization: Bearer YOUR_API_KEY
## Available Endpoints
From the sources, I can see there's at least:
- Phone number management endpoints [(1) ]()
- A test case creation API mentioned: ` [(3) ]()
However, I don't have complete information about all available API endpoints in the provided sources.
For a comprehensive list of all Retell AI APIs, I'd recommend checking:
- [API Key Overview]() [(2) ]()
- The main API documentation section at docs.retellai.com
Would you like me to provide a general answer based on my knowledge instead, or do you have a specific API endpoint you're looking for?AI Evy
10/02/2025, 9:34 AMAI Evy
10/02/2025, 9:34 AMsreehari_aalmosthuman
10/02/2025, 9:36 AMsreehari_aalmosthuman
10/02/2025, 9:37 AMAI Evy
10/02/2025, 9:37 AMAI Evy
10/02/2025, 9:37 AMAI Evy
10/02/2025, 9:37 AMAI Evy
10/02/2025, 9:37 AMsreehari_aalmosthuman
10/02/2025, 9:55 AMAI Evy
10/02/2025, 9:55 AMAI Evy
10/02/2025, 9:56 AMget_user_details
- Description: Get user details based on name and age
2. Select HTTP Method - Choose from GET, POST, PATCH, PUT, or DELETE
3. Add endpoint URL - Specify where Retell will send requests to execute your custom function
4. Define parameters using JSON schema format :
json
{
"type": "object",
"properties": {
"city": {
"type": "string",
"description": "The city name"
}
},
"required": ["city"]
}
[(4) ]()
### Request Verification
To verify requests are from Retell, check the X-Retell-Signature header [(3) ]() :AI Evy
10/02/2025, 9:56 AMjavascript
import { Retell } from "retell-sdk";
this.app.post("/check-weather", async (req: Request, res: Response) => {
if (
!Retell.verify(
JSON.stringify(req.body) ,
process.env.RETELL_API_KEY,
req.headers["x-retell-signature"] as string,
)
) {
console.error("Invalid signature") ;
return;
}
const content = req.body;
if (content.args.city === "New York") {
return res.json("25f and sunny") ;
} else {
return res.json("20f and cloudy") ;
}
}) ;
## Platform Integration Benefits
Integrating Retell AI enables your platform to [(5) ]() :
- Deliver hyper-personalized conversations at scale
- Automate complex, multi-step processes without human handoff
- Accelerate call resolutions by instantly accessing core systems
## Getting Started
For platform development, you'll need to:
1. Contact [Contact Sales]() for API access
2. Review the comprehensive [API documentation]() [(6) ]()
3. Implement custom functions to connect your platform's backend systems
The integration allows voice agents to act as dynamic operators within your platform, retrieving data, updating records, and triggering workflows during live conversations [(5) ]() .AI Evy
10/02/2025, 9:56 AMAI Evy
10/02/2025, 9:56 AM