GPT Realtime 2.1 是 OpenAI 实时语音对语音家族的旗舰,发布时被称为更新的实时推理模型,改进了字母数字识别、静音与噪声处理以及打断行为。
- 输入
- 音频 文本 $4/M
- 输出
- 音频 文本 $24/M
- 音频输入
- $32/M
- 音频输出
- $64/M
- 缓存读取
- $0.4/M
- 知识截止
- 2024-09
价格在同类中的位置
价格在 6 个同类模型中的位置
这条线显示该模型的价格,在 Synthorai 上同类模型里处于什么位置。两端标出了最便宜和最贵的那个。这里是基础价,批量、区域和缓存写入的折扣见价格页。
规格与限制
Token
| 上下文窗口(厂商规格) | 128,000 |
|---|---|
| 最大输出(厂商规格) | 32,000 |
| 知识截止 | 2024-09 |
提示词缓存
| 缓存方式 | 自动 |
|---|---|
| 最低前缀 | 1,024 |
| 存活时间 | 5–10 分钟,最长 1 小时 |
实时语音
| 会话能力 |
|
|---|
模型
| 模态 | 音频 + 文本 → 音频 + 文本 |
|---|
- 更新版实时推理模型,改进了字母数字识别、静音与噪声处理以及打断行为
- 面向语音智能体工作流提供可配置的推理力度和工具使用
- 128k 上下文
30 秒用上 GPT Realtime 2.1
兼容 OpenAI Realtime:通过 WebSocket 连接,音频进、音频出。WS /v1/realtime
import asyncio, base64, json, websockets
URL = "wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1"
# Send ONLY the Authorization header - the beta protocol is retired.
HEADERS = {"Authorization": "Bearer sk-syn-..."}
async def main():
async with websockets.connect(URL, additional_headers=HEADERS) as ws:
# 1) configure the speech-to-speech session
await ws.send(json.dumps({
"type": "session.update",
"session": {
"type": "realtime",
"output_modalities": ["audio"],
"audio": {"output": {"voice": "alloy"}},
},
}))
# 2) send input audio (base64 PCM16), then request a spoken reply
await ws.send(json.dumps({"type": "input_audio_buffer.append", "audio": pcm16_b64}))
await ws.send(json.dumps({"type": "input_audio_buffer.commit"}))
await ws.send(json.dumps({"type": "response.create"}))
# 3) stream the model's audio (and text) back
async for raw in ws:
ev = json.loads(raw)
if ev["type"] == "response.audio.delta":
play(base64.b64decode(ev["delta"])) # audio out
elif ev["type"] == "response.done":
break
asyncio.run(main())import WebSocket from "ws";
const ws = new WebSocket("wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1", {
// Send ONLY the Authorization header — the beta protocol is retired.
headers: { Authorization: "Bearer sk-syn-..." },
});
ws.on("open", () => {
// configure the speech-to-speech session
ws.send(JSON.stringify({ type: "session.update", session: {
type: "realtime", output_modalities: ["audio"], audio: { output: { voice: "alloy" } },
} }));
// send input audio (base64 PCM16), then request a spoken reply
ws.send(JSON.stringify({ type: "input_audio_buffer.append", audio: pcm16Base64 }));
ws.send(JSON.stringify({ type: "input_audio_buffer.commit" }));
ws.send(JSON.stringify({ type: "response.create" }));
});
ws.on("message", (raw) => {
const ev = JSON.parse(raw.toString());
if (ev.type === "response.audio.delta") playAudio(Buffer.from(ev.delta, "base64")); // audio out
else if (ev.type === "response.done") ws.close();
});# Realtime is a WebSocket protocol - use a WS client such as websocat.
# Each line below is one OpenAI Realtime event (JSON) sent to the session.
websocat -H 'Authorization: Bearer sk-syn-...' \
'wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1' <<'EOF'
{"type":"session.update","session":{"type":"realtime","output_modalities":["audio"],"audio":{"output":{"voice":"alloy"}}}}
{"type":"input_audio_buffer.append","audio":"<base64-pcm16>"}
{"type":"input_audio_buffer.commit"}
{"type":"response.create"}
EOF
# Responses stream back as response.audio.delta (base64 audio out) … response.donepackage main
import (
"net/http"
"github.com/gorilla/websocket"
)
func main() {
h := http.Header{}
h.Set("Authorization", "Bearer sk-syn-...")
// Send ONLY the Authorization header — the beta protocol is retired.
c, _, err := websocket.DefaultDialer.Dial("wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1", h)
if err != nil {
panic(err)
}
defer c.Close()
// configure the speech-to-speech session, send audio, request a spoken reply
c.WriteJSON(map[string]any{"type": "session.update", "session": map[string]any{
"type": "realtime", "output_modalities": []string{"audio"},
"audio": map[string]any{"output": map[string]any{"voice": "alloy"}}}})
c.WriteJSON(map[string]any{"type": "input_audio_buffer.append", "audio": pcm16B64})
c.WriteJSON(map[string]any{"type": "input_audio_buffer.commit"})
c.WriteJSON(map[string]any{"type": "response.create"})
for {
var ev struct {
Type string `json:"type"`
Delta string `json:"delta"`
}
if err := c.ReadJSON(&ev); err != nil {
return
}
if ev.Type == "response.audio.delta" {
playAudio(ev.Delta) // base64 audio out
} else if ev.Type == "response.done" {
return
}
}
}import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.WebSocket;
import java.util.concurrent.CompletionStage;
// JDK built-in WebSocket — no extra dependency needed.
WebSocket ws = HttpClient.newHttpClient().newWebSocketBuilder()
.header("Authorization", "Bearer sk-syn-...")
// Send ONLY the Authorization header — the beta protocol is retired.
.buildAsync(URI.create("wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1"), new WebSocket.Listener() {
public CompletionStage<?> onText(WebSocket w, CharSequence data, boolean last) {
// handle response.audio.delta (base64 audio out) / response.done here
w.request(1);
return null;
}
}).join();
// configure the session, send input audio, then request a spoken reply
ws.sendText("{\"type\":\"session.update\",\"session\":{\"type\":\"realtime\",\"output_modalities\":[\"audio\"],\"audio\":{\"output\":{\"voice\":\"alloy\"}}}}", true);
ws.sendText("{\"type\":\"input_audio_buffer.append\",\"audio\":\"<base64-pcm16>\"}", true);
ws.sendText("{\"type\":\"input_audio_buffer.commit\"}", true);
ws.sendText("{\"type\":\"response.create\"}", true);关于 GPT Realtime 2.1
- 它把该家族扩展到 128K token 上下文窗口和 32K 最大输出 token,并支持可配置的推理力度、指令遵循,以及面向复杂语音智能体工作流的工具调用。
- 音频和文本按各自的 token 单价计费,缓存输入享折扣。
- OpenAI 的实时指南把它列为构建低延迟语音智能体时该选的模型,并建议大多数生产智能体从 low 推理力度起步,只在任务值得付出额外延迟时才提高。
- 会话可走 WebRTC、WebSocket 或 SIP,轮次切换可使用基于静音的语音活动检测,或使用一个由 eagerness 设置决定等待说话人说完有多耐心的语义检测器。
- 打断处理是协议的一部分:开启检测后,服务端会截断尚未播放的音频,而 WebSocket 客户端应停止播放并报告实际有多少音频送达了听者。
- 工具可以按会话或按响应声明,当某项旁支任务不应污染对话记录时,响应也可以在主对话之外生成。
- 在 Synthorai 上,它通过 OpenAI 兼容的 /v1/realtime WebSocket 端点提供,因此基于官方 Realtime SDK 构建的应用无需修改即可工作。
常见问题
GPT Realtime 2.1 API 可以免费试用吗?
GPT Realtime 2.1 目前处于邀请测试阶段:需申请开通,而非开放注册。在 Synthorai 控制台提交申请,通过后即按标准量付费计费,无需订阅。
GPT Realtime 2.1 最擅长什么?
面向生产语音智能体的旗舰实时档、改进打断、噪声与字母数字识别、可配置推理力度,支持工具调用。完整能力请见「关于」部分,内容取自厂商官方发布说明。
GPT Realtime 2.1 的价格是多少?
在 Synthorai 上,GPT Realtime 2.1 输入 $4/百万 token、输出 $24/百万 token,即厂商牌价,无平台加价。缓存命中的输入 token 按 $0.4/M 计费。
如何调用 GPT Realtime 2.1 API?
GPT Realtime 2.1 是语音对话(speech-to-speech)模型:通过 WebSocket 连接 wss://synthorai.io/v1/realtime?model=gpt-realtime-2.1,用 OpenAI Realtime SDK(或原生 WebSocket)即可,音频输入、音频输出。它不是 POST /v1/audio/transcriptions 文件上传接口。用你的 sk-syn key 鉴权,只发 Authorization 头(beta 协议已下线)。
如何开通 GPT Realtime 2.1?
GPT Realtime 2.1 处于邀请测试阶段:在 Synthorai 控制台申请开通。审批通过后与其他模型用法一致:把 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 设为 "gpt-realtime-2.1" 即可。
相关模型
对比
本页每个值都转录自厂商自己的文档(链接见上),并带有核对日期。价格在全目录范围内比较;各厂商定义不同的规格值,只说明差异而不作图表对比。此处没有任何由我们测量的数据,也不做评分。