Integrations
Voice

Voice Integration

Build AI-powered phone agents using Twilio and ElevenLabs.

Overview

Voice integration uses two providers:

ProviderPurpose
TwilioPhone infrastructure - phone numbers, call routing, PSTN connectivity
ElevenLabsAI 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.

  1. Create a Twilio (opens in a new tab) account
  2. Get your Account SID and Auth Token from the console
  3. Purchase phone number(s) for your account
  4. In Lux Desktop: SettingsCredentialsAdd Credential
  5. 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:

  1. Create an ElevenLabs (opens in a new tab) account
  2. Get your API key
  3. In Lux Desktop: SettingsAPIsElevenLabs
  4. Enter your API key

Phone Numbers

Viewing Numbers

lux va twilio-numbers

Number Types

TypeUse Case
LocalAppears as local number to recipients
Toll-free1-800 numbers, good for inbound
MobileFor SMS and voice

Inbound Configuration

Configure a number to receive calls:

lux va configure-inbound +15551234567 flow_xyz

This 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 +15551234567

Handling Inbound Calls

Flow Setup

Inbound Call Trigger

   Check Business Hours

   If (open)
     ├── Yes → Voice Agent
     └── No → Play Message → Hang Up

Inbound Call Variables

When a call comes in:

{
  "callSid": "CA123...",
  "from": "+15559876543",
  "to": "+15551234567",
  "direction": "inbound"
}

Voice Selection

ElevenLabs provides natural-sounding voices:

VoiceDescriptionBest For
RachelFemale, clearCustomer service
DrewMale, friendlyGeneral
SarahFemale, warmHealthcare, wellness
PaulMale, authoritativeBusiness

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

TypeCost (approx)
Outbound US$0.014/min
Inbound US$0.0085/min
Phone number$1/month

ElevenLabs

PlanCharacters/month
Free10,000
Starter30,000
Creator100,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: