POST
javascript
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); } })();
RESPONSE
image/jpeg
HTTP Response Codes
200 - OKImage Generated
401 - UnauthorizedUser authentication failed
404 - Not FoundThe requested URL does not exist
405 - Method Not AllowedThe requested HTTP method is not allowed
406 - Not AcceptableNot enough credits
500 - Server ErrorServer had some issue with processing

Attributes


textstr *

Input text to convert to speech. Supports audio tags for style control. Use natural language prompts for expressive results.


voice_1str ( default: 1 )

Primary speaker voice name. Options: Kore, Puck, Charon, Aoede, Fenrir, Zephyr. Kore is neutral and professional.


voice_2str ( default: 1 )

Second speaker voice for multi-character dialogue. Leave empty for single-speaker. Max 2 speakers supported.


temperaturefloat ( default: 0.4 )

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 — Text-to-Speech AI Model

What is Gemini 3.1 Flash TTS?

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.

Key Features

  • 200+ audio tags for expressive voice control: style, pace, emphasis, and tone via plain-text prompts
  • 30+ named voices including Kore, Puck, Charon, Aoede, Fenrir, and Zephyr
  • Native multi-speaker dialogue — generate natural two-character conversations in a single API call
  • 70+ language support with native multilingual synthesis
  • SynthID watermarking on all outputs for AI content identification
  • Synchronous API — binary WAV response with no polling required
  • 300–500ms latency for first audio chunk

Best Use Cases

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.

Prompt Tips and Output Quality

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.

FAQs

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.