1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
const axios = require('axios');
const api_key = "YOUR API-KEY";
const url = "https://api.segmind.com/v1/gemini-3.1-flash-tts";
const data = {
"text": "Welcome to Segmind — the fastest API platform for AI image and video generation. Explore hundreds of models, build powerful workflows, and ship your ideas in minutes.",
"voice_1": "Kore",
"temperature": 0.4
};
(async function() {
try {
const response = await axios.post(url, data, { headers: { 'x-api-key': api_key } });
console.log(response.data);
} catch (error) {
console.error('Error:', error.response.data);
}
})();Input text to convert to speech. Supports audio tags for style control. Use natural language prompts for expressive results.
Primary speaker voice name. Options: Kore, Puck, Charon, Aoede, Fenrir, Zephyr. Kore is neutral and professional.
Second speaker voice for multi-character dialogue. Leave empty for single-speaker. Max 2 speakers supported.
Expressiveness level (0.0–2.0). Use 0.2–0.5 for professional narration; 0.8–1.4 for emotional delivery.
min : 0,
max : 2
To keep track of your credit usage, you can inspect the response headers of each API call. The x-remaining-credits property will indicate the number of remaining credits in your account. Ensure you monitor this value to avoid any disruptions in your API usage.
Gemini 3.1 Flash TTS is Google DeepMind's latest text-to-speech model, built for developers who need expressive, natural-sounding voice synthesis at scale. Released in April 2026, it converts text into 24kHz mono WAV audio with fine-grained control over vocal style, pace, emotion, and delivery — all driven by natural language prompts or inline audio tags, without requiring SSML markup.
It achieves an Elo score of 1,211 on the Artificial Analysis TTS leaderboard (second overall), landing in the "most attractive quadrant" for its blend of output quality and low cost — approximately 4× cheaper than ElevenLabs Flash and 2.5× cheaper than OpenAI TTS-1-HD.
Gemini 3.1 Flash TTS is ideal for AI assistants and chatbots requiring voice-first UX with controllable tone, podcast and audiobook generation with multi-character narration, educational platforms needing clear paced narration across 70+ languages, customer service IVR systems, game NPC dialogue with emotionally expressive delivery, and multilingual product localization at scale.
For professional narration, use the Kore voice at temperature 0.4 — clean, neutral, and tested to produce ~600KB WAV at 30 seconds. Add emotional cues in text (e.g., "said excitedly") or use inline audio tags to steer delivery style. Increase temperature to 0.8–1.2 for dramatic or conversational content. For multi-speaker dialogue, assign a named voice to each character and structure your script with speaker labels — the model weaves both voices into a single coherent output with no audio stitching needed.
What voices are available? 30+ named voices including Kore (neutral/professional), Puck (conversational/friendly), Charon (deep/authoritative), Aoede (expressive/dynamic), Fenrir (warm/approachable), and Zephyr (clear/light).
Does it support voice cloning? No. Gemini 3.1 Flash TTS uses preset named voices only. For voice cloning, ElevenLabs is the recommended alternative.
What output format does it return? 24kHz mono WAV audio, delivered synchronously in the HTTP response body. No polling required.
How many speakers can I use? Up to 2 distinct speakers in multi-speaker mode, assigned via voice_1 and voice_2 parameters.
How does it compare to OpenAI TTS? Gemini 3.1 Flash TTS offers richer expressive control via audio tags and natural language style prompts, at approximately 2.5× lower cost than OpenAI TTS-1-HD with comparable output quality.
What languages does it support? 70+ languages including English, Spanish, French, German, Hindi, Japanese, Arabic, Portuguese, and more.