The OpenAI Realtime API provides low-latency, bidirectional, event-driven communication with multimodal models that natively support speech-to-speech, text, and audio in a single conversation. This AsyncAPI document describes the **WebSocket** transport for the Realtime API, including all documented client-to-server events and server-to-client events. The Realtime API is currently in beta. Clients must include the `OpenAI-Beta: realtime=v1` header when connecting. Connection URL: wss://api.openai.com/v1/realtime?model={model} Events flow over a single full-duplex WebSocket connection. Every event has a top-level `type` and most events also carry an `event_id` correlation id.
View SpecView on GitHubArtificial IntelligenceLarge Language ModelsT1AsyncAPIEventsWebSockets
Channels
session.update
publishsendSessionUpdate
Update session configuration.
Send by the client to update the session's default configuration (modalities, instructions, voice, audio formats, turn detection, tools, tool_choice, temperature, max_response_output_tokens).
input_audio_buffer.append
publishsendInputAudioBufferAppend
Append audio bytes to the input buffer.
Send by the client to append base64-encoded audio bytes to the input audio buffer. The default audio format is `pcm16` at 24 kHz.
input_audio_buffer.commit
publishsendInputAudioBufferCommit
Commit the input audio buffer.
Send by the client to commit the input audio buffer to the conversation as a user message. Required in non-VAD modes before requesting a response.
input_audio_buffer.clear
publishsendInputAudioBufferClear
Clear the input audio buffer.
Send by the client to clear the input audio buffer without committing it.
conversation.item.create
publishsendConversationItemCreate
Insert a conversation item.
Send by the client to insert a conversation item (a message, function_call, or function_call_output) into the conversation history.
conversation.item.truncate
publishsendConversationItemTruncate
Truncate an in-progress assistant item.
Send by the client to truncate the assistant audio of an in-progress response item. Used for interruption: audio after `audio_end_ms` is discarded and any text after that point is cleared.
conversation.item.delete
publishsendConversationItemDelete
Delete a conversation item.
Send by the client to delete a conversation item by id.
response.create
publishsendResponseCreate
Trigger a model response.
Send by the client to instruct the model to generate a response. Optionally overrides the session configuration for this single response.
response.cancel
publishsendResponseCancel
Cancel an in-progress response.
Send by the client to cancel an in-progress response.
error
subscribereceiveError
Receive an error event.
Server-emitted error envelope. Sent whenever a client event is invalid or the server encounters a problem processing a request.
session.created
subscribereceiveSessionCreated
Receive session.created.
Emitted by the server immediately after the WebSocket connection is authenticated. Contains the initial session configuration.
session.updated
subscribereceiveSessionUpdated
Receive session.updated.
Emitted after the server applies a `session.update` from the client.
conversation.created
subscribereceiveConversationCreated
Receive conversation.created.
Emitted by the server when a new conversation is created on the session.
conversation.item.created
subscribereceiveConversationItemCreated
Receive conversation.item.created.
Emitted when a new conversation item has been added (either by the client or by the model generating a response).
OpenAI Realtime WebSocket endpoint. The `model` query parameter selects the underlying realtime-capable model (for example `gpt-4o-realtime-preview-2024-10-01`).
Discovery needs no key. Ratings and market analysis are Pro.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. See our Privacy Policy and
Terms.