惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

S
SegmentFault 最新的问题
J
Java Code Geeks
V
V2EX
Blog — PlanetScale
Blog — PlanetScale
博客园 - 司徒正美
Hugging Face - Blog
Hugging Face - Blog
F
Fortinet All Blogs
aimingoo的专栏
aimingoo的专栏
B
Blog
A
About on SuperTechFans
有赞技术团队
有赞技术团队
月光博客
月光博客
Microsoft Azure Blog
Microsoft Azure Blog
阮一峰的网络日志
阮一峰的网络日志
腾讯CDC
美团技术团队
大猫的无限游戏
大猫的无限游戏
爱范儿
爱范儿
N
Netflix TechBlog - Medium
C
Check Point Blog
Recent Announcements
Recent Announcements
博客园 - Franky
博客园 - 叶小钗
T
Tailwind CSS Blog

OpenAI Developers

API deployment checklist | OpenAI API Sora 2 Prompting Guide Codex Prompting Guide Docs MCP | OpenAI Developers Gpt-image-1.5 Prompting Guide GPT-5.2 Prompting Guide Transcribing User Audio with a Separate Realtime Request Modernizing your Codebase with Codex GitHub - openai/openai-sora-sample-app: Sample app to get started using the Video API with Sora GitHub - openai/openai-apps-sdk-examples: Example apps for the Apps SDK GitHub - openai/openai-chatkit-advanced-samples: Starter app to build with OpenAI ChatKit SDK GitHub - openai/openai-chatkit-starter-app: Starter app to build with OpenAI ChatKit + Agent Builder Rate limits | OpenAI API Web search | OpenAI API Getting started with datasets | OpenAI API Prompt optimizer | OpenAI API Verifying gpt-oss implementations How to run gpt-oss locally with LM Studio Fine-tuning with gpt-oss and Hugging Face Transformers How to run gpt-oss locally with Ollama Function calling | OpenAI API Models | OpenAI API Reasoning best practices | OpenAI API Reasoning models | OpenAI API Background mode | OpenAI API Batch API | OpenAI API Conversation state | OpenAI API File search | OpenAI API Flex processing | OpenAI API MCP and Connectors | OpenAI API
Realtime and audio | OpenAI API
2025-07-21 · via OpenAI Developers

Start with the outcome you want to build. Realtime sessions are best for live audio that needs low latency. Request-based audio APIs are best for files, bounded requests, or generated speech that doesn’t need a live session.

GoalModel or APIStart here
Build a low-latency voice agentgpt-realtime-2Voice agents
Translate live speech into another languagegpt-realtime-translateRealtime translation
Transcribe live audio into streaming textgpt-realtime-whisper

Realtime transcription

Transcribe files or bounded audio requestsAudio transcription modelsSpeech to text
Generate speech from textSpeech generation modelsText to speech
Add audio to an existing Chat Completions appAudio-capable chat models

Audio and speech

Realtime sessions keep a connection open while your application sends audio, receives events, and updates session state.

Session typeUse whenEndpoint or pattern
Voice-agent session

The model should respond to the user, call tools, and manage conversation state.

Conversation session on /v1/realtime

Translation sessionThe app should continuously translate speech as it arrives.

Continuous translation session on /v1/realtime/translations

Transcription session

The app needs streaming transcript deltas without model-generated spoken responses.

Transcription session that emits transcript deltas

Use a voice-agent session when your application needs an assistant that responds to the user. Use a translation session when your application needs an interpreter that translates the speaker. Use a transcription session when your application needs text from audio without model-generated responses.

Voice-agent sessions

Voice-agent sessions use the standard Realtime API conversation lifecycle. The client connects to /v1/realtime, sends audio or text, and listens for model responses, tool calls, and session events.

For most browser voice agents, start with the Voice agents guide. It uses the Agents SDK with WebRTC for browser audio and can connect to server-side tools.

Realtime 2 adds reasoning to speech-to-speech workflows. Start with reasoning.effort set to low for most production voice agents, then adjust based on latency tolerance and task complexity. Use the Realtime prompting guide to tune reasoning, preambles, tool use, unclear audio, and exact entity capture.

Translation sessions

Realtime translation uses a dedicated translation endpoint instead of the standard voice-agent endpoint. Translation sessions are continuous: the client streams audio into the session, and the service streams translated audio and transcript deltas out.

Translation sessions don’t use the normal assistant turn lifecycle. Don’t call response.create, and don’t wait for the client to commit a user turn before translation begins. For browser media, use WebRTC. For server media pipelines such as phone calls or broadcast ingest, use WebSockets.

See Realtime translation for the dedicated endpoint, session configuration, and architecture patterns.

Transcription sessions

You can transcribe audio in more than one way. Use a realtime transcription session when your application needs live transcript deltas from streaming audio. Use the Speech to text guide for file uploads, request-based transcription, or diarization-focused workflows.

For realtime transcription, gpt-realtime-whisper gives you controllable latency. Lower delay settings produce earlier partial text, while higher delay settings can improve transcript quality. Test with your real audio conditions, target languages, accents, and domain vocabulary before choosing a production default.

See Realtime transcription for session configuration and event handling.

Choose the transport based on where your application captures and plays audio:

Use for browser and mobile clients that capture or play audio directly.

Use when your server already receives raw audio from a media pipeline, call system, or worker.

Use for telephony voice agents. Confirm model support before using SIP for translation or transcription.

If your application identifies individual end users, include a safety identifier with Realtime API requests. Safety identifiers are recommended but not required. They help OpenAI monitor and detect abuse while allowing enforcement to target an individual user rather than your entire organization. Use a stable, privacy-preserving value, such as a hashed internal user ID.

For Realtime API requests, send the identifier in the OpenAI-Safety-Identifier header. When using ephemeral tokens, set the header on the server-side request that creates the client secret so the identifier is bound to that session. When connecting from a trusted server with WebSocket or the unified WebRTC interface, set the header on the connection request.

Safety identifiers do not carry over from Responses API requests or from other sessions. If you use the Responses API safety_identifier parameter elsewhere in your application, pass the same stable value separately when you create or connect each Realtime session.

If you still have a beta Realtime integration, migrate it to the GA interface before moving forward with new work. The most important changes are:

  • Remove the OpenAI-Beta: realtime=v1 header when calling the GA interface.
  • Use POST /v1/realtime/client_secrets to create ephemeral credentials for browser or mobile clients.
  • Use /v1/realtime/calls when establishing WebRTC sessions.
  • Update session and event shapes for the GA interface. In particular, set session.type, move output audio configuration under session.audio.output, and use the newer response event names like response.output_text.delta, response.output_audio.delta, and response.output_audio_transcript.delta.
  • If you are moving a speech-to-speech app forward, start from the Voice agents guide. If you are moving a transcription workflow forward, use Realtime transcription.

See the Realtime client events reference, Realtime sessions reference, and Voice agents guide for the current GA flow.

Use Audio and speech for the core concepts behind audio input, audio output, streaming, latency, transcripts, and speech generation. Use this overview when you are ready to choose an implementation path.