OpenAiRealtimeGateway

class OpenAiRealtimeGateway(apiKey: String, httpClient: HttpClient = defaultClient(), baseUrl: String = DEFAULT_BASE_URL, betaHeader: String = DEFAULT_BETA_HEADER) : RealtimeGateway

OpenAI Realtime gateway over Ktor WebSockets.

The gateway is intentionally thin: it owns the WebSocket lifecycle and JSON framing, sends initial session.update derived from the supplied RealtimeVoiceConfig, and surfaces raw server events as a Flow. All orchestration (tool dispatch, event normalisation, audio plumbing) lives in the broker layer above.

Constructors

Link copied to clipboard
constructor(apiKey: String, httpClient: HttpClient = defaultClient(), baseUrl: String = DEFAULT_BASE_URL, betaHeader: String = DEFAULT_BETA_HEADER)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun open(model: String, config: RealtimeVoiceConfig, correlationId: String?): RealtimeGatewaySession