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 按各自的單 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" 即可。
相關模型
對比
本頁每個值都轉錄自廠商自己的文件(連結見上),並帶有核對日期。價格在全目錄範圍內比較;各廠商定義不同的規格值,只說明差異而不作圖表對比。此處沒有任何由我們測量的資料,也不做評分。