GPT Realtime vs GPT Realtime 2.1
vs
何时使用哪一个 — 经过整理的结论,而非基准测试表格
两者文本输入同为每百万 $4,音频同为输入 $32、输出 $64,缓存读取同为 $0.4;gpt-realtime-2.1 只在文本输出上更贵($24 对 $16),并把会话上下文翻了两番,128K 对 32K。它还在旧版的函数调用之上增加了可配置的推理力度和打断处理。只有为了维持既有集成才选 gpt-realtime——除文本输出外,新版的价格完全一样。
定价
| GPT Realtime | GPT Realtime 2.1 | Δ | |
|---|---|---|---|
| 音频输入 / 1M tokens | $32 | $32 | = |
| 音频输出 / 1M tokens | $64 | $64 | = |
| 音频缓存读取 / 1M tokens | $0.4 | $0.4 | = |
| 文本输入 / 1M tokens | $4 | $4 | = |
| 文本输出 / 1M tokens | $16 | $24 | 0.67× |
| 缓存写入 | 不单独收费 | 不单独收费 | — |
费率取自构建时的实时目录;每个模型页面均附有当前的费率卡。
它们的位置 — 以该计费单位计费的所有 6 个 实时语音转语音 模型的 每 1M 音频 token 的价格(对数刻度)
GPT Realtime · $32 GPT Realtime 2.1 · $32
$3 · nova-2-sonic $32 · GPT Realtime
能力
| GPT Realtime | GPT Realtime 2.1 | |
|---|---|---|
| 提示词缓存 | 隐式(自动) | 隐式(自动) |
| 缓存生存时间 | 5–10m, up to 1h | 5–10m, up to 1h |
| 最小缓存前缀 | 1024 个 token | 1024 个 token |
规格
| GPT Realtime | GPT Realtime 2.1 | |
|---|---|---|
| 输入模态 | 文本 音频 | 文本 音频 |
| 输出模态 | 文本 音频 | 文本 音频 |
| 发布日期 | 2025-08-28 | 2026-07-06 |
| 知识截止日期 | 2023-10 | 2024-09 |
| 会话能力 |
|
|
| 上下文窗口 | 32K | 128K |
规格转录自各供应商的文档;若供应商未发布某项数据,则直接省略该行,而非进行推断。 完整来源: GPT Realtime · GPT Realtime 2.1
只需一行代码即可在它们之间切换
两个 ID 都包含在下方的每个选项卡中 — 高亮显示的两行是唯一的修改。相同的端点,相同的密钥,相同的请求结构。
import asyncio, base64, json, websockets
URL = "wss://synthorai.io/v1/realtime?model=gpt-realtime"
# 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", {
// 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' <<'EOF'
# '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", h)
// 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"), new WebSocket.Listener() {
// .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 和 GPT Realtime 2.1 哪个更便宜?
它们列出的 音频输入 / 1m tokens 相同($32),因此价格不是这一项的决定因素——请参考下文的规格与能力。
我可以在不进行两次集成的情况下,对 GPT Realtime 和 GPT Realtime 2.1 进行 A/B 测试吗?
可以。两者均通过同一个兼容 OpenAI 的端点提供服务,并使用同一把 API 密钥——切换只需更改一行模型字符串,因此你可以将一部分流量路由到各个模型并直接比较账单。
GPT Realtime 和 GPT Realtime 2.1 支持提示词缓存吗?
是的 —— 两者对缓存读取的计费均低于其输入费率,因此热前缀工作负载的成本低于标价。准确的缓存读取行位于上方的定价表中。