0% found this document useful (0 votes)
9 views3 pages

OpenAI Realtime API Overview

Uploaded by

gtandanny
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views3 pages

OpenAI Realtime API Overview

Uploaded by

gtandanny
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

9/25/25, 10:44 AM Realtime API - OpenAI API

Copy page

Realtime API
Build low-latency, multimodal LLM applications with the Realtime API.

The OpenAI Realtime API enables low-latency communication with models that natively
support speech-to-speech interactions as well as multimodal inputs (audio, images, and text)
and outputs (audio and text). These APIs can also be used for realtime audio transcription.

Voice agents
One of the most common use cases for the Realtime API is building voice agents for speech-
to-speech model interactions in the browser. Our recommended starting point for these types
of applications is the Agents SDK for TypeScript, which uses a WebRTC connection to the
Realtime model in the browser, and WebSocket when used on the server.

1 import { RealtimeAgent, RealtimeSession } from "@openai/agents/realtime";


2
3 const agent = new RealtimeAgent({
4 name: "Assistant",
5 instructions: "You are a helpful assistant.",
6 });
7
8 const session = new RealtimeSession(agent);
9
10 // Automatically connects your microphone and audio output
11 await [Link]({
12 apiKey: "<client-api-key>",
13 });

Voice Agent Quickstart


Follow the voice agent quickstart to build Realtime agents in the browser.

To use the Realtime API directly outside the context of voice agents, check out the other
connection options below.

Connection methods
While building voice agents with the Agents SDK is the fastest path to one specific type of
application, the Realtime API provides an entire suite of flexible tools for a variety of use cases.
[Link] 1/3
9/25/25, 10:44 AM Realtime API - OpenAI API

There are three primary supported interfaces for the Realtime API:

WebRTC connection
Ideal for browser and client-side interactions with a Realtime model.

WebSocket connection
Ideal for middle tier server-side applications with consistent low-latency network connections.

SIP connection
Ideal for VoIP telephony connections.

Depending on how you'd like to connect to a Realtime model, check out one of the connection
guides above to get started. You'll learn how to initialize a Realtime session, and how to
interact with a Realtime model using client and server events.

API Usage
Once connected to a realtime model using one of the methods above, learn how to interact
with the model in these usage guides.

Prompting guide: learn tips and best practices for prompting and steering Realtime
models.
Managing conversations: Learn about the Realtime session lifecycle and the key events
that happen during a conversation.

Webhooks and server-side controls: Learn how you can control a Realtime session on the
server to call tools and implement guardrails.
Realtime audio transcription: Transcribe audio streams in real time over a WebSocket
connection.

Beta to GA migration
There are a few key differences between the interfaces in the Realtime beta API and the
recently released GA API. Expand the topics below for more information about migrating from
the beta interface to GA.

Beta header

Generating ephemeral API keys

New URL for WebRTC SDP data

[Link] 2/3
9/25/25, 10:44 AM Realtime API - OpenAI API

New event names and shapes

New conversation item events

Input and output item changes

[Link] 3/3

You might also like