GPT Realtime 是 OpenAI 第一款正式發布的即時模型:一款單一的語音對語音模型,直接以自然、有表現力的音訊聆聽與回應,而不是串聯獨立的轉寫與合成模型。
- 輸入
- 音訊 文字 $4/M
- 輸出
- 音訊 文字 $16/M
- 音訊輸入
- $32/M
- 音訊輸出
- $64/M
- 快取讀取
- $0.4/M
- 知識截止
- 2023-10
Benchmark 成績
GPT Realtime:公布了 8 項,但每一項都沒有夠多其他模型的成績,無法比較。
價格在同類中的位置
價格在 6 個同類模型中的位置
這條線標出這個模型的價格,在 Synthorai 的同類模型裡落在什麼位置;兩端分別是最便宜和最貴的模型。這裡列的是基礎價,批次、區域和快取寫入的折扣請見價格頁。
規格與限制
Token
| 上下文視窗(供應商規格) | 32,000 |
|---|---|
| 最大輸出(供應商規格) | 4,096 |
| 知識截止 | 2023-10 |
提示詞快取
| 快取方式 | 自動 |
|---|---|
| 最小前綴 | 1,024 |
| 存活時間 | 5–10 分鐘,最長 1 小時 |
即時語音
| 工作階段功能 | 透過 WebSocket 的原生語音到語音 · 函式呼叫 · 32K 上下文 |
|---|
模型
| 模態 | 音訊 + 文字 → 音訊 + 文字 |
|---|
- OpenAI 首個正式發布的即時模型(快照 gpt-realtime-2025-08-28):原生語音到語音,支援函式呼叫
- 32k 上下文
30 秒上手 GPT Realtime
相容 OpenAI Realtime:透過 WebSocket 連線,音訊進、音訊出。WS /v1/realtime
import asyncio, base64, json, websockets
URL = "wss://synthorai.io/v1/realtime?model=gpt-realtime"
# 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", {
// 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'
{"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)
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() {
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
- 它具備 32K token 上下文視窗與 4,096 最大輸出 token,支援面向語音智慧體工作流的函式呼叫,接受音訊或文字輸入並輸出音訊與文字;音訊與文字按各自的單 token 費率計費,並提供折扣的快取輸入。
- 會話可以透過 WebRTC 驅動瀏覽器與行動用戶端,在伺服器已經持有音訊串流時透過 WebSocket 驅動,或透過 SIP 驅動電話智慧體,並由伺服器端的語音活動偵測切分語音,在來電者打斷時截斷尚未播放的音訊。
- 模型頁面也把影像輸入與文字、音訊並列,而音色是在每個會話中從 OpenAI 公布的音色集裡挑選的,但要注意一旦會話已經送出音訊,音色就無法再更換。
- 它沒有推理力度控制(那要到 2.1 世代才出現),知識截止為 2023 年 10 月。
- OpenAI 此後已宣布它的棄用,關閉時間排定在 2027 年 1 月,並指定 GPT Realtime 2.1 為遷移目標,因此新的語音工作應該放在 2.1 上,而既有整合仍有緩衝期。
- 它仍以即時家族最初的正式發布快照形式提供。
- Synthorai 透過 OpenAI 相容的 /v1/realtime WebSocket 端點提供 GPT Realtime,因此官方 Realtime SDK 用戶端無需改動即可連線。
常見問題
GPT Realtime API 可以免費試用嗎?
GPT Realtime 目前是邀請制測試,不開放直接註冊,需要先申請開通。請到 Synthorai 主控台提出申請,審核通過後就按一般的用量計費方式收費,不需訂閱。
GPT Realtime 最擅長什麼?
單模型語音對語音,無轉寫鏈路、自然富表現力音訊,支援函式呼叫、即時家族最初的 GA 快照。完整介紹請見「關於」一節,內容取自供應商官方的發布說明。
GPT Realtime 的價格是多少?
在 Synthorai 上,GPT Realtime 的輸入價是每百萬 token $4,輸出價是每百萬 token $16。這就是供應商官網價,平台不加價。快取命中的輸入 token 以 $0.4/M 計費。
如何呼叫 GPT Realtime API?
GPT Realtime 是語音對語音(speech-to-speech)模型:用 OpenAI Realtime SDK(或原生 WebSocket)連線到 wss://synthorai.io/v1/realtime?model=gpt-realtime,音訊進、音訊出。它不走 POST /v1/audio/transcriptions 那種上傳檔案的方式。驗證用你的 sk-syn 金鑰,只需要帶 Authorization 標頭(beta 協定已停用)。
如何開通 GPT Realtime?
GPT Realtime 目前是邀請制測試,請到 Synthorai 主控台申請開通。審核通過後,用法和其他模型一樣:把 OpenAI SDK 的 base_url 指向 "https://synthorai.io/v1",model 設為 "gpt-realtime" 就可以了。
相關模型
比較
本頁每一個數值都摘錄自供應商自己的文件(連結見上方),並附上查核日期。價格是放在整個目錄裡比較;各家供應商定義不一樣的規格,只說明差異,不畫成圖表比較。這裡沒有任何數據是我們自己量測的,也不做評分。