Skip to content
For the complete documentation index, see llms.txt. Markdown versions of documentation pages are available by appending .md to the page URL.
Primary navigation
Theme

Server events

These are events emitted from the OpenAI Realtime WebSocket server to the client.

error

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 implementers to monitor and log error messages by default.

error: RealtimeError { message, type, code, 2 more }

Details of the error.

event_id: string

The unique ID of the server event.

type: "error"

The event type, must be error.

session.created

Returned when a Session is created. Emitted automatically when a new connection is established as the first server event. This event will contain the default Session configuration.

event_id: string

The unique ID of the server event.

session: RealtimeSessionCreateResponse { id, object, type, 13 more } or RealtimeTranscriptionSessionCreateResponse { id, object, type, 3 more }

The session configuration.

type: "session.created"

The event type, must be session.created.

session.updated

Returned when a session is updated with a session.update event, unless there is an error.

event_id: string

The unique ID of the server event.

session: RealtimeSessionCreateResponse { id, object, type, 13 more } or RealtimeTranscriptionSessionCreateResponse { id, object, type, 3 more }

The session configuration.

type: "session.updated"

The event type, must be session.updated.

conversation.item.added

Sent by the server when an Item is added to the default Conversation. This can happen in several cases:

  • When the client sends a conversation.item.create event.
  • When the input audio buffer is committed. In this case the item will be a user message containing the audio from the buffer.
  • When the model is generating a Response. In this case the conversation.item.added event will be sent when the model starts generating a specific Item, and thus it will not yet have any content (and status will be in_progress).

The event will include the full content of the Item (except when model is generating a Response) except for audio data, which can be retrieved separately with a conversation.item.retrieve event if necessary.

event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

type: "conversation.item.added"

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

previous_item_id: optional string or null

The ID of the item that precedes this one, if any. This is used to maintain ordering when items are inserted.

conversation.item.done

Returned when a conversation item is finalized.

The event will include the full content of the Item except for audio data, which can be retrieved separately with a conversation.item.retrieve event if needed.

event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

type: "conversation.item.done"

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

previous_item_id: optional string or null

The ID of the item that precedes this one, if any. This is used to maintain ordering when items are inserted.

conversation.item.retrieved

Returned when a conversation item is retrieved with conversation.item.retrieve. This is provided as a way to fetch the server's representation of an item, for example to get access to the post-processed audio data after noise cancellation and VAD. It includes the full content of the Item, including audio data.

event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

type: "conversation.item.retrieved"

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

conversation.item.input_audio_transcription.completed

This event is the output of audio transcription for user audio written to the user audio buffer. Transcription begins when the input audio buffer is committed by the client or server (when VAD is enabled). Transcription runs asynchronously with Response creation, so this event may come before or after the Response events.

Realtime API models accept audio natively, and thus input transcription is a separate process run on a separate ASR (Automatic Speech Recognition) model. The transcript may diverge somewhat from the model's interpretation, and should be treated as a rough guide.

content_index: integer

The index of the content part containing the audio.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item containing the audio that is being transcribed.

transcript: string

The transcribed text.

type: "conversation.item.input_audio_transcription.completed"

The event type, must be conversation.item.input_audio_transcription.completed.

usage: Tokens { input_tokens, output_tokens, total_tokens, 2 more } or Duration { seconds, type }

Usage statistics for the transcription, this is billed according to the ASR model's pricing rather than the realtime model's pricing.

languages: optional array of TranscriptionLanguage { code }

The languages detected in the audio. Returned by gpt-transcribe. An empty array indicates that no language could be reliably detected.

code: string

The code of a language detected in the audio.

logprobs: optional array of LogProbProperties { token, bytes, logprob } or null

The log probabilities of the transcription.

conversation.item.input_audio_transcription.delta

Returned when the text value of an input audio transcription content part is updated with incremental transcription results.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item containing the audio that is being transcribed.

type: "conversation.item.input_audio_transcription.delta"

The event type, must be conversation.item.input_audio_transcription.delta.

content_index: optional integer

The index of the content part in the item's content array.

delta: optional string

The text delta.

logprobs: optional array of LogProbProperties { token, bytes, logprob } or null

The log probabilities of the transcription. These can be enabled by configuring the session with "include": ["item.input_audio_transcription.logprobs"]. Each entry in the array corresponds a log probability of which token would be selected for this chunk of transcription. This can help to identify if it was possible there were multiple valid options for a given chunk of transcription.

conversation.item.input_audio_transcription.segment

Returned when an input audio transcription segment is identified for an item.

id: string

The segment identifier.

content_index: integer

The index of the input audio content part within the item.

end: number

End time of the segment in seconds.

formatdouble
event_id: string

The unique ID of the server event.

item_id: string

The ID of the item containing the input audio content.

speaker: string

The detected speaker label for this segment.

start: number

Start time of the segment in seconds.

formatdouble
text: string

The text for this segment.

type: "conversation.item.input_audio_transcription.segment"

The event type, must be conversation.item.input_audio_transcription.segment.

conversation.item.input_audio_transcription.failed

Returned when input audio transcription is configured, and a transcription request for a user message failed. These events are separate from other error events so that the client can identify the related Item.

content_index: integer

The index of the content part containing the audio.

error: object { code, message, param, type }

Details of the transcription error.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the user message item.

type: "conversation.item.input_audio_transcription.failed"

The event type, must be conversation.item.input_audio_transcription.failed.

conversation.item.truncated

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.

audio_end_ms: integer

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

content_index: integer

The index of the content part that was truncated.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the assistant message item that was truncated.

type: "conversation.item.truncated"

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

conversation.item.deleted

Returned when an item in the conversation is deleted by the client with a conversation.item.delete event. This event is used to synchronize the server's understanding of the conversation history with the client's view.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item that was deleted.

type: "conversation.item.deleted"

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

input_audio_buffer.committed

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_id: string

The unique ID of the server event.

item_id: string

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

type: "input_audio_buffer.committed"

The event type, must be input_audio_buffer.committed.

previous_item_id: optional string or null

The ID of the preceding item after which the new item will be inserted. Can be null if the item has no predecessor.

input_audio_buffer.dtmf_event_received

SIP Only: Returned when an DTMF event is received. A DTMF event is a message that represents a telephone keypad press (0–9, *, #, A–D). The event property is the keypad that the user press. The received_at is the UTC Unix Timestamp that the server received the event.

event: string

The telephone keypad that was pressed by the user.

received_at: integer

UTC Unix Timestamp when DTMF Event was received by server.

type: "input_audio_buffer.dtmf_event_received"

The event type, must be input_audio_buffer.dtmf_event_received.

input_audio_buffer.cleared

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

event_id: string

The unique ID of the server event.

type: "input_audio_buffer.cleared"

The event type, must be input_audio_buffer.cleared.

input_audio_buffer.speech_started

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).

audio_start_ms: integer

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.

event_id: string

The unique ID of the server event.

item_id: string

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

type: "input_audio_buffer.speech_started"

The event type, must be input_audio_buffer.speech_started.

input_audio_buffer.speech_stopped

Returned in server_vad mode when the server detects the end of speech in the audio buffer. The server will also send an conversation.item.created event with the user message item that is created from the audio buffer.

audio_end_ms: integer

Milliseconds since the session started when speech stopped. This will correspond to the end of audio sent to the model, and thus includes the min_silence_duration_ms configured in the Session.

event_id: string

The unique ID of the server event.

item_id: string

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

type: "input_audio_buffer.speech_stopped"

The event type, must be input_audio_buffer.speech_stopped.

input_audio_buffer.timeout_triggered

Returned when the Server VAD timeout is triggered for the input audio buffer. This is configured with idle_timeout_ms in the turn_detection settings of the session, and it indicates that there hasn't been any speech detected for the configured duration.

The audio_start_ms and audio_end_ms fields indicate the segment of audio after the last model response up to the triggering time, as an offset from the beginning of audio written to the input audio buffer. This means it demarcates the segment of audio that was silent and the difference between the start and end values will roughly match the configured timeout.

The empty audio will be committed to the conversation as an input_audio item (there will be a input_audio_buffer.committed event) and a model response will be generated. There may be speech that didn't trigger VAD but is still detected by the model, so the model may respond with something relevant to the conversation or a prompt to continue speaking.

audio_end_ms: integer

Millisecond offset of audio written to the input audio buffer at the time the timeout was triggered.

audio_start_ms: integer

Millisecond offset of audio written to the input audio buffer that was after the playback time of the last model response.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item associated with this segment.

type: "input_audio_buffer.timeout_triggered"

The event type, must be input_audio_buffer.timeout_triggered.

