https://retellai.com/?utm_source=discord&utm_medium=seo logo
j
@AI Evy does Retell.AI support custom LLM endpoints via OpenAI-compatible API?
a
Thanks for tagging me @JRTX10. I'll look through relevant sources and get back to you shortly.
### Answer --- Yes, Retell AI supports custom LLM endpoints via a WebSocket-based integration, not a direct OpenAI-compatible REST API endpoint. [(1) ]() With the "Custom LLM" feature, you integrate your own LLM into the Retell conversation pipeline by setting up a WebSocket server. You can connect to any LLM provider (OpenAI, Azure OpenAI, Claude, etc.) from your backend and stream responses back to Retell. Here's a simplified example using Azure OpenAI in Node.js:
Copy code
typescript
import {
  OpenAIClient,
  AzureKeyCredential,
} from "@azure/openai";

const client = new OpenAIClient(
  process.env.AZURE_OPENAI_ENDPOINT,
  new AzureKeyCredential(process.env.AZURE_OPENAI_KEY) ,
) ;
The flow works like this: - Retell sends conversation data to your WebSocket server - Your server calls your chosen LLM (OpenAI, Azure OpenAI, OpenRouter, etc.) - You stream the LLM response back to Retell via the WebSocket This approach gives you flexibility to use any OpenAI-compatible endpoint (like Azure OpenAI, OpenRouter, or self-hosted models) by connecting to them from your custom backend. Check out the demo repos for implementation examples: - [Node.js Demo]() - [Python Demo]()
​ To learn more, see the sources I considered: [[1] Integrate LLM](https://docs.retellai.com/integrate-llm/integrate-llm) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
j
how about custom STT and TTS? @User