Skip to contentSkip to navigationSkip to topbar
On this page

ConversationRelay Onboarding Guide


Twilio's ConversationRelay enhances voice interactions by integrating real-time speech recognition and synthesis into your applications. This service is ideal for enterprises looking to create dynamic and responsive conversational experiences.

This guide walks you through the process of integrating your Twilio application with the ConversationRelay service.


Prerequisites

prerequisites page anchor

Complete these prerequisite steps before starting the integration process:

Set up your Twilio Account

set-up-your-twilio-account page anchor

Ensure you have a Twilio account set up and log into the Twilio Console(link takes you to an external page).

Configure WebSocket Server

configure-websocket-server page anchor

Set up a WebSocket server to handle communication with ConversationRelay. Ensure it's' accessible via a wss:// URL.


Integrate Twilio with ConversationRelay

integrate-twilio-with-conversationrelay page anchor

Once you've completed the prerequisites, follow these steps to integrate your Twilio application with ConversationRelay.

Configuration Steps in the Twilio Console

configuration-steps-in-the-twilio-console page anchor
  1. Log in to your Twilio Console(link takes you to an external page).
  2. Navigate to the Voice section, select General under Settings, and enable the Predictive and Generative AI/ML Features Addendum in order to use ConversationRelay.
  3. Navigate to the Voice section and select TwiML Apps under Manage.
  4. Create a new TwiML App or select an existing one.
  5. In the TwiML App settings, configure the Voice URL to point to your application's endpoint (for example, https://yourserver.com/voice) where Twilio can retrieve the TwiML containing the <ConversationRelay> instructions.
  6. Save your changes.

Configure ConversationRelay in your application

configure-conversationrelay-in-your-application page anchor
(warning)

Warning

Ensure your WebSocket server is properly configured to handle incoming messages from ConversationRelay. If not, you may encounter connection errors.

After configuring your TwiML App, update your application to handle ConversationRelay interactions:

Example TwiML:

1
<?xml version="1.0" encoding="UTF-8"?>
2
<Response>
3
<Connect action="https://myhttpserver.com/connect_action">
4
<ConversationRelay url="wss://mywebsocketserver.com/websocket" welcomeGreeting="Hi! Ask me anything!" />
5
</Connect>
6
</Response>

Develop your application with ConversationRelay

develop-your-application-with-conversationrelay page anchor

Once you've integrated ConversationRelay, you can enhance your application with advanced voice capabilities. Consider the following features:

Real-Time speech recognition

real-time-speech-recognition page anchor

Leverage ConversationRelay's real-time speech recognition to process caller input and respond dynamically.

Text-to-Speech synthesis

text-to-speech-synthesis page anchor

Use ConversationRelay to convert text responses into natural-sounding speech, providing a seamless conversational experience.

Pass custom parameters to ConversationRelay to tailor interactions based on specific use cases.


We value your feedback! Reach out to your Twilio Account Manager or contact our Sales Team(link takes you to an external page) with your thoughts on:

  • Developer experience
  • Integration ease
  • Feature configurability
  • Use case applicability

Need some help?

Terms of service

Copyright © 2024 Twilio Inc.