Connection Management
Starting and ending a session, and errors.Client sends
client-ready
Tells the server the client is ready, with the protocol version it speaks. The server answers with bot-ready. Typically sent once the transport has connected.Information about the client. A server receiving a
client-ready without it, or with an invalid one, still starts the session, as a client of an unknown library.Example
disconnect-bot
Asks the server to end the session. Disconnecting from the transport ends the session too. This message is for a client that wants to stay connected to the transport but end its conversation with the bot.Example
Client receives
bot-ready
Answers client-ready once the bot is ready to talk, with the protocol version the server speaks to this client, information about the bot, and what it can do. Its id is the client-ready’s id.about is the bot’s own information: Pipecat’s library and version, unless the application replaces it. An application shouldn’t put anything sensitive in it.
What the bot does in this session (media sent and received, metrics), so the client can show only the UI that applies. Added in protocol 2.2.0.
Example
error
Reports an error in the bot, such as an AI service that failed. When fatal is true, the bot can’t go on and the session ends.Example
system-log
A line of the server’s log, for debugging. Off by default; turned on by the server’ssystem_logs_enabled setting.
Example
Speaking and Transcription
Who is speaking, the user’s audio, and what the user and the bot said.Client sends
raw-audio
A chunk of the user’s audio, for transports that don’t carry media.Example
raw-audio-batch
Several chunks of the user’s audio, for transports that don’t carry media.Example
Client receives
user-started-speaking
The user’s turn started: the bot considers the user to be speaking. On by default; turned off by the server’suser_speaking_enabled setting.
Example
user-stopped-speaking
The user’s turn ended: the bot considers the user done speaking. On by default; turned off by the server’suser_speaking_enabled setting.
Example
vad-user-started-speaking
Voice activity detection (VAD) heard the user start speaking. It reacts to any voice, sooner than user-started-speaking, which comes when the bot decides the user’s turn started. Off by default; turned on by the server’svad_user_speaking_enabled setting.
Example
vad-user-stopped-speaking
Voice activity detection (VAD) heard the user stop speaking. It reacts to any pause, sooner than user-stopped-speaking, which comes when the bot decides the user’s turn ended. Off by default; turned on by the server’svad_user_speaking_enabled setting.
Example
user-mute-started
The bot stopped listening to the user, for example while it says something that must not be interrupted. On by default; turned off by the server’suser_mute_enabled setting.
The client should keep sending audio. It may show the user that their input isn’t being processed.
Example
user-mute-stopped
The bot listens to the user again. On by default; turned off by the server’suser_mute_enabled setting.
The client may show the user that their input is being processed again.
Example
bot-started-speaking
The bot started speaking: its audio started playing to the user. On by default; turned off by the server’sbot_speaking_enabled setting.
Example
bot-stopped-speaking
The bot stopped speaking. On by default; turned off by the server’sbot_speaking_enabled setting.
Example
bot-interrupted
The bot was interrupted and stopped what it was saying. A client should drop the bot’s text that hadn’t been spoken yet. On by default; turned off by the server’sbot_speaking_enabled setting.
The user speaking over the bot interrupts it, and so does a send-text with run_immediately.
Example
user-audio-level
How loud the user’s audio is, from 0 (quiet) to 1 (loud), sent regularly while the user’s audio comes in. Off by default; turned on by the server’suser_audio_level_enabled setting.
Sent every 0.15 seconds by default, the server’s audio_level_period_secs setting.
Example
bot-audio-level
How loud the bot’s audio is, from 0 (quiet) to 1 (loud), sent regularly while the bot speaks. Off by default; turned on by the server’sbot_audio_level_enabled setting.
Sent every 0.15 seconds by default, the server’s audio_level_period_secs setting.
Example
user-input
What the user said or typed: a transcription of their speech, text the client sent, or a short acknowledgment the user said while the bot talks. On by default; turned off by the server’suser_input_enabled setting.
Sent for each transcription of the user’s speech; for each short acknowledgment the user says while the bot talks, which neither interrupts the bot nor reaches its LLM; and for each send-text message, with the send-text’s id in msg_id.
What kind of input it is:
"transcription" for speech transcribed by the STT, "chat" for text the client sent, or "backchannel" for a short acknowledgment the user said while the bot talks, such as “mhm”.Identifier for the user who spoke or typed. For chat, set only when the transport knows the sender, such as Daily and LiveKit.
For a transcription, how the user said it, when the STT service reports a reading with it. Part of expressive conversation (alpha).
For a transcription, who said it, when the STT service’s diarization tells speakers apart.
Example
user-transcription
A transcription of the user’s speech, including interim transcriptions that may still change. On by default; turned off by the server’suser_transcription_enabled setting. Deprecated. Use user-input or stt-raw-text instead.
Example
bot-output
Text the bot says or shows, a sentence or another unit at a time, with whether it will be spoken and how much of it has been spoken. On by default; turned off by the server’sbot_output_enabled setting.
What form the text is in (e.g., sentence, code, etc.). One of
"backchannel", "expression_sound", "expression_pause", "sentence", "token", "word".What form the text is in, always the same as
output_type. Deprecated: Use output_type instead. One of "backchannel", "expression_sound", "expression_pause", "sentence", "token", "word".What form the text is in, always the same as
output_type. Deprecated: Use output_type instead. One of "backchannel", "expression_sound", "expression_pause", "sentence", "token", "word".Identifies the segment the text belongs to; every message about one segment, such as its spoken progress, carries the same id.
(v2+) Lifecycle status of the segment:
"new" on its first message, the only one for text that isn’t spoken; "in-progress" as each of its words is spoken, for TTS services with word timestamps; "completed" once its last word is spoken.(v2+) Accumulated / remaining text breakdown. Present when
will_be_spoken is true.(2.3.0+) The delivery of the text just spoken, by its universal names, such as
["warm", "emphasis"], empty for the voice’s baseline. They change within a segment where its delivery does, so a segment’s "new" message has none. Present in expressive conversation (alpha).Example
bot-transcription
The text of the bot’s LLM response, a whole sentence at a time. On by default; turned off by the server’sbot_llm_enabled setting. Deprecated. Use bot-output instead.
It carries no timing. For text as the bot speaks it, use tts-raw-text.
Example
Client-Server Messaging
Messages of the application’s own, and the answers to client messages.Client sends
client-message
A custom message for the application. The server answers with server-response or error-response.Example
Client receives
error-response
Answers a client message the server couldn’t handle, with what went wrong. Its id is the id of the message it answers.Example
server-response
The bot’s answer to a client-message. Its id is the client-message’s id, and t is the client-message’s t.Example
server-message
A message from the bot’s application to the client, with data of the application’s own.Example
Advanced LLM Interactions
Text, files and keypresses for the bot, and the bot’s function calls.Client sends
send-text
Text the user typed, sent to the bot as if the user had said it.Example
send-file
A file for the bot, with text that goes with it.Example
dtmf
Keypad presses, delivered in order.Example
llm-function-call-result
The result of a function call the client ran for the bot’s LLM.Example
Client receives
llm-function-call-started
The bot’s LLM started calling a function. The server’s settings decide whether it includes the function’s name. The server’s report level for the function decides whether it carries the function’s name:name, arguments and full do, and none doesn’t. At disabled, the server sends no messages about the call.
Example
llm-function-call-in-progress
A function call is running, with its id and, as the server’s settings decide, the function’s name and arguments. How much it carries depends on the server’s report level for the function:none sends only the call’s id, name adds the function’s name, arguments its arguments, and full its result. At disabled, the server sends no messages about the call. A client that runs the function itself answers with llm-function-call-result.
Example
llm-function-call-stopped
A function call finished or was cancelled, with its id and, as the server’s settings decide, the function’s name and result. How much it carries depends on the server’s report level for the function:none sends only the call’s id, name adds the function’s name, arguments its arguments, and full its result. At disabled, the server sends no messages about the call.
Example
llm-function-call
The bot’s LLM called a function, with its name, id and arguments. Deprecated. Use llm-function-call-in-progress instead.Example
Service-Specific Insights
What the bot’s speech-to-text, LLM and text-to-speech services are doing.Client receives
user-llm-text
The user’s message as the bot’s LLM receives it. On by default; turned off by the server’suser_llm_enabled setting.
Example
stt-raw-text
A transcription of the user’s speech as the speech-to-text service produces it, including interim transcriptions that may still change. Off by default; turned on by the server’sstt_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
Example
bot-llm-started
The bot’s LLM started generating a response. On by default; turned off by the server’sbot_llm_enabled setting.
Example
bot-llm-stopped
The bot’s LLM finished generating a response. On by default; turned off by the server’sbot_llm_enabled setting.
Example
bot-tts-started
The bot’s text-to-speech service started turning a response into speech. On by default; turned off by the server’sbot_tts_enabled setting.
Example
bot-tts-stopped
The bot’s text-to-speech service finished turning a response into speech. On by default; turned off by the server’sbot_tts_enabled setting.
Example
llm-raw-text
Text exactly as the bot’s LLM streams it, a chunk at a time. Off by default; turned on by the server’sllm_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
Example
tts-raw-text
Text the bot’s text-to-speech service speaks, as it speaks it. Off by default; turned on by the server’stts_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
Example
bot-llm-marker
The marker the bot’s LLM put in a response, outside the text it speaks, such as one saying whether the user’s turn was complete. Sent once per response, when it ends. Off by default; turned on by the server’sbot_llm_marker_enabled setting.
It carries the raw text of the whole response, so it’s meant for evaluation and debugging rather than for the user.
What the marker means, such as
complete, short or long for the markers that say whether the user’s turn was complete, silent for a reply dropped as the wait-reassurance silent mark, or null when it means nothing the server knows.Example
bot-llm-text
Text as the bot’s LLM streams it, a chunk at a time. On by default; turned off by the server’sbot_llm_enabled setting. Deprecated. Use llm-raw-text instead.
Example
bot-tts-text
Text the bot’s text-to-speech service speaks, as it speaks it. On by default; turned off by the server’sbot_tts_enabled setting. Deprecated. Use tts-raw-text instead.
Example
Metrics and Monitoring
How the bot’s services perform.Client receives
metrics
Performance metrics of the bot’s services, such as how long each took to respond and how much it processed. On by default; turned off by the server’smetrics_enabled setting.
Each TTS service’s time to first audio: its time to first byte plus any silence before the first audible sample.
Each LLM service’s time to first answer token: its time to first byte plus any reasoning it streamed first.
Example
User Interface
The bot observing and driving the client’s UI.Client sends
ui-event
An event from the client’s UI, for a UI worker.Example
ui-snapshot
An accessibility snapshot of the client’s UI, for a UI worker. Sent whenever the client’s UI changes, so the bot works from what is on screen.Example
ui-cancel-job-group
Asks the server to cancel a job group it reported with ui-job-group. The server cancels the group only if it reported the group as cancellable.Example
Client receives
ui-command
A command from the bot to the client’s UI, such as showing a notification. The standard commands each have a payload of their own, and@pipecat-ai/client-react has a default handler for each. An application can also send commands of its own.
UIToastCommand | UINavigateCommand | UIScrollToCommand | UIHighlightCommand | UIFocusCommand | UIClickCommand | UISetInputValueCommand | UISelectTextCommand | UIAppCommand
required
Example
ui-job-group
Progress of work the bot handed to other workers, for the client’s UI: the work started, a worker’s update or result, or all of it completed.Example
Server Behaviors
The rules a server follows across messages, beyond the shape of each one.- bot-ready-answers-client-ready: Once the bot is ready, the server answers client-ready with a bot-ready carrying the client-ready’s id. (
client-ready,bot-ready) - bot-ready-version: bot-ready’s version is the protocol version the server speaks to the client: the server’s own for a client of the same major version, and the client’s own for a 1.x client. (
client-ready,bot-ready) - client-ready-version-check: A client-ready without a version, with a malformed one, or of a major version the server doesn’t speak gets an error-response carrying its id. The session goes on, and the server still answers with bot-ready. (
client-ready,error-response,bot-ready) - failed-request-gets-error-response: A client message the server can’t handle, of an unknown type or with data that doesn’t match its payload, gets an error-response carrying the message’s id. (
error-response) - invalid-message-gets-error: A transport message labeled “rtvi-ai” that isn’t an RTVI message, such as one without an id, gets an error, since there is no id to answer. The server ignores a message without the “rtvi-ai” label. (
error) - client-message-answer: The bot answers a client-message with a server-response or an error-response carrying the client-message’s id. A server-response’s t is the client-message’s t. (
client-message,server-response,error-response) - disconnect-bot-ends-session: disconnect-bot ends the bot’s session. (
disconnect-bot) - messages-turned-off: The server sends a message that has x-rtvi-enabled-by only while the server setting it names is on. The settings are fields of Pipecat’s RTVIObserverParams.
- spoken-output-waits-for-speech: bot-output for text the bot will speak waits for the bot to start speaking: the server sends it after bot-started-speaking, in the order the text came. (
bot-started-speaking,bot-output) - interruption-drops-unspoken-output: On an interruption, the server sends bot-interrupted, and never sends the bot-output it was holding for speech that the interruption cut off. (
bot-interrupted,bot-output)