Google Gemini: Gemini 3.1 Flash TTS Preview
Google Gemini 3.1 Flash text-to-speech (preview): powerful, low-latency speech generation with natural outputs, steerable prompts, and expressive audio tags.
Providers
Different providers can host the same model. Choose one provider when you need a fixed backend, or let routing select among them.
Supported languages
af
sq
am
ar
hy
az
bn
eu
be
bg
my
ca
ceb
cmn
hr
cs
da
nl
en
et
fil
fi
fr
gl
ka
de
el
gu
ht
he
hi
hu
is
id
it
ja
jv
kn
kok
ko
lo
la
lv
lt
lb
mk
mai
mg
ms
ml
mr
mn
ne
nb
nn
or
ps
fa
pl
pt
pa
ro
ru
sr
sd
si
sk
sl
es
sw
sv
ta
te
th
tr
uk
ur
vi
Voices
Features
Generates spoken audio from text via generateContent (responseModalities AUDIO).
text_to_speech
Streams synthesized audio incrementally over a persistent connection (WebSocket/SSE).
streaming
Synthesizes speech from fully-submitted text in a single synchronous request.
synchronous
Supports 78 documented languages; the model auto-detects the input language (voices are language-agnostic).
multilingual
Supports multi-speaker audio (up to 2 speakers).
multi_speaker
Style, tone, accent, and pace controllable via natural-language prompts.
style_control
Code
ElevenLabs SDK streaming TTS
Routes the ElevenLabs SDK through allmodels and streams the audio response.
import { ElevenLabsClient } from "elevenlabs";
const client = new ElevenLabsClient({
apiKey: process.env.ALLMODELS_API_KEY,
baseUrl: "https://api.allmodels.io/el"
});
const stream = await client.textToSpeech.stream("voice_id", {
text: "I'm sorry, Dave. I'm afraid I can't do that.",
modelId: "gemini/gemini-3-1-flash-tts-preview",
outputFormat: "mp3_44100_128"
}, {
queryParams: {
provider: {
"only": [
"gemini"
]
}
}
});
const reader = stream.getReader();
for (;;) {
const { done, value } = await reader.read();
if (done) break;
// Write value to your response, file, or audio playback pipeline.
}
