Install the Retell AI SDK and configure API key authentication for building voice agents.
set -euo pipefail
# Node.js
npm install retell-sdk
# Python
pip install retell-sdk
# .env
RETELL_API_KEY=key_xxxxxxxxxxxxxxxxxxxxxxxx
import Retell from 'retell-sdk';
const retell = new Retell({ apiKey: process.env.RETELL_API_KEY! });
// Verify connection — list agents
const agents = await retell.agent.list();
console.log(`Connected! ${agents.length} agent(s) configured.`);
from retell import Retell
import os
retell = Retell(api_key=os.environ["RETELL_API_KEY"])
agents = retell.agent.list()
print(f"Connected! {len(agents)} agent(s) configured.")
retell-sdk installed| Error | Cause | Solution |
|---|---|---|
401 Unauthorized |
Invalid API key | Verify key in Retell Dashboard |
ModuleNotFoundError |
SDK not installed | npm install retell-sdk |
| Connection timeout | Network issue | Check firewall allows HTTPS |
Create your first agent: retellai-hello-world