Quickstart
Creating your first voice-powered AI agent with Ultravox is easy. This guide will walk you through the process of creating a simple voice-enabled AI agent.
There are three main steps to building a voice-enabled AI agent with the Ultravox API:
-
Create a Call → Construct a
systemPrompt
and choose avoice
for your AI agent. This returns ajoinUrl
that you use to join the call. -
Join the Call → Using the
joinUrl
from the previous step, join the call which starts a speech-to-speech conversation with your AI agent. -
End the Call → When the conversation is complete, end the call to stop the conversation.
Create a Call
The first step is to create a call. This is done by doing a POST
to the /calls
endpoint. This call should be made from a server to prevent accidentally leaking your API key on the client. Here is what that looks like:
This returns the following response:
We will ignore voice
and languageHint
for now.
The joinUrl
will be used in the next step.
Join the Call
Now that we have a joinUrl
, we can use the ultravox-client
in our application to join the call. The ultravox-client
is available for multiple languages. More info on the SDK page.
We need to reference the ultravox-client
in our front-end, create an UltravoxSession
, and then call the joinCall
method:
End the Call
When the call is over, simply use the endCall()
method on the UltravoxSession
object:
Examples
There are some examples
you can fork and run.