> ## Documentation Index
> Fetch the complete documentation index at: https://docs.zeroruntime.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Openai

> Python API reference for the openai realtime models plugin.

<Card title="Usage guide" icon="book" href="/plugins/realtime/openai" horizontal>
  Setup, environment variables, and Python/JavaScript/Go usage examples.
</Card>

## 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

```python theme={null}
OpenAIRealtime(*, api_key: 'str | None' = None, config: 'OpenAIRealtimeConfig | None' = None, **kwargs)
```

<ParamField path="api_key" type="str | None">
  OpenAI API key. When omitted, the value of the `OPENAI_API_KEY` environment variable is used.
</ParamField>

<ParamField path="config" type="OpenAIRealtimeConfig | None">
  Provider configuration. When omitted, a default `OpenAIRealtimeConfig` is used.
</ParamField>

### aclose

```python theme={null}
def aclose(self) -> 'None'
```

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

```python theme={null}
def cleanup(self) -> 'None'
```

Clean up the integration by delegating to `aclose`.

***

## OpenAIRealtimeConfig

### Fields

<ParamField path="model" type="str" default="gpt-4o-realtime-preview" />

<ParamField path="voice" type="str" default="alloy" />

<ParamField path="modalities" type="List[str]" default="…" />

<ParamField path="temperature" type="float" default="0.8" />

<ParamField path="max_response_output_tokens" type="Union[int, str]" default="inf" />

<ParamField path="turn_detection" type="TurnDetectionConfig | None" default="…" />

<ParamField path="input_audio_transcription" type="InputAudioTranscriptionConfig | None" default="…" />

<ParamField path="tool_choice" type="str" default="auto" />
