https://retellai.com/?utm_source=discord&utm_medium=seo logo
LLM is not published API problems
# ❓・bug-report
n
I tried everything to get my LLM state "is_published" to "true" but neither am I able to do it through the API, nor the "Publish" button in the UI. Can someone please assist, as this is a required functionality to use the /create-agent API.
@AI Evy
a
Thanks for tagging me @niction_. I'll look through relevant sources and get back to you shortly.
### Answer Based on the documentation, you can create an agent even when the Retell LLM
is_published
is
false
[(1) ]() . The create agent API does not require the LLM to be published first. Here's the correct approach using the JavaScript SDK:
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) ;
The response will show your agent with
is_published: false
initially . You don't need to publish the LLM separately - you can create the agent directly with an unpublished LLM. If you're getting 404 errors when creating agents, check that: 1. Your
llm_id
is correct [(2) ]() 2. Your
voice_id
is valid (common cause of 404s) 3. Your API key has proper permissions [(1) ]() For troubleshooting similar issues where agents don't appear in API calls despite being visible in the dashboard, this appears to be a known issue that Retell is investigating [(3) ]() .
​ To learn more, see the sources I considered: [[1] Create Agent](https://docs.retellai.com/api-references/create-agent) [[2] 404 when creating agent with /create-agent](https://discord.com/channels/1186424376300679209/1392679614882517042) [[3] Agent exists and is published, but API returns "Found agents: 0"](https://discord.com/channels/1186424376300679209/1392892371313754164) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
s
Hi @niction_ thanks for reaching out.The PATCH call may be rejected with 400/422 if the payload doesn’t match the expected schema Check your LLM it is currently unpublished and editable use Use GET /retell-llm/{llm_id} because when the agent is get published the publish button disappears from the UI