Provider Comparison

🏢 Twilio

Traditional Leader
  • Mature, feature-rich platform
  • Global presence and reliability
  • Extensive documentation and community
  • Higher pricing on calls
  • Media Streams for real-time audio
  • SMS/MMS messaging support

⚡ Telnyx

Modern Alternative
  • Competitive pricing (often 50%+ savings)
  • Call Control API for advanced features
  • Developer-friendly modern APIs
  • SMS/MMS messaging support
  • Global carrier-grade network
  • WebRTC and SIP support

Provider Selection Logic

The system automatically determines which provider to use based on this priority:
1

Assistant-Level Credentials

Check if the assistant has telnyx_config or twilio_config configuredPriority: Telnyx > Twilio if both are present
2

Organization-Level Credentials

Fallback to organization-level telephony credentialsPriority: Telnyx > Twilio if both are present
3

Environment Variables

Use system-wide environment variables as last resortPriority: Telnyx > Twilio if both are present

Twilio Setup


Telnyx Setup


Mixed Environment Examples

Use Case 1: Cost Optimization

// High-volume sales assistant - use Telnyx for cost savings
{
  "name": "Sales Dialer Bot",
  "telnyx_config": {
    "api_key": "KEYxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "connection_id": "1234567890"
  }
}

// Premium support assistant - use Twilio for reliability
{
  "name": "VIP Support Bot", 
  "twilio_config": {
    "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "auth_token": "your_twilio_auth_token"
  }
}

Use Case 2: Geographic Optimization

// US/Canada assistant - use Telnyx for better rates
{
  "name": "North America Bot",
  "telnyx_config": {
    "api_key": "KEYxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "connection_id": "1234567890"
  }
}

// International assistant - use Twilio for global coverage
{
  "name": "Global Support Bot",
  "twilio_config": {
    "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
    "auth_token": "your_twilio_auth_token"
  }
}

Provider Migration

Gradual Migration

You can migrate assistants from one provider to another without downtime:
{
  "name": "Customer Service Bot",
  "twilio_config": {
    "account_sid": "ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "auth_token": "your_twilio_auth_token"
  }
}

Bulk Migration

Use the API to migrate multiple assistants:
import requests

# List all assistants
assistants = requests.get("/api/v1/assistants").json()

# Migrate each one
for assistant in assistants:
    requests.put(f"/api/v1/assistants/{assistant['id']}", json={
        "telnyx_config": {
            "api_key": "KEYxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
            "connection_id": "1234567890"
        },
        "twilio_config": {
            "account_sid": None,
            "auth_token": None
        }
    })

Troubleshooting


Best Practices

  • Start with one provider and add the second for specific use cases
  • Test thoroughly when switching providers for existing assistants
  • Monitor costs and usage patterns to optimize provider selection
  • Keep credentials secure and rotate them regularly
  • Use environment variables for global defaults, per-assistant config for exceptions

What’s Next?