OpenAI API

RealtimeServerEventConversationItemTruncated

object

Returned when an earlier assistant audio message item is truncated by the
client with a conversation.item.truncate event. This event is used to
synchronize the server’s understanding of the audio with the client’s playback.

This action will truncate the audio and remove the server-side text transcript
to ensure there is no text in the context that hasn’t been heard by the user.

event_idstringrequired

The unique ID of the server event.

typestringrequired

The event type, must be conversation.item.truncated.

Allowed values:conversation.item.truncated

item_idstringrequired

The ID of the assistant message item that was truncated.

content_indexintegerrequired

The index of the content part that was truncated.

audio_end_msintegerrequired

The duration up to which the audio was truncated, in milliseconds.

Example

RealtimeServerEventError

object

Returned when an error occurs, which could be a client problem or a server
problem. Most errors are recoverable and the session will stay open, we
recommend to implementors to monitor and log error messages by default.

event_idstringrequired

The unique ID of the server event.

typestringrequired

The event type, must be error.

Allowed values:error

errorobjectrequired

Details of the error.

Show Child Parameters
Example

RealtimeServerEventInputAudioBufferCleared

object

Returned when the input audio buffer is cleared by the client with a
input_audio_buffer.clear event.

event_idstringrequired

The unique ID of the server event.

typestringrequired

The event type, must be input_audio_buffer.cleared.

Allowed values:input_audio_buffer.cleared

Example

RealtimeServerEventInputAudioBufferCommitted

object

Returned when an input audio buffer is committed, either by the client or
automatically in server VAD mode. The item_id property is the ID of the user
message item that will be created, thus a conversation.item.created event
will also be sent to the client.

event_idstringrequired

The unique ID of the server event.

typestringrequired

The event type, must be input_audio_buffer.committed.

Allowed values:input_audio_buffer.committed

previous_item_idstringrequired

The ID of the preceding item after which the new item will be inserted.

item_idstringrequired

The ID of the user message item that will be created.

Example

RealtimeServerEventInputAudioBufferSpeechStarted

object

Sent by the server when in server_vad mode to indicate that speech has been
detected in the audio buffer. This can happen any time audio is added to the
buffer (unless speech is already detected). The client may want to use this
event to interrupt audio playback or provide visual feedback to the user.

The client should expect to receive a input_audio_buffer.speech_stopped event
when speech stops. The item_id property is the ID of the user message item
that will be created when speech stops and will also be included in the
input_audio_buffer.speech_stopped event (unless the client manually commits
the audio buffer during VAD activation).

event_idstringrequired

The unique ID of the server event.

typestringrequired

The event type, must be input_audio_buffer.speech_started.

Allowed values:input_audio_buffer.speech_started

audio_start_msintegerrequired

Milliseconds from the start of all audio written to the buffer during the
session when speech was first detected. This will correspond to the
beginning of audio sent to the model, and thus includes the
prefix_padding_ms configured in the Session.

item_idstringrequired

The ID of the user message item that will be created when speech stops.

Example