🎤Micdrop

Gemini TTS in Node.js and TypeScript

Gemini TTS is the text to speech of the Gemini API: a Gemini model reads the text in one of 30 prebuilt voices, in the tone your instructions ask for. Google’s newest models are Gemini 3.8 Flash TTS and Gemini 3.8 Flash-Lite TTS. Flash TTS speaks over 130 languages. Flash-Lite TTS speaks over 100 and costs a third less for audio. Gemini TTS costs from $0.50 per million text tokens and $6 per million audio tokens in November 2026.

GeminiTTS reads the answers of your agent with Gemini TTS. The model needs a whole text before it speaks, so GeminiTTS cuts the answer into sentences and sends the audio of each one as the model streams it.

Installation

Terminal window
npm install @micdrop/gemini

The same package also provides an agent, a speech to text, Gemini Live and a classifier. The providers page shows what every provider covers.

Usage with MicdropServer

import { GeminiTTS } from '@micdrop/gemini'
import { MicdropServer } from '@micdrop/server'
const tts = new GeminiTTS({
apiKey: process.env.GEMINI_API_KEY || '',
model: 'gemini-2.5-flash-preview-tts', // Default model
voice: 'Kore', // Default voice
// Direction put before each sentence (optional)
instructions: 'Say in a calm and friendly tone',
})
new MicdropServer(socket, {
tts,
// ... other options
})

Usage without MicdropServer

import { GeminiTTS } from '@micdrop/gemini'
import { Readable } from 'stream'
const tts = new GeminiTTS({ apiKey: process.env.GEMINI_API_KEY || '' })
// Audio is raw PCM, 16 bits, 16 kHz, mono
tts.on('Audio', (chunk) => console.log('Audio:', chunk.length, 'bytes'))
tts.on('Failed', (texts) => console.error('Failed:', texts))
tts.speak(Readable.from(['Hello! ', 'What can I do for you?']))

Events

EventPayloadDescription
AudioBufferA chunk of audio, PCM 16 bits, 16 kHz, mono, ready to be played.
Failedstring[]Synthesis gave up after an error, with the text that stayed unspoken.

See the TTS interface for the full contract.

Options

OptionTypeDefaultDescription
apiKeystringRequired*Your Gemini API key (required if genai not provided)
genaiGoogleGenAIOptionalClient of @google/genai (alternative to apiKey)
modelstring'gemini-2.5-flash-preview-tts'Speech model to use
voicestring'Kore'One of the 30 prebuilt voices, such as Puck or Aoede
instructionsstringundefinedHow to say the text, such as Say cheerfully
maxRetrynumber2Attempts after Gemini blocked a sentence by mistake

The voice speaks the language of the text. Gemini 3.8 Flash TTS speaks over 130 languages, and Gemini 3.8 Flash-Lite TTS over 100.

Gemini now and then blocks an ordinary sentence as if its content were forbidden, then accepts the very same sentence on the next request. GeminiTTS asks again, up to maxRetry times, as long as no audio of that sentence has been played.

Models

Set the model option to one of the Gemini TTS models. Prices are those of the Gemini API per million tokens, text in and audio out, on November 7, 2026. Both prices of the 3.8 models double on January 1, 2027.

ModelFirst audio of a sentenceFree tierPaid, text / audio
gemini-3.8-flash-ttsNot measuredYes$0.50 / $9
gemini-3.8-flash-lite-ttsNot measuredYes$0.50 / $6
gemini-2.5-flash-preview-ttsAbout three secondsYes$0.50 / $10
gemini-2.5-pro-preview-ttsNot measuredNo$1 / $20
gemini-3.1-flash-tts-previewAbout one secondYes$1 / $20

gemini-2.5-flash-preview-tts is the default, because it sends each sentence whole and the call plays without a gap. gemini-3.1-flash-tts-preview starts speaking sooner, then streams the rest slower than it is spoken, which leaves gaps in a long sentence. gemini-2.5-pro-preview-tts, the larger model, is open to paid accounts only.

Google may shut the 2.5 and 3.1 preview models down from November 17, 2026. It names gemini-3.8-flash-tts and gemini-3.8-flash-lite-tts to replace them. Both 3.8 models can also create a voice from a written description, while the voice option of GeminiTTS takes one of the 30 prebuilt names.

Voices

Gemini TTS has 30 prebuilt voices. Pass the name as voice. Google describes each voice by its tone:

VoiceToneVoiceToneVoiceTone
ZephyrBrightAutonoeBrightAlnilamFirm
PuckUpbeatEnceladusBreathySchedarEven
CharonInformativeIapetusClearGacruxMature
KoreFirmUmbrielEasy-goingPulcherrimaForward
FenrirExcitableAlgiebaSmoothAchirdFriendly
LedaYouthfulDespinaSmoothZubenelgenubiCasual
OrusFirmErinomeClearVindemiatrixGentle
AoedeBreezyAlgenibGravellySadachbiaLively
CallirrhoeEasy-goingRasalgethiInformativeSadaltagerKnowledgeable
LaomedeiaUpbeatAchernarSoftSulafatWarm

Write in instructions, in plain language, how the model should say the text. GeminiTTS puts it before each sentence, as in Say in a calm and friendly tone: Your order has shipped., so the model reads the sentence in that tone. An instruction can set the emotion, the pace or an accent, such as Speak slowly and warmly or Say it with a British accent. It applies to the whole call, so keep it short and give the agent the personality through its prompt.

Gemini TTS is one of the ElevenLabs alternatives for a TypeScript voice agent, next to Cartesia, OpenAI and the models that run locally.

FAQ

Can Gemini do text to voice?

Yes. The Gemini API turns a text into speech with its TTS models, such as Gemini 3.8 Flash TTS, in 30 prebuilt voices and over 130 languages. GeminiTTS, from the @micdrop/gemini package for Node.js, reads the answers of a voice agent with these models, sentence by sentence, while the agent writes them.

Can I generate native speech using Gemini?

Yes, Gemini generates speech in two ways. The Gemini TTS models read a text in the tone a plain instruction such as Say cheerfully asks for. Gemini Live goes from the voice of the user straight to its own spoken answer. Micdrop runs Gemini Live as a realtime model, through GeminiLive.