Read session status, voice responses, and task execution results.
Receive JSON events over the control WebSocket. When using WebRTC or AOQ, wait for
After the connection is established, the service returns default session information. After sending Event type; fixed value: Server-side event ID.Default session information.
Business session ID. AOQ Relay uses an independent Compatible object name, e.g., Deployed default frontend voice model.Output modality.Default voice style.Default turn detection configuration. The detection settings below are returned when
Turn detection type.Voice activity detection threshold.Length of audio retained before the detected speech start, in milliseconds.Duration of silence required to detect the end of speech, in milliseconds.Whether to generate a reply automatically when speech ends.Whether to interrupt an ongoing reply when the user starts speaking.Audio transcription capability and its default configuration.
Model used to transcribe input audio.The service supports integration with models. Inference and interaction begin only after the session configuration takes effect.
The session configuration has taken effect. Use the returned configuration.
Event type; fixed value: Server-side event ID.Effective session configuration, including session metadata and task mode.
Business session ID.Effective frontend voice model.Session object type.Effective output modality.Task mode.
Returns connection information for the selected transmission method.
When using WebRTC, the value is When using WebRTC, returns the Answer SDP. The client sets it as the remote description. For details, see WebRTC access.When using AOQ, returns temporary connection information. Use the returned
AOQ session ID.Temporary token that the client uses to connect to the Relay.Fingerprint of the Relay’s TLS certificate.List of Relay addresses for the connection.
Relay address.Relay port.Relay route index.Additional connection information.
Hash of the workspace ID.
Input is muted.
Event type; fixed value: Server-side event ID.Corresponds to the client’s requested
Input is unmuted.
Event type; fixed value: Server-side event ID.Corresponds to the client’s requested
Receives the transcription of user speech.
Event type; fixed value: Server-side event ID.The transcription text returned in this response.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.
Receives subtitles for the frontend voice reply. Subtitle timestamps are used to locate positions on the session timeline.
Event type; fixed value: Server-side event ID.The reply text returned in this response.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.
Receives an audio chunk from the frontend voice.
Event type; fixed value: Server-side event ID.Base64-encoded 24 kHz mono PCM16LE raw audio. After decoding, the byte count is even. The audio has no WAV file header.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.
The frontend model dispatches a task. This event is received in both Client mode and Responses mode. When returning the task result, use the Event type; fixed value: Server-side event ID.The offset of this dispatch on the session timeline, in milliseconds.The task ID associated with this dispatch.Task ID. Used in the return payload as Summary of the dispatched task in this response.Context snapshot at the time the task is accepted.
Context summary.Context messages.
Sequence number of the message in the context.Message item ID.Role of the message sender.Source of the message.Start offset of the audio on the session timeline, in milliseconds.End offset of the audio on the session timeline, in milliseconds.Audio playback status.Message text.Whether the context snapshot is incomplete.Whether the context snapshot was truncated.Additional content accepted in this batch and their respective contexts.
Supplementary content summary.Context snapshot at the time the task is accepted.
Context summary.Context messages.Compatible field. A JSON string that may contain
Receives frontend function calls. Uses Event type; fixed value: Server-side event ID.Corresponds to the client’s requested Frontend model function call event.
Inner event name.Function call item.
The function call item is Function name.Call ID.Function arguments in JSON string format.Call item ID.Call item status.Output location of the call item.Frontend response ID.
Receives backend generation or task events. The inner Event type; fixed value: Server-side event ID.Associated task ID.Corresponds to the client’s requested Backend native event or task event.
Inner event name.Backend response. Fields vary by event.
Backend response ID.Backend model token usage.
Number of input tokens consumed by the backend model.Number of output tokens generated by the backend model.Total number of input and output tokens.
Service has accepted the task progress. For request Event type; fixed value: Server-side event ID.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.Corresponds to the client’s requested
Service has accepted the follow-up content. For request Event type; fixed value: Server-side event ID.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.Corresponds to the client’s requested
Service has accepted the result or text. For request Event type; fixed value: Server-side event ID.Start time on the session timeline, in milliseconds.End time on the session timeline, in milliseconds.Corresponds to the client’s requested
After session activation, the service reports cumulative billing duration every 5 seconds; reports are also sent during idle periods. The current value takes the latest Event type; fixed value: Server-side event ID.Session usage.
Cumulative billing duration for the session (in seconds). This is the greater of 3 seconds and the elapsed session duration.Context usage.
Token usage divided by the context limit. Results may be delayed.
The session has ended. Stop sending events and release resources. To continue the conversation, establish a new connection and initialize a new session.
Event type; fixed value: Server-side event ID.Reason for closure. Possible values are Configuration snapshot returned when the session closes.
Business session ID.Session object type.The status in the snapshot may still show Frontend speech model used for the session.Final usage metrics at session termination.
Cumulative billing duration for the session (in seconds). This is the greater of 3 seconds and the elapsed session duration.
Check the request and session status based on the error code. After receiving a close event, reestablish the connection.
Event type; fixed value: Server-side event ID.Error details.
Error code. For example, Error description.Corresponds to the client’s requested
session.updated on that WebSocket. Once the media connection is ready, you can also receive server events over the WebRTC DataChannel or the AOQ data track.
Handle events according to type. The client_event_id in the acknowledgment corresponds to the event_id in the request. The event_id of each server-side event uniquely identifies that event.
session.created
After the connection is established, the service returns default session information. After sending session.update, wait for session.updated to confirm that the configuration has taken effect.
typestringRequiredsession.created.event_idstringRequiredsessionobjectRequiredView child fields
View child fields
idstringRequiredsid.objectstringRequiredrealtime.session.modelstringRequiredmodalitiesarrayReturned per modelvoicestringReturned per modelturn_detectionobjectReturned per modeltype is server_vad.View child fields
View child fields
typestringthresholdnumberprefix_padding_msintegersilence_duration_msintegercreate_responsebooleaninterrupt_responsebooleaninput_audio_transcriptionobjectReturned per modelView child fields
View child fields
modelstringmodel_inferencebooleanRequiredsession.updated
The session configuration has taken effect. Use the returned configuration.
typestringRequiredsession.updated.event_idstringRequiredsessionobjectRequiredView child fields
View child fields
idstringRequiredmodelstringRequiredobjectstringReturned per configurationmodalitiesarrayReturned per configurationdelegationobjectRequiredView child fields
View child fields
typestringRequiredclient or responses.transportobjectReturned per configurationView child fields
View child fields
typestringReturned per configurationrtc.sdpstringReturned per configurationaoqobjectReturned per configurationsid and temporary credentials to initiate the AOQ connection within 5 minutes of receiving session.updated. For steps to connect, see AOQ access.View child fields
View child fields
sidstringaoqTokenForClientstringclientRelayCertFingerprintstringclientRelayEndpointsarrayView child fields
View child fields
endpointstringportintegerroute_indexintegerextraInfoobjectView child fields
View child fields
workspaceIdHashstring- WebSocket
- WebRTC (excerpt)
- AOQ (excerpt)
session.input_audio.muted
Input is muted.
typestringRequiredsession.input_audio.muted.event_idstringRequiredclient_event_idstringOptionalevent_id.session.input_audio.unmuted
Input is unmuted.
typestringRequiredsession.input_audio.unmuted.event_idstringRequiredclient_event_idstringOptionalevent_id.session.input_transcript.delta
Receives the transcription of user speech.
typestringRequiredsession.input_transcript.delta.event_idstringRequireddeltastringRequiredstart_msnumberRequiredend_msnumberRequiredsession.output_transcript.delta
Receives subtitles for the frontend voice reply. Subtitle timestamps are used to locate positions on the session timeline.
typestringRequiredsession.output_transcript.delta.event_idstringRequireddeltastringRequiredstart_msnumberRequiredend_msnumberRequiredsession.output_audio.delta
Receives an audio chunk from the frontend voice.
typestringRequiredsession.output_audio.delta.event_idstringOptionaldeltastringRequiredstart_msnumberRequiredend_msnumberRequiredsession.delegation.created
The frontend model dispatches a task. This event is received in both Client mode and Responses mode. When returning the task result, use the delegation_id from the corresponding task event.
typestringRequiredsession.delegation.created.event_idstringRequiredoffset_msnumberRequireddelegation_idstringRequiredtask_idstringOptionaldelegation_id.summarystringReturned upon task dispatchcontextobjectReturned upon task dispatchView child fields
View child fields
summarystringRequiredmessagesarray[object]Returned upon task dispatchView child fields
View child fields
seqintegeritem_idstringrolestringsourcestringaudio_start_msintegeraudio_end_msintegerplaybackstringcontentstringincompletebooleantruncatedbooleansupplementsarrayReturned per taskView child fields
View child fields
summarystringRequiredcontextobjectReturned upon task dispatchView child fields
View child fields
summarystringRequiredmessagesarrayReturned upon task dispatchargumentsstringOptionalsummary.session.event
Receives frontend function calls. Uses call_id to correlate results.
typestringRequiredsession.event.event_idstringRequiredclient_event_idstringOptionalevent_id.eventobjectRequiredView child fields
View child fields
typestringRequireditemobjectReturns per event.View child fields
View child fields
typestringRequiredfunction_call.namestringRequiredcall_idstringRequiredargumentsstringRequiredidstringReturns per event.statusstringReturns per event.output_indexnumberReturns per event.response_idstringReturns per event.response.event
Receives backend generation or task events. The inner response.completed indicates the end of backend generation. Frontend voice responses have their own subtitle and audio events.
typestringRequiredresponse.event.event_idstringRequireddelegation_idstringReturns per event.client_event_idstringOptionalevent_id.eventobjectRequiredView child fields
View child fields
typestringRequiredresponseobjectReturns per event.View child fields
View child fields
idstringReturns per event.usageobjectOptionalView child fields
View child fields
input_tokensintegerReturns per event.output_tokensintegerReturns per event.total_tokensintegerReturns per event.session.thinking.appended
Service has accepted the task progress. For request session.thinking.append, the acknowledgment can be matched using the associated field.
typestringRequiredsession.thinking.appended.event_idstringRequiredstart_msnumberRequiredend_msnumberRequiredclient_event_idstringOptionalevent_id.session.instructions.appended
Service has accepted the follow-up content. For request session.instruction.append, the acknowledgment can be matched using the associated field.
typestringRequiredsession.instructions.appended.event_idstringRequiredstart_msnumberRequiredend_msnumberRequiredclient_event_idstringOptionalevent_id.session.commentary.appended
Service has accepted the result or text. For request session.commentary.append, the acknowledgment can be matched using the associated field.
typestringRequiredsession.commentary.appended.event_idstringRequiredstart_msnumberRequiredend_msnumberRequiredclient_event_idstringOptionalevent_id.session.usage.updated
After session activation, the service reports cumulative billing duration every 5 seconds; reports are also sent during idle periods. The current value takes the latest usage.seconds, and the final value is read from session.closed. Backend model token usage is available in response.event.
typestringRequiredsession.usage.updated.event_idstringRequiredusageobjectRequiredView child fields
View child fields
secondsnumberRequiredcontext_windowobjectOptionalView child fields
View child fields
usage_rationumberOptionalsession.closed
The session has ended. Stop sending events and release resources. To continue the conversation, establish a new connection and initialize a new session.
typestringRequiredsession.closed.event_idstringRequiredreasonstringRequiredclose_requested, expired, content, remote_hangup, or connection_lost.sessionobjectRequiredView child fields
View child fields
idstringReturned with the snapshot.objectstringReturned with the snapshot.statusstringReturned with the snapshot.active. Use the session.closed event to determine that the session has closed.modelstringReturned with the snapshot.usageobjectRequiredView child fields
View child fields
secondsnumberRequirederror
Check the request and session status based on the error code. After receiving a close event, reestablish the connection.
typestringRequirederror.event_idstringRequirederrorobjectRequiredView child fields
View child fields
typestringRequiredinvalid_request_error or server_error.codestringRequiredinvalid_session_configuration or invalid_event_state.messagestringRequiredevent_idstringOptionalevent_id.