OptionalapiOptionalinstructionsSystem instructions passed via session.update.
OptionalmintWhere to mint the session credential, overriding OPENAI_BASE_URL and
OPENAI_API_KEY. false skips the mint and dials the vendor directly.
POST /v1/realtime/client_secrets is OpenAI's own path, and a LangWatch
AI Gateway mirrors it, so the same request works against either. Against
OpenAI it returns an ephemeral client secret. Against a gateway it also
checks the virtual key's budget and open-session cap and opens one spend
record, naming the session on the X-LangWatch-Session-Id response
header. Usage is reported back only when that header is present.
The media socket runs to the vendor either way, so latency and the wire protocol do not change.
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 for dialing the vendor directly; falls back to
process.env.OPENAI_REALTIME_API_KEY, thenprocess.env.OPENAI_API_KEY.This key is only used when the session is not minted, so it matters when
OPENAI_BASE_URLpoints at an endpoint with no mint route. Seemint.