600msも待てない音声エージェントのために

Google Gemini: Gemini 3.8 Live

gemini/gemini-3-8-live
提供中 speech-to-speech 1プロバイダー
Playground

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.

作成者Google Gemini
言語100言語
レスポンス形式ストリーミング: PCM
ステータス提供中

プロバイダー

同じモデルを複数のプロバイダーがホストしている場合があります。バックエンドを固定したい場合は1つのプロバイダーを選び、そうでなければルーティングに選択を任せられます。

プロバイダーSlug100万トークンあたりレイテンシiTTSのレイテンシは音声の最初のバイトが届くまでの時間、STTのレイテンシは最初のトークンが届くまでの時間で計測しています。モード稼働率
Google Gemini 1個のパラメーター
gemini
$0.75
—
ストリーミング

対応言語

100言語
Afrikaans af
Akan ak
Albanian sq
Amharic am
Arabic ar
Armenian hy
Assamese as
Azerbaijani az
Basque eu
Belarusian be
Bengali bn
Bosnian bs
Bulgarian bg
Burmese my
Catalan ca
Cebuano ceb
Chinese (Simplified) zh-Hans
Chinese (Traditional) zh-Hant
Croatian hr
Czech cs
Danish da
Dutch nl
English en
Estonian et
Faroese fo
Filipino fil
Finnish fi
French fr
Galician gl
Georgian ka
German de
Greek el
Gujarati gu
Hausa ha
Hebrew he
Hindi hi
Hungarian hu
Icelandic is
Indonesian id
Irish ga
Italian it
Japanese ja
Kannada kn
Kazakh kk
Khmer km
Kinyarwanda rw
Korean ko
Kurdish ku
Kyrgyz ky
Lao lo
Latvian lv
Lithuanian lt
Macedonian mk
Malay ms
Malayalam ml
Maltese mt
Maori mi
Marathi mr
Mongolian mn
Nepali ne
Norwegian no
Norwegian Bokmål nb
Odia or
Oromo om
Pashto ps
Persian fa
Polish pl
Portuguese (Brazil) pt-BR
Portuguese (Portugal) pt-PT
Punjabi pa
Quechua qu
Romanian ro
Romansh rm
Russian ru
Serbian sr
Sindhi sd
Sinhala si
Slovak sk
Slovenian sl
Somali so
Southern Sotho st
Spanish es
Swahili sw
Swedish sv
Tajik tg
Tamil ta
Telugu te
Thai th
Tswana tn
Turkish tr
Turkmen tk
Ukrainian uk
Urdu ur
Uzbek uz
Vietnamese vi
Welsh cy
Western Frisian fy
Wolof wo
Yoruba yo
Zulu zu

機能

Speech to speech

Bidirectional realtime audio over the Live API (WebSocket BidiGenerateContent).

speech_to_speech
Multilingual

Supports 99 documented languages and switches between them naturally during a conversation.

multilingual
Text input and output

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
Live transcripts

Streams transcripts of the model's output speech on every session and of input speech when input transcription is enabled.

live_transcripts
Function calling

Supports function calling, asynchronous (non-blocking) by default; Google Search grounding is not available through the router.

tool_use
Thinking

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);
}