# `Mojentic.Realtime.OpenAIGateway`
[🔗](https://github.com/svetzal/mojentic-ex/blob/v1.5.0/lib/mojentic/realtime/openai_gateway.ex#L1)

Gateway against OpenAI's Realtime API over WebSocket.

Each `open/3` call provisions a new transport process. The returned
pid is the only stateful surface; subscribers receive
`{:realtime_message, parsed}` and `{:realtime_close, reason}`
tuples.

# `t`

```elixir
@type t() :: %Mojentic.Realtime.OpenAIGateway{
  api_key: String.t() | nil,
  base_url: String.t(),
  transport: module()
}
```

# `new`

Construct a new gateway. If `:api_key` is omitted, falls back to the
`OPENAI_API_KEY` environment variable.

# `open`

# `parse_message`

Pure helper to validate and parse a server event payload.
Re-exported so tests can drive the gateway with scripted messages.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