output_audio_buffer.started

WebRTC/SIP Only: Emitted when the server begins streaming audio to the client. This event is emitted after an audio content part has been added (response.content_part.added) to the response. Learn more.

event_id: string

The unique ID of the server event.

response_id: string

The unique ID of the response that produced the audio.

type: "output_audio_buffer.started"

The event type, must be output_audio_buffer.started.

output_audio_buffer.stopped

WebRTC/SIP Only: Emitted when the output audio buffer has been completely drained on the server, and no more audio is forthcoming. This event is emitted after the full response data has been sent to the client (response.done). Learn more.

event_id: string

The unique ID of the server event.

response_id: string

The unique ID of the response that produced the audio.

type: "output_audio_buffer.stopped"

The event type, must be output_audio_buffer.stopped.

output_audio_buffer.cleared

WebRTC/SIP Only: Emitted when the output audio buffer is cleared. This happens either in VAD mode when the user has interrupted (input_audio_buffer.speech_started), or when the client has emitted the output_audio_buffer.clear event to manually cut off the current audio response. Learn more.

event_id: string

The unique ID of the server event.

response_id: string

The unique ID of the response that produced the audio.

type: "output_audio_buffer.cleared"

The event type, must be output_audio_buffer.cleared.

response.created

Returned when a new Response is created. The first event of response creation, where the response is in an initial state of in_progress.

event_id: string

The unique ID of the server event.

response: RealtimeResponse { id, audio, conversation_id, 8 more }

The response resource.

type: "response.created"

The event type, must be response.created.

response.done

Returned when a Response is done streaming. Always emitted, no matter the final state. The Response object included in the response.done event will include all output Items in the Response but will omit the raw audio data.

Clients should check the status field of the Response to determine if it was successful (completed) or if there was another outcome: cancelled, failed, or incomplete.

A response will contain all output items that were generated during the response, excluding any audio content.

event_id: string

The unique ID of the server event.

response: RealtimeResponse { id, audio, conversation_id, 8 more }

The response resource.

type: "response.done"

The event type, must be response.done.

response.output_item.added

Returned when a new Item is created during Response generation.

event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

output_index: integer

The index of the output item in the Response.

response_id: string

The ID of the Response to which the item belongs.

type: "response.output_item.added"

The event type, must be response.output_item.added.

response.output_item.done

Returned when an Item is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.

event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

output_index: integer

The index of the output item in the Response.

response_id: string

The ID of the Response to which the item belongs.

type: "response.output_item.done"

The event type, must be response.output_item.done.

response.content_part.added

Returned when a new content part is added to an assistant message item during response generation.

content_index: integer

The index of the content part in the item's content array.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item to which the content part was added.

output_index: integer

The index of the output item in the response.

part: object { audio, text, transcript, type }

The content part that was added.

response_id: string

The ID of the response.

type: "response.content_part.added"

The event type, must be response.content_part.added.

response.content_part.done

Returned when a content part is done streaming in an assistant message item. Also emitted when a Response is interrupted, incomplete, or cancelled.

content_index: integer

The index of the content part in the item's content array.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

part: object { audio, text, transcript, type }

The content part that is done.

response_id: string

The ID of the response.

type: "response.content_part.done"

The event type, must be response.content_part.done.

response.output_text.delta

Returned when the text value of an "output_text" content part is updated.

content_index: integer

The index of the content part in the item's content array.

delta: string

The text delta.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.output_text.delta"

The event type, must be response.output_text.delta.

response.output_text.done

Returned when the text value of an "output_text" content part is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.

content_index: integer

The index of the content part in the item's content array.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

text: string

The final text content.

type: "response.output_text.done"

The event type, must be response.output_text.done.

response.output_audio_transcript.delta

Returned when the model-generated transcription of audio output is updated.

content_index: integer

The index of the content part in the item's content array.

delta: string

The transcript delta.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.output_audio_transcript.delta"

The event type, must be response.output_audio_transcript.delta.

response.output_audio_transcript.done

Returned when the model-generated transcription of audio output is done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.

content_index: integer

The index of the content part in the item's content array.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

transcript: string

The final transcript of the audio.

type: "response.output_audio_transcript.done"

The event type, must be response.output_audio_transcript.done.

response.output_audio.delta

Returned when the model-generated audio is updated.

content_index: integer

The index of the content part in the item's content array.

delta: string

Base64-encoded audio data delta.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.output_audio.delta"

The event type, must be response.output_audio.delta.

response.output_audio.done

Returned when the model-generated audio is done. Also emitted when a Response is interrupted, incomplete, or cancelled.

content_index: integer

The index of the content part in the item's content array.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.output_audio.done"

The event type, must be response.output_audio.done.

response.function_call_arguments.delta

Returned when the model-generated function call arguments are updated.

call_id: string

The ID of the function call.

delta: string

The arguments delta as a JSON string.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the function call item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.function_call_arguments.delta"

The event type, must be response.function_call_arguments.delta.

response.function_call_arguments.done

Returned when the model-generated function call arguments are done streaming. Also emitted when a Response is interrupted, incomplete, or cancelled.

arguments: string

The final arguments as a JSON string.

call_id: string

The ID of the function call.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the function call item.

name: string

The name of the function that was called.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.function_call_arguments.done"

The event type, must be response.function_call_arguments.done.

response.mcp_call_arguments.delta

Returned when MCP tool call arguments are updated during response generation.

delta: string

The JSON-encoded arguments delta.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP tool call item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.mcp_call_arguments.delta"

The event type, must be response.mcp_call_arguments.delta.

obfuscation: optional string or null

If present, indicates the delta text was obfuscated.

response.mcp_call_arguments.done

Returned when MCP tool call arguments are finalized during response generation.

arguments: string

The final JSON-encoded arguments string.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP tool call item.

output_index: integer

The index of the output item in the response.

response_id: string

The ID of the response.

type: "response.mcp_call_arguments.done"

The event type, must be response.mcp_call_arguments.done.

response.mcp_call.in_progress

Returned when an MCP tool call has started and is in progress.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP tool call item.

output_index: integer

The index of the output item in the response.

type: "response.mcp_call.in_progress"

The event type, must be response.mcp_call.in_progress.

response.mcp_call.completed

Returned when an MCP tool call has completed successfully.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP tool call item.

output_index: integer

The index of the output item in the response.

type: "response.mcp_call.completed"

The event type, must be response.mcp_call.completed.

response.mcp_call.failed

Returned when an MCP tool call has failed.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP tool call item.

output_index: integer

The index of the output item in the response.

type: "response.mcp_call.failed"

The event type, must be response.mcp_call.failed.

mcp_list_tools.in_progress

Returned when listing MCP tools is in progress for an item.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP list tools item.

type: "mcp_list_tools.in_progress"

The event type, must be mcp_list_tools.in_progress.

mcp_list_tools.completed

Returned when listing MCP tools has completed for an item.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP list tools item.

type: "mcp_list_tools.completed"

The event type, must be mcp_list_tools.completed.

mcp_list_tools.failed

Returned when listing MCP tools has failed for an item.

event_id: string

The unique ID of the server event.

item_id: string

The ID of the MCP list tools item.

type: "mcp_list_tools.failed"

The event type, must be mcp_list_tools.failed.

rate_limits.updated

Emitted at the beginning of a Response to indicate the updated rate limits. When a Response is created some tokens will be "reserved" for the output tokens, the rate limits shown here reflect that reservation, which is then adjusted accordingly once the Response is completed.

event_id: string

The unique ID of the server event.

rate_limits: array of object { limit, name, remaining, reset_seconds }

List of rate limit information.

type: "rate_limits.updated"

The event type, must be rate_limits.updated.

conversation.created

Returned when a conversation is created. Emitted right after session creation.

conversation: object { id, object }

The conversation resource.

id: optional string

The unique ID of the conversation.

object: optional string

The object type, must be realtime.conversation.

event_id: string

The unique ID of the server event.

type: "conversation.created"

The event type, must be conversation.created.

conversation.item.created

Returned when a conversation item is created. There are several scenarios that produce this event:

  • The server is generating a Response, which if successful will produce either one or two Items, which will be of type message (role assistant) or type function_call.
  • The input audio buffer has been committed, either by the client or the server (in server_vad mode). The server will take the content of the input audio buffer and add it to a new user message Item.
  • The client has sent a conversation.item.create event to add a new Item to the Conversation.
event_id: string

The unique ID of the server event.

A single item within a Realtime conversation.

type: "conversation.item.created"

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

previous_item_id: optional string or null

The ID of the preceding item in the Conversation context, allows the client to understand the order of the conversation. Can be null if the item has no predecessor.