gemini-3.1-flash-live vs nova-2-sonic
gemini-3.1-flash-live 目前为邀请制。下方是它的实时价格,但调用前需要先为你的工作空间开通权限;打算根据这份对比做开发的话,请先向我们申请。
nova-2-sonic 目前为邀请制。下方是它的实时价格,但调用前需要先为你的工作空间开通权限;打算根据这份对比做开发的话,请先向我们申请。
什么时候选哪个
两者的音频价格相同,每百万输入 $3、输出 $12,所以账单差在文本:nova-2-sonic 每百万 $0.06 和 $0.24,对比 $0.75 和 $4.5,大约低 12 倍和 19 倍。gemini-3.1-flash-live 是输入更宽的那个——文本、图像、音频和视频,90 多种语言,纯音频会话 15 分钟——而 nova-2-sonic 只收音频和文本,连接 8 分钟上限并有一套文档化的续接方式,且只在四个区域提供。文本吃重的会话要控成本选 nova-2-sonic,要视频输入和语言覆盖选 gemini-3.1-flash-live。
Benchmark 成绩
gemini-3.1-flash-live:供应商没有公布 benchmark 成绩。
nova-2-sonic:公布了 8 项成绩,但每一项测过的其他模型都太少,没法比较。
价格
| gemini-3.1-flash-live | nova-2-sonic | Δ | |
|---|---|---|---|
| 音频输入 / 1M token | $3 | $3 | = |
| 音频输出 / 1M token | $12 | $12 | = |
| 文本输入 / 1M token | $0.75 | $0.06 | 13× |
| 文本输出 / 1M token | $4.5 | $0.24 | 19× |
| 缓存写入 | - | 不单独收费 | - |
价格取自构建时的实时目录,最新价格见各模型页面。
两个模型所处的位置:全部 6 个按同一单位计费的实时语音对话模型的每 1M 音频 token 价格分布(对数刻度)
能力
| gemini-3.1-flash-live | nova-2-sonic | |
|---|---|---|
| 思考控制 | 始终开启 | - |
| 提示词缓存 | 隐式 + 显式 | 不支持 |
| 缓存有效期 | 未公布 | 不适用 |
| 最小缓存前缀 | 4096 个 token | 不适用 |
规格
| gemini-3.1-flash-live | nova-2-sonic | |
|---|---|---|
| 输入模态 | 文本 图像 音频 视频 | 文本 音频 |
| 输出模态 | 文本 音频 | 文本 音频 |
| 发布日期 | 2026-03-26 | 2025-12-02 |
| 音色 | Any voice from the Gemini text-to-speech voice set native-audio output models switch languages naturally during a conversation. | Feminine- and masculine-sounding voices per locale (tiffany/matthew en-US, amy en-GB, olivia en-AU, kiara/arjun en-IN and hi-IN, ambre/florian fr-FR, beatrice/lorenzo it-IT, tina/lennart de-DE, lupe/carlos es-US, carolina/leo pt-BR) tiffany and matthew are polyglot voices that speak every supported language. |
| 会话能力 |
|
|
| 上下文窗口 | 131K | 1M |
规格照录自各供应商的文档;供应商没有公布的项目,对应的行直接省略,不做推断。 完整来源: gemini-3.1-flash-live · nova-2-sonic
改一行代码就能在两个模型之间切换
下方每个标签页里都有两个模型 ID,高亮的那两行是唯一要改的地方。端点不变,API key 不变,请求结构也不变。
import asyncio, base64, json, websockets
URL = "wss://synthorai.io/v1/realtime?model=gemini-3.1-flash-live"
# URL = "wss://synthorai.io/v1/realtime?model=nova-2-sonic" # 取消注释此行,注释上一行
# 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=gemini-3.1-flash-live", {
// const ws = new WebSocket("wss://synthorai.io/v1/realtime?model=nova-2-sonic", { // 取消注释此行,注释上一行
// 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=gemini-3.1-flash-live' <<'EOF'
# 'wss://synthorai.io/v1/realtime?model=nova-2-sonic' <<'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=gemini-3.1-flash-live", h)
// c, _, err := websocket.DefaultDialer.Dial("wss://synthorai.io/v1/realtime?model=nova-2-sonic", 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=gemini-3.1-flash-live"), new WebSocket.Listener() {
// .buildAsync(URI.create("wss://synthorai.io/v1/realtime?model=nova-2-sonic"), 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);常见问题
gemini-3.1-flash-live 和 nova-2-sonic 哪个更便宜?
两个模型的「音频输入 / 1M token」价格相同($3),所以这一项上价格分不出高下,请看下方的规格与能力。
不用分别集成两次,就能对 gemini-3.1-flash-live 和 nova-2-sonic 做 A/B 测试吗?
可以。两个模型走同一个 OpenAI 兼容端点,用同一个 API key,切换时只要改一行里的模型名,所以可以给两个模型各分一部分流量,直接对比账单。
gemini-3.1-flash-live 和 nova-2-sonic 支持提示词缓存吗?
我们的价格数据里,只有其中一个模型列出了缓存读取价;没有列出的,说明该供应商没有为缓存读取单独定价。