Voice Integration
Build AI-powered phone agents using Twilio and ElevenLabs.
Overview
Voice integration uses two providers:
| Provider | Purpose |
|---|---|
| Twilio | Phone infrastructure - phone numbers, call routing, PSTN connectivity |
| ElevenLabs | AI voice synthesis - natural speech, conversation handling |
Together they power Voice Agents that can make and receive phone calls.
Setup
1. Twilio (Phone Numbers)
Twilio provides the phone infrastructure for making and receiving calls.
- Create a Twilio (opens in a new tab) account
- Get your Account SID and Auth Token from the console
- Purchase phone number(s) for your account
- In Lux Desktop: Settings → Credentials → Add Credential
- Select Twilio and enter your credentials
2. ElevenLabs (AI Voice)
ElevenLabs provides the AI voice synthesis that powers your voice agents.
Note: Lux uses a platform ElevenLabs key for voice agents. You don't need your own ElevenLabs account unless you want custom voices.
For custom voices:
- Create an ElevenLabs (opens in a new tab) account
- Get your API key
- In Lux Desktop: Settings → APIs → ElevenLabs
- Enter your API key
Phone Numbers
Viewing Numbers
lux va twilio-numbersNumber Types
| Type | Use Case |
|---|---|
| Local | Appears as local number to recipients |
| Toll-free | 1-800 numbers, good for inbound |
| Mobile | For SMS and voice |
Inbound Configuration
Configure a number to receive calls:
lux va configure-inbound +15551234567 flow_xyzThis routes incoming calls to your flow.
Making Outbound Calls
Via Flow (Voice Agent Node)
{
"agentId": "va_support",
"to": "+15559876543",
"from": "+15551234567",
"variables": {
"customerName": "John",
"issueType": "billing"
}
}Via CLI
lux va call va_123 +15559876543 --from +15551234567Handling Inbound Calls
Flow Setup
Inbound Call Trigger
↓
Check Business Hours
↓
If (open)
├── Yes → Voice Agent
└── No → Play Message → Hang UpInbound Call Variables
When a call comes in:
{
"callSid": "CA123...",
"from": "+15559876543",
"to": "+15551234567",
"direction": "inbound"
}Voice Selection
ElevenLabs provides natural-sounding voices:
| Voice | Description | Best For |
|---|---|---|
| Rachel | Female, clear | Customer service |
| Drew | Male, friendly | General |
| Sarah | Female, warm | Healthcare, wellness |
| Paul | Male, authoritative | Business |
Custom Voices
You can also use custom voices from your ElevenLabs account.
Voice Settings
Fine-tune voice output:
{
"stability": 0.5, // Voice consistency (0-1)
"similarity": 0.75, // Match to original (0-1)
"speed": 1.0 // Speaking rate (0.5-2)
}Call Handling
Call Duration
Set maximum call duration:
{
"maxDuration": 300 // 5 minutes in seconds
}Call Transfer
Transfer to a human when needed:
// In voice agent prompt
"If the customer asks for a human agent, transfer them to the support line."Built-in transfer tool:
{
"tool": "transfer",
"destination": "+15551234567"
}End Call
Voice agents can end calls:
// In voice agent prompt
"When the conversation is complete, thank them and end the call."Post-Call Data
After calls complete, you receive:
{
"callSid": "CA123...",
"duration": 127,
"status": "completed",
"transcript": [...],
"collectedData": {...}
}Process this in a post-call flow to:
- Store transcripts
- Update CRM
- Send follow-up emails
- Analyze sentiment
Pricing
Twilio Voice
| Type | Cost (approx) |
|---|---|
| Outbound US | $0.014/min |
| Inbound US | $0.0085/min |
| Phone number | $1/month |
ElevenLabs
| Plan | Characters/month |
|---|---|
| Free | 10,000 |
| Starter | 30,000 |
| Creator | 100,000 |
Best Practices
Voice Agent Prompts
- Keep responses short for natural conversation
- Handle interruptions gracefully
- Include clear call endings
Phone Numbers
- Use local numbers for better answer rates
- Consider toll-free for inbound
- Follow local regulations
Quality
- Test in quiet environments
- Monitor call transcripts
- Iterate on prompts based on calls
See Also: