VoiceAgentRealtimeClientConnectOptions interface

Options for connecting the realtime client to a voice agent.

Extends

Properties

abortSignal

Cancels the connection attempt.

agentSessionId

Identifier used to correlate the voice session.

agentVersionOverride

Selects a specific immutable agent version.

connectionTimeoutInMs

Overrides the client connection timeout in milliseconds.

foundryFeatures

Opts into Handoff, SIP transfer destinations, or post-call preview features. Omit for GA agents.

onConnectionStateChange

Receives connection-state transitions.

query

Custom URL query parameters. Values are URL-encoded; undefined removes a parameter. Realtime connections accept an explicit structured_inputs JSON-object string instead of structuredInputs. Other SDK/authentication, structured-input, and h-* keys are reserved. Never include sensitive values; URLs may be logged.

store

Overrides whether the conversation created by this session is persisted.

structuredInputs

Prompt-variable values captured when connect() is called. Realtime connections use a header in Node.js and the URL query in browsers. GPT Live uses the URL query. For explicit Realtime URL transport, use query.structured_inputs instead. Do not put sensitive data in URL-carried inputs.

transport

Connection transport. Defaults to "websocket". Use "webrtc" only if your app handles the SDP offer/answer exchange through the rtc.call.sdp.create and rtc.call.sdp.created events.

Inherited Properties

onResponse

A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.

requestOptions

Options used when creating and sending HTTP requests for this operation.

tracingOptions

Options used when tracing is enabled.

Property Details

abortSignal

Cancels the connection attempt.

abortSignal?: AbortSignalLike

Property Value

agentSessionId

Identifier used to correlate the voice session.

agentSessionId?: string

Property Value

string

agentVersionOverride

Selects a specific immutable agent version.

agentVersionOverride?: string

Property Value

string

connectionTimeoutInMs

Overrides the client connection timeout in milliseconds.

connectionTimeoutInMs?: number

Property Value

number

foundryFeatures

Opts into Handoff, SIP transfer destinations, or post-call preview features. Omit for GA agents.

foundryFeatures?: "VoiceAgents=V1Preview"

Property Value

"VoiceAgents=V1Preview"

onConnectionStateChange

Receives connection-state transitions.

onConnectionStateChange?: VoiceAgentConnectionStateChangedHandler

Property Value

query

Custom URL query parameters. Values are URL-encoded; undefined removes a parameter. Realtime connections accept an explicit structured_inputs JSON-object string instead of structuredInputs. Other SDK/authentication, structured-input, and h-* keys are reserved. Never include sensitive values; URLs may be logged.

query?: Readonly<Record<string, string | number | boolean | undefined>>

Property Value

Readonly<Record<string, string | number | boolean | undefined>>

store

Overrides whether the conversation created by this session is persisted.

store?: boolean

Property Value

boolean

structuredInputs

Prompt-variable values captured when connect() is called. Realtime connections use a header in Node.js and the URL query in browsers. GPT Live uses the URL query. For explicit Realtime URL transport, use query.structured_inputs instead. Do not put sensitive data in URL-carried inputs.

structuredInputs?: Record<string, unknown>

Property Value

Record<string, unknown>

transport

Connection transport. Defaults to "websocket". Use "webrtc" only if your app handles the SDP offer/answer exchange through the rtc.call.sdp.create and rtc.call.sdp.created events.

transport?: VoiceAgentTransport

Property Value

Inherited Property Details

onResponse

A function to be called each time a response is received from the server while performing the requested operation. May be called multiple times.

onResponse?: RawResponseCallback

Property Value

Inherited From OperationOptions.onResponse

requestOptions

Options used when creating and sending HTTP requests for this operation.

requestOptions?: OperationRequestOptions

Property Value

Inherited From OperationOptions.requestOptions

tracingOptions

Options used when tracing is enabled.

tracingOptions?: OperationTracingOptions

Property Value

Inherited From OperationOptions.tracingOptions