# openai/openai-live-console architecture

> Architecture diagram of the GitHub repository openai/openai-live-console, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-11-18). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/openai/openai-live-console
- Repository: https://github.com/openai/openai-live-console

## Overview

OpenAI Live Console is a local voice interface for discussing a fictional backpack catalog. The user starts a microphone-enabled conversation; the browser establishes Live audio and displays events, while the local server manages credentials, session lifecycle, and read-only catalog tools. Delegation can be Live-managed or app-managed, with the latter calling a Responses backend. The README documents these capabilities; edges involving unsampled request paths rely on that documentation rather than inspected implementations.

Main entry points: [`server/http.ts`](https://github.com/openai/openai-live-console/blob/main/server/http.ts) (HTTP Gateway), [`server/session.ts`](https://github.com/openai/openai-live-console/blob/main/server/session.ts) (Live Session), [`client/App.tsx`](https://github.com/openai/openai-live-console/blob/main/client/App.tsx) (Console UI), [`server/index.ts`](https://github.com/openai/openai-live-console/blob/main/server/index.ts) (Server Startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_browser["Browser Console"]
  node_app["Console UI<br/>[App.tsx]"]
  node_browser_session["Browser Session<br/>[session.ts]"]
  node_event_state["Event State<br/>[state.ts]"]
end

subgraph group_server["Local Server"]
  node_server_entry["Server Startup<br/>[index.ts]"]
  node_config["Runtime Config<br/>[config.ts]"]
  node_http["HTTP Gateway<br/>[http.ts]"]
  node_live_session["Live Session<br/>[session.ts]"]
  node_errors["Error Mapping<br/>[errors.ts]"]
end

subgraph group_domain["Tools And Protocol"]
  node_types["Shared Events<br/>[types.ts]"]
  node_protocol["Event Protocol<br/>[protocol.ts]"]
  node_catalog["Catalog Tools<br/>[catalog.ts]"]
end

subgraph group_upstream["OpenAI Services"]
  node_gateway["OpenAI Adapter<br/>[openai.ts]"]
end

node_user(("Console User"))
node_openai{{"OpenAI APIs"}}

node_user -->|"uses"| node_app
node_app -->|"starts session"| node_browser_session
node_app -->|"reduces events"| node_event_state
node_app -->|"fetches config"| node_http
node_browser_session -->|"creates and closes"| node_http
node_browser_session -->|"streams WebRTC audio"| node_openai
node_server_entry -->|"loads settings"| node_config
node_server_entry -->|"creates adapter"| node_gateway
node_server_entry -->|"creates app"| node_http
node_http -->|"routes sessions"| node_live_session
node_http -->|"maps failures"| node_errors
node_live_session -->|"creates and attaches"| node_gateway
node_live_session -->|"executes tools"| node_catalog
node_live_session -->|"records events"| node_protocol
node_live_session -->|"delegates backend work"| node_openai
node_gateway -->|"calls Live and Responses"| node_openai
node_protocol -->|"uses tool definitions"| node_catalog
node_http -->|"checks settings"| node_config

click node_app "https://github.com/openai/openai-live-console/blob/main/client/App.tsx"
click node_browser_session "https://github.com/openai/openai-live-console/blob/main/client/session.ts"
click node_event_state "https://github.com/openai/openai-live-console/blob/main/client/state.ts"
click node_types "https://github.com/openai/openai-live-console/blob/main/shared/types.ts"
click node_server_entry "https://github.com/openai/openai-live-console/blob/main/server/index.ts"
click node_config "https://github.com/openai/openai-live-console/blob/main/server/config.ts"
click node_http "https://github.com/openai/openai-live-console/blob/main/server/http.ts"
click node_live_session "https://github.com/openai/openai-live-console/blob/main/server/session.ts"
click node_gateway "https://github.com/openai/openai-live-console/blob/main/server/openai.ts"
click node_protocol "https://github.com/openai/openai-live-console/blob/main/server/protocol.ts"
click node_catalog "https://github.com/openai/openai-live-console/blob/main/server/catalog.ts"
click node_errors "https://github.com/openai/openai-live-console/blob/main/server/errors.ts"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_browser_session,node_event_state,node_user toneBlue
class node_server_entry,node_config,node_http,node_live_session,node_errors toneAmber
class node_types,node_protocol,node_catalog,node_openai toneMint
class node_gateway toneRose
```

## Components

### Browser Console

- [Console UI](https://github.com/openai/openai-live-console/blob/main/client/App.tsx): `client/App.tsx`
- [Browser Session](https://github.com/openai/openai-live-console/blob/main/client/session.ts): `client/session.ts`
- [Event State](https://github.com/openai/openai-live-console/blob/main/client/state.ts): `client/state.ts`

### Local Server

- [Server Startup](https://github.com/openai/openai-live-console/blob/main/server/index.ts): `server/index.ts`
- [Runtime Config](https://github.com/openai/openai-live-console/blob/main/server/config.ts): `server/config.ts`
- [HTTP Gateway](https://github.com/openai/openai-live-console/blob/main/server/http.ts): `server/http.ts`
- [Live Session](https://github.com/openai/openai-live-console/blob/main/server/session.ts): `server/session.ts`
- [Error Mapping](https://github.com/openai/openai-live-console/blob/main/server/errors.ts): `server/errors.ts`

### Tools And Protocol

- [Shared Events](https://github.com/openai/openai-live-console/blob/main/shared/types.ts): `shared/types.ts`
- [Event Protocol](https://github.com/openai/openai-live-console/blob/main/server/protocol.ts): `server/protocol.ts`
- [Catalog Tools](https://github.com/openai/openai-live-console/blob/main/server/catalog.ts): `server/catalog.ts`

### OpenAI Services

- [OpenAI Adapter](https://github.com/openai/openai-live-console/blob/main/server/openai.ts): `server/openai.ts`

### Other components

- **Console User**
- **OpenAI APIs**

## Connections

- Console User → Console UI: uses (evidence: `README.md`)
- Console UI → Browser Session: starts session (evidence: `client/App.tsx`)
- Console UI → Event State: reduces events (evidence: `client/App.tsx`)
- Console UI → HTTP Gateway: fetches config (evidence: `client/App.tsx`)
- Browser Session → HTTP Gateway: creates and closes (evidence: `README.md`)
- Browser Session → OpenAI APIs: streams WebRTC audio (evidence: `README.md`)
- Server Startup → Runtime Config: loads settings (evidence: `server/index.ts`)
- Server Startup → OpenAI Adapter: creates adapter (evidence: `server/index.ts`)
- Server Startup → HTTP Gateway: creates app (evidence: `server/index.ts`)
- HTTP Gateway → Live Session: routes sessions (evidence: `server/http.ts`)
- HTTP Gateway → Error Mapping: maps failures (evidence: `server/http.ts`)
- Live Session → OpenAI Adapter: creates and attaches (evidence: `server/session.ts`)
- Live Session → Catalog Tools: executes tools (evidence: `server/session.ts`)
- Live Session → Event Protocol: records events (evidence: `server/session.ts`)
- Live Session → OpenAI APIs: delegates backend work (evidence: `README.md`)
- OpenAI Adapter → OpenAI APIs: calls Live and Responses (evidence: `server/openai.ts`)
- Event Protocol → Catalog Tools: uses tool definitions (evidence: `server/protocol.ts`)
- HTTP Gateway → Runtime Config: checks settings (evidence: `server/http.ts`)
