Skip to main content

Usage guide

Setup, environment variables, and Python/JavaScript/Go usage examples.

OpenAIRealtime

Realtime speech-to-speech integration for the OpenAI Realtime API. Wraps an OpenAI Realtime model so it can be used as a full speech-to-speech provider within the runtime. Configuration is supplied through an OpenAIRealtimeConfig instance and resolved into a flat parameter map for the runtime.

Constructor

api_key
str | None
OpenAI API key. When omitted, the value of the OPENAI_API_KEY environment variable is used.
config
OpenAIRealtimeConfig | None
Provider configuration. When omitted, a default OpenAIRealtimeConfig is used.

aclose

Release any resources held by the integration. This implementation performs no work and exists so the integration can be used interchangeably with providers that require teardown.

cleanup

Clean up the integration by delegating to aclose.

OpenAIRealtimeConfig

Fields

model
str
default:"gpt-4o-realtime-preview"
voice
str
default:"alloy"
modalities
List[str]
default:"…"
temperature
float
default:"0.8"
max_response_output_tokens
Union[int, str]
default:"inf"
turn_detection
TurnDetectionConfig | None
default:"…"
input_audio_transcription
InputAudioTranscriptionConfig | None
default:"…"
tool_choice
str
default:"auto"