Offline and realtime audio

Every audio capability runs in one of two modes, and the question is whether the input exists before you call the API:

  • Offline: you already have the whole input, such as a call recording, a podcast episode, or a script to voice. You send it in one request. The API processes all of it and returns the result: a full transcript, or a full audio file.
  • Realtime: the input is still being produced, such as a microphone, a phone line, or text that a model is writing. You open a session and send the input in small pieces, for example 100 ms of audio at a time. The API sends results back as they're ready: partial transcripts, events such as the end of a speaker's turn, or chunks of speech.

Pick the mode first, before the model and the options: it decides how you connect, how fast results arrive, and which features you can use.

Choose a mode

Choose a mode

Offline, realtime, or voice agents

Answer the questions from the top.

Choosing an audio mode: if the input is complete before you send it, use offline; if not and your app answers back by voice, use voice agents; otherwise, use realtime.

If the audio or the text exists before you call the API, start offline: it's simpler, and the model hears the whole input before it answers. If it's being produced while the user waits, you need realtime. If your app also answers back by voice, use voice agents, which run the whole conversation for you. To choose the model for each mode, see the Speech to Text and Text to Speech overviews.

What changes between the modes

What changes between the modes

The mode changes how you connect, what you get back, and which latency you measure.

OfflineRealtime
InputComplete, sent in one requestLive, sent in pieces during a session
ConnectionOne HTTP requestA WebSocket session that stays open
ResultOne complete result, or the same result streamed in piecesIncremental results and events while the session runs
Speed to watchTime to the complete result, which grows with the length of the inputDelay between the input and its result, which you can tune
Only in this modeTurn detection: knowing when a speaker has finished
ModelsOne model per capability, see the Speech to Text and Text to Speech overviewsA dedicated realtime model per capability
Tip

In realtime transcription, you choose the trade-off between speed and accuracy: a longer streaming delay, from 80 to 1,200 ms or 2,400 ms, gives the model more context before it commits to the text. For what drives each delay, see Latency.

Across the three capabilities

Across the three capabilities

Each capability supports the modes differently. Find yours, then follow the link to the article that covers it.

CapabilityOfflineRealtime
Speech to textTranscribe a recorded file. File transcriptionTranscribe live audio, with end-of-turn detection built in. Realtime transcription
Text to speechGenerate speech for a complete text, and optionally stream the audio back as it's generated. Speech generationStream speech
Voice agentsNot applicableAlways realtime: a session chains realtime transcription, a model, and speech. Voice agents
Note

Streaming the response of an offline request isn't the realtime mode. When you set stream on a transcription or speech request, the input is still complete when you send it: only the result arrives in pieces, so you see or hear it sooner. Realtime starts before the input is complete.

Going further

Going further