Google Gemini: Gemini 3.8 Live
Google Gemini 3.8 Live: the stable low-latency audio-to-audio Live API model for real-time voice agents and dialogue, with interleaved reasoning and asynchronous function calling.
プロバイダー
同じモデルを複数のプロバイダーがホストしている場合があります。バックエンドを固定したい場合は1つのプロバイダーを選び、そうでなければルーティングに選択を任せられます。
対応言語
af
ak
sq
am
ar
hy
as
az
eu
be
bn
bs
bg
my
ca
ceb
zh-Hans
zh-Hant
hr
cs
da
nl
en
et
fo
fil
fi
fr
gl
ka
de
el
gu
ha
he
hi
hu
is
id
ga
it
ja
kn
kk
km
rw
ko
ku
ky
lo
lv
lt
mk
ms
ml
mt
mi
mr
mn
ne
no
nb
or
om
ps
fa
pl
pt-BR
pt-PT
pa
qu
ro
rm
ru
sr
sd
si
sk
sl
so
st
es
sw
sv
tg
ta
te
th
tn
tr
tk
uk
ur
uz
vi
cy
fy
wo
yo
zu
機能
Bidirectional realtime audio over the Live API (WebSocket BidiGenerateContent).
speech_to_speech
Supports 99 documented languages and switches between them naturally during a conversation.
multilingual
Accepts text input and returns a text transcript of every spoken response, with audio as the only response modality; image and video input are not available through the router.
text_input_output
Streams transcripts of the model's output speech on every session and of input speech when input transcription is enabled.
live_transcripts
Supports function calling, asynchronous (non-blocking) by default; Google Search grounding is not available through the router.
tool_use
Interleaved reasoning without a configurable thinking level.
thinking
コード
OpenAI SDKによるライブ音声変換
GPT-Liveセッションを開き、question.pcm(24 kHz・16ビット・モノラルPCM)をリアルタイムでストリーミングして、音声の返答をreply.pcmに保存します。
import { readFile, writeFile } from "node:fs/promises";
import { setTimeout as sleep } from "node:timers/promises";
import OpenAI from "openai";
import { LiveWS } from "openai/resources/live/ws";
const client = new OpenAI({
apiKey: process.env.ALLMODELS_API_KEY,
baseURL: "https://api.allmodels.io/oai"
});
const live = new LiveWS(client);
const reply = [];
let quiet;
live.on("session.output_audio.delta", ({ delta }) => reply.push(Buffer.from(delta, "base64")));
live.on("session.output_transcript.delta", () => {
// End the session two seconds after the reply's transcript goes quiet.
clearTimeout(quiet);
quiet = setTimeout(() => live.send({ type: "session.close" }), 2000);
});
live.on("session.closed", async () => {
await writeFile("reply.pcm", Buffer.concat(reply));
live.close();
});
live.on("error", console.error);
live.send({
type: "session.start",
session: {
model: "gemini-3.8-live",
audio: { format: { type: "audio/pcm", rate: 24000 }, output: { voice: "Zephyr" } },
delegation: { type: "client" }
}
});
// Stream 100 ms frames in real time, then two seconds of silence.
const audio = Buffer.concat([await readFile("question.pcm"), Buffer.alloc(2 * 24000 * 2)]);
for (let offset = 0; offset < audio.length; offset += 4800) {
live.send({ type: "session.input_audio.append", audio: audio.subarray(offset, offset + 4800).toString("base64") });
await sleep(100);
}
