OptionalapiOptionalinstructionsSystem instructions passed via session.update.
OptionalmodelRealtime model id. Defaults to OPENAI_REALTIME_MODEL.
OptionalroleAGENT (default) makes the model the agent under test. USER turns
it into the voice-enabled user simulator — scripted user("text")
steps route through sendText and bypass the TTS pipeline.
OptionaltoolsTool definitions passed straight through to the Realtime session.
OptionalurlOverride the Realtime endpoint URL. Defaults to
wss://api.openai.com/v1/realtime?model=<model>. Lets tests point at
a loopback WS server without subclassing the adapter.
OptionalvoiceVoice id (e.g. "alloy", "nova").
OptionalwsOptional factory that creates the WebSocket instead of new WebSocket(url, headers). Intended for testing — lets tests inject a fake WS without
subclassing or monkey-patching. The factory receives the resolved URL and
Authorization header value.
Explicit API key; falls back to
process.env.OPENAI_REALTIME_API_KEY, thenprocess.env.OPENAI_API_KEY. Realtime always connects directly to OpenAI, so keep a real provider key here whenOPENAI_API_KEYholds a gateway virtual key.