Skip to content

RealtimeSessionOptions

type RealtimeSessionOptions<TContext> = object;
Type Parameter Default type

TContext

unknown

apiKey: ApiKey;

The API key to use for the connection. Pass a function to lazily load the API key


optional config: Partial<RealtimeSessionConfig>;

Additional session config options. Overrides default client options.


optional context: TContext;

Additional context to pass to the agent


optional groupId: string;

A group identifier to use for tracing, to link multiple traces together. For example, if you want to connect your RealtimeSession traces with those of a backend text-based agent run.


optional historyStoreAudio: boolean;

Whether the history copy should include a local copy of the audio data. By default it is not included in the history to save runtime memory on the client. If you wish to keep this data you can enable this option.


optional model:
| OpenAIRealtimeModels
| string & object;

The model to use.


optional outputGuardrails: RealtimeOutputGuardrail[];

Any output guardrails to apply to agent output in parallel


optional outputGuardrailSettings: RealtimeOutputGuardrailSettings;

Configure the behavior of your guardrails


optional traceMetadata: Record<string, any>;

An optional dictionary of additional metadata to include with the trace.


optional tracingDisabled: boolean;

Whether tracing is disabled for this session. If disabled, we will not trace the agent run.


transport:
| "webrtc"
| "websocket"
| RealtimeTransportLayer;

The transport layer to use.


optional workflowName: string;

The workflow name to use for tracing.