Create a minimal working Retell AI example.
Use when starting a new Retell AI integration, testing your setup,
or learning basic Retell AI API patterns.
Trigger with phrases like "retellai hello world", "retellai example",
"retellai quick start", "simple retellai code".
Create your first Retell AI voice agent and make a test phone call.
Prerequisites
Completed retellai-install-auth
A phone number registered in Retell AI Dashboard (or use web call for testing)
Instructions
Step 1: Create an LLM Configuration
import Retell from 'retell-sdk';
const retell = new Retell({ apiKey: process.env.RETELL_API_KEY! });
// Create LLM configuration (what the agent says)
const llm = await retell.llm.create({
model: 'gpt-4o',
general_prompt: `You are a friendly receptionist for Acme Corp.
- Greet callers warmly
- Ask how you can help
- Take messages if needed
- Be concise and professional`,
});
console.log(`LLM created: ${llm.llm_id}`);
// Outbound call (requires a registered phone number)
const call = await retell.call.createPhoneCall({
from_number: '+14155551234', // Your Retell number
to_number: '+14155555678', // Destination
override_agent_id: agent.agent_id,
});
console.log(`Call initiated: ${call.call_id}`);
Step 4: Or Test with Web Call
// Web call (no phone number needed — great for testing)
const webCall = await retell.call.createWebCall({
agent_id: agent.agent_id,
});
console.log(`Web call URL: ${webCall.call_id}`);
// Use retell-client-js-sdk to connect from browser