Skip to main content
Every message of RTVI protocol 2.3.0, generated from the protocol’s machine-readable AsyncAPI document. See RTVI for how the protocol works.

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.
string
required
The message’s id. An answer to it carries the same id.
string
required
The RTVI protocol version the client speaks, such as 2.3.0.
AboutClientData
required
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.
string
required
The message’s id. An answer to it carries the same id.
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.
string
required
The id of the client message this answers.
string
required
The RTVI protocol version the bot speaks with this client.
object
Information about the bot, such as the Pipecat library and version.
BotCapabilities
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.
string
required
What went wrong.
boolean
required
Whether the bot stopped because of the error.
Example

system-log

A line of the server’s log, for debugging. Off by default; turned on by the server’s system_logs_enabled setting.
string
required
The text.
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.
string
required
The message’s id. An answer to it carries the same id.
string
required
16-bit PCM audio, base64-encoded.
integer
required
The audio’s sample rate, in Hz.
integer
required
The audio’s number of channels.
Example

raw-audio-batch

Several chunks of the user’s audio, for transports that don’t carry media.
string
required
The message’s id. An answer to it carries the same id.
string[]
required
Chunks of 16-bit PCM audio, each base64-encoded, in order.
integer
required
The audio’s sample rate, in Hz.
integer
required
The audio’s number of channels.
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’s user_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’s user_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’s vad_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’s vad_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’s user_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’s user_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’s bot_speaking_enabled setting.
Example

bot-stopped-speaking

The bot stopped speaking. On by default; turned off by the server’s bot_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’s bot_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’s user_audio_level_enabled setting. Sent every 0.15 seconds by default, the server’s audio_level_period_secs setting.
number
required
How loud the audio is, from 0 (quiet) to 1 (loud).
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’s bot_audio_level_enabled setting. Sent every 0.15 seconds by default, the server’s audio_level_period_secs setting.
number
required
How loud the audio is, from 0 (quiet) to 1 (loud).
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’s user_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.
string
required
What the user said or typed.
string
required
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”.
string
required
When the user said or sent it.
boolean
required
Whether the text is final. Only an interim transcription isn’t.
string
Identifier for the user who spoke or typed. For chat, set only when the transport knows the sender, such as Daily and LiveKit.
string
For chat, the id of the client’s send-text message.
UserPerceptionSignal[]
For a transcription, how the user said it, when the STT service reports a reading with it. Part of expressive conversation (alpha).
TranscriptionSpeaker
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’s user_transcription_enabled setting. Deprecated. Use user-input or stt-raw-text instead.
string
required
The transcribed text.
string
required
Identifier for the user who spoke.
string
required
When the user said it.
boolean
required
Whether the transcription is final, as opposed to interim.
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’s bot_output_enabled setting.
string
required
The text.
string
required
What form the text is in (e.g., sentence, code, etc.). One of "backchannel", "expression_sound", "expression_pause", "sentence", "token", "word".
string
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".
string
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".
integer
Identifies the segment the text belongs to; every message about one segment, such as its spoken progress, carries the same id.
boolean
(v1 only) Whether the text has been spoken by TTS.
boolean
(v2+) Whether the text will be spoken by TTS.
string
(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.
SpokenProgressData
(v2+) Accumulated / remaining text breakdown. Present when will_be_spoken is true.
string[]
(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’s bot_llm_enabled setting. Deprecated. Use bot-output instead. It carries no timing. For text as the bot speaks it, use tts-raw-text.
string
required
The 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.
string
required
The message’s id. An answer to it carries the same id.
string
required
The message’s type, one of the application’s own.
any
The message’s data, of the application’s own.
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.
string
required
The id of the client message this answers.
string
required
What went wrong.
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.
string
required
The id of the client message this answers.
string
required
The t of the client message this answers.
any
The answer’s data, of the application’s own.
Example

server-message

A message from the bot’s application to the client, with data of the application’s own.
any
required
The application’s own data, any JSON value, as the bot’s application sent it.
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.
string
required
The message’s id. An answer to it carries the same id.
string
required
The text.
SendTextOptions | null
How the bot handles the text.
Example

send-file

A file for the bot, with text that goes with it.
string
required
The message’s id. An answer to it carries the same id.
string
required
Text that goes with the file, such as a question about it.
File
required
The file.
SendFileOptions | null
How the bot handles the file.
Example

dtmf

Keypad presses, delivered in order.
string
required
The message’s id. An answer to it carries the same id.
string[]
required
The keys pressed, in order: 0-9, * or #.
Example

llm-function-call-result

The result of a function call the client ran for the bot’s LLM.
string
required
The message’s id. An answer to it carries the same id.
string
required
Name of the function called.
string
required
Unique identifier of the call, as the server reported it.
object
required
Arguments the function was called with.
object | string
required
What the function returned.
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.
string
Name of the function called.
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.
string
required
Unique identifier of the call.
string
Name of the function called.
object
Arguments passed to the function.
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.
string
required
Unique identifier of the call.
boolean
required
Whether the call was cancelled rather than completed.
string
Name of the function called.
any
The result, when the call completed with one.
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.
string
required
Name of the function called.
string
required
Unique identifier of the call.
object
required
Arguments passed to the function.
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’s user_llm_enabled setting.
string
required
The text.
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’s stt_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
string
required
The transcribed text.
string
required
Identifier for the user who spoke.
string
required
When the user said it.
boolean
required
Whether the transcription is final, as opposed to interim.
TranscriptionSpeaker
Who said it, when the STT service’s diarization tells speakers apart.
Example

bot-llm-started

The bot’s LLM started generating a response. On by default; turned off by the server’s bot_llm_enabled setting.
Example

bot-llm-stopped

The bot’s LLM finished generating a response. On by default; turned off by the server’s bot_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’s bot_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’s bot_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’s llm_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
string
required
The text.
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’s tts_raw_text_enabled setting. Sent only to clients of protocol 2.2.0 or later.
string
required
The text.
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’s bot_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.
string
required
The marker as the LLM produced it; empty when the response carried none.
string
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.
string
default:""
required
The response’s text as the LLM produced it, markers included.
string[]
required
Every marker the emitter recognizes.
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’s bot_llm_enabled setting. Deprecated. Use llm-raw-text instead.
string
required
The text.
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’s bot_tts_enabled setting. Deprecated. Use tts-raw-text instead.
string
required
The text.
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’s metrics_enabled setting.
ProcessingMetricsData[]
How long each service took to process, in seconds.
TTFBMetricsData[]
Each service’s time to first byte, in seconds.
TTFAMetricsData[]
Each TTS service’s time to first audio: its time to first byte plus any silence before the first audible sample.
TTFATMetricsData[]
Each LLM service’s time to first answer token: its time to first byte plus any reasoning it streamed first.
LLMTokenUsage[]
The tokens each LLM call used.
STTUsageMetricsData[]
How much audio each STT service received.
TTSUsageMetricsData[]
How many characters each TTS service spoke.
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.
string
required
The message’s id. An answer to it carries the same id.
string
required
App-defined event.
any
App-defined payload, schemaless by design.
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.
string
required
The message’s id. An answer to it carries the same id.
A11ySnapshot
required
The serialized accessibility tree.
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.
string
required
The message’s id. An answer to it carries the same id.
string
required
The job group id the client wants cancelled.
string | null
Optional human-readable reason.
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.
UIJobGroupStartedData | UIJobUpdateData | UIJobCompletedData | UIJobGroupCompletedData
required
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)