https://retellai.com/?utm_source=discord&utm_medium=seo logo
Hello,I am attempting to use Retells API to create...
# ❓・ai-evy-support
b
@AI Evy Hello, ​ I am attempting to use Retells API to create agents within Retell, (Custom LLM agents) however, it doesn’t matter how I configure it, even with the SDK, it seems to return in an error 404. My phone numbers are registering properly, and the retell LLM url is too, but agent creation returns in a 404. I am probably doing something wrong, but just thought I would get some help from you guys! ​ Thanks!
a
Thanks for tagging me @BraydenRowland. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation and community reports, 404 errors when creating agents are typically caused by incorrect voice IDs or LLM IDs [(1) ]() . Here's the correct approach: The Create Agent API endpoint uses the POST method to
/create-agent
[(2) ]() . Here's the exact code structure from the documentation:
Copy code
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) ;
Common causes of 404 errors: 1. Incorrect voice_id - A community member reported getting a 404 error when using an outdated or incorrect voice ID from an online example [(1) ]() . Make sure your voice_id is valid and current. 2. Incorrect llm_id - Ensure your LLM ID is correctly formatted and exists . 3. API authentication - Verify your API key format is correct:
"Bearer YOUR_API_KEY"
[(2) ]() . Since you mentioned phone numbers and Retell LLM URLs are working properly, focus on verifying that both your
voice_id
and
llm_id
in the request body are correct and currently available in your Retell dashboard. Try using a different voice ID from your dashboard to see if that resolves the issue, as this approach worked for the community member who experienced the same problem [(1) ]() .
​ To learn more, see the sources I considered: [[1] Create Agent (API endpoint)](https://discord.com/channels/1186424376300679209/1424438362458161182) [[2] Create Agent](https://docs.retellai.com/api-references/create-agent) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.