AI / Core OpenAI Codex Application Fundamentals Interview Questions
What is the OpenAI Realtime API and what use cases does it enable?
The Realtime API (generally available since 2025) enables low-latency, bidirectional audio and text streaming - powering live voice agents, speech-to-speech applications, and real-time transcription. As of 2026, the product line has expanded significantly.
| Model | Purpose |
|---|---|
| GPT-Realtime-2 | Next-gen realtime voice with configurable reasoning for speech-to-speech agents |
| GPT-Realtime-Translate | Streaming speech translation between languages |
| GPT-Realtime-Whisper | Streaming speech-to-text (transcription) |
| gpt-audio-mini | Efficient audio model for production voice pipelines |
import asyncio import websockets import json # Realtime API uses WebSocket connection: async def realtime_session(): url = "wss://api.openai.com/v1/realtime?model=gpt-realtime-2" headers = { "Authorization": f"Bearer {OPENAI_API_KEY}", "OpenAI-Beta": "realtime=v1" } async with websockets.connect(url, extra_headers=headers) as ws: # Configure session await ws.send(json.dumps({ "type": "session.update", "session": { "modalities": ["text", "audio"], "voice": "alloy", "instructions": "You are a helpful coding assistant.", "input_audio_format": "pcm16", "output_audio_format": "pcm16", } })) # Stream audio input await ws.send(json.dumps({ "type": "input_audio_buffer.append", "audio": base64_pcm16_audio_chunk, })) # Commit and request response await ws.send(json.dumps({"type": "input_audio_buffer.commit"})) await ws.send(json.dumps({"type": "response.create"}))
Key use cases: voice customer service agents, real-time meeting transcription and translation, voice-controlled coding assistants, accessibility tools, and interactive voice tutorials. The SIP IP ranges feature added in 2026 enables integration with traditional telephony systems.
More Related questions...