Google Gemini 2.5 Flash Text To Speech API Documentation

Google Gemini 2.5 Flash Text To Speech API Documentation

Playground

Try it on WaveSpeedAI!

Google Gemini 2.5 Flash Text-to-Speech delivers fast, natural multi-speaker voice synthesis with 30+ voices across 24 languages at lower cost. Perfect for dialogues, conversations, and multilingual content. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.

Features

Gemini 2.5 Flash Text-to-Speech is Google’s fast, cost-efficient multi-speaker speech synthesis model. It turns written dialogue into natural, expressive audio with support for multiple speakers and distinct voices in a single generation — at half the cost of the Pro version. Ideal for high-volume TTS workflows like podcasts, conversations, audiobooks, and voiceover production.


Why Choose This?

  • Fast and affordable Optimized for speed and cost-efficiency, delivering natural speech at half the price of Gemini 2.5 Pro TTS.

  • Multi-speaker dialogue Assign different voices to different speakers and generate a natural-sounding conversation in one pass — no need to stitch separate audio clips together.

  • Expressive, natural voices The voices carry natural intonation, pacing, and emotional range for lifelike results.

  • Multi-language support Supports a wide range of languages including Arabic (Egypt), Bangla (Bangladesh), Dutch (Netherlands), English (India), English (United States), French (France), German (Germany), Hindi (India), Indonesian (Indonesia), and more.

  • Flexible speaker setup Add as many speakers as your script needs, each with their own named voice. Simply write dialogue with speaker labels and the model handles the rest.


Parameters

ParameterRequiredDescription
textYesThe script or dialogue text. Use “Speaker: line” format for multi-speaker content.
languageYesLanguage and locale for synthesis (e.g., English (United States), French (France)).
speakersNoOptional. Provide two or more speaker entries (each a speaker name plus a voice) to generate multi-speaker dialogue. Omit it for single-speaker synthesis.
voiceNoVoice preset when generating with a single speaker. Ignored if speakers is provided.

How to Use

  1. Write your script in the text field using the “Speaker: dialogue” format (e.g., “Rose: Welcome back to Tech Talk!”).
  2. Select the language from the dropdown.
  3. Choose your voices — for a single narrator, pick a voice. For dialogue, add one speakers entry per character, each with its name and voice.
  4. Run — the model generates a single audio file with all speakers voiced naturally.
  5. Download the output audio.

Pricing

$0.02 per 1,000 characters of input text.

Billing Rules

  • Billed by actual character count, prorated (no rounding up to 1,000)
  • Minimum charge of $0.01 per request

Best Use Cases

  • Podcasts & Talk Shows — Generate multi-host audio content with distinct voices for each speaker.
  • Audiobooks & Narration — Bring stories to life with different character voices in a single generation.
  • E-learning & Training — Create engaging instructional audio with conversational dialogue.
  • Content Localization — Produce voiceovers in multiple languages for global audiences.
  • High-volume Production — Cost-efficient TTS for large-scale audio content pipelines.

Pro Tips

  • Use the “Speaker: dialogue” format consistently throughout your script to ensure correct voice assignment.
  • Make sure each speaker name in the text exactly matches the speaker name in the speakers list.
  • Keep dialogue natural — the model handles pacing and intonation best with conversational writing.
  • For long scripts, break content into logical segments to review quality before generating the full piece.
  • Choose Flash for speed and volume; upgrade to Pro when you need maximum voice quality.

Notes

  • The number of available voices may vary by language. Experiment with different voice options to find the best fit for your content.
  • Please ensure your content complies with Google’s usage policies.

Authentication

For authentication details, please refer to the Authentication Guide.

API Endpoints

Submit Task & Query Result

set -euo pipefail

export WAVESPEED_API_KEY="your-api-key"

REQUEST_BODY=$(cat <<'JSON'
{
  "text": "A clear example input",
  "language": "English (United States)",
  "voice": "Kore"
}
JSON
)

# 1. Submit the prediction.
SUBMIT_RESPONSE=$(curl --silent --show-error --fail-with-body \
  -X POST "https://api.wavespeed.ai/api/v3/google/gemini-2.5-flash/text-to-speech" \
  -H "Authorization: Bearer ${WAVESPEED_API_KEY}" \
  -H "Content-Type: application/json" \
  -d "${REQUEST_BODY}")

TASK=$(printf '%s' "${SUBMIT_RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
PREDICTION_ID=$(printf '%s' "${TASK}" | jq -r '.id // empty')
if [ -z "${PREDICTION_ID}" ]; then
  printf 'Submission response did not contain a prediction id
' >&2
  exit 1
fi
RESULT_URL="https://api.wavespeed.ai/api/v3/predictions/${PREDICTION_ID}/result"

# 2. Poll until the prediction finishes.
while true; do
  RESPONSE=$(curl --silent --show-error --fail-with-body \
    "${RESULT_URL}" \
    -H "Authorization: Bearer ${WAVESPEED_API_KEY}")
  RESULT=$(printf '%s' "${RESPONSE}" | jq 'if type == "object" and has("data") then .data else . end')
  STATUS=$(printf '%s' "${RESULT}" | jq -r '.status // empty')

  case "${STATUS}" in
    completed) printf '%s\n' "${RESULT}" | jq '.outputs'; break ;;
    failed|cancelled|timeout|deleted) printf '%s\n' "${RESULT}" | jq . >&2; exit 1 ;;
    *) sleep 2 ;;
  esac
done

Parameters

Task Submission Parameters

Request Parameters

ParameterTypeRequiredDefaultRangeDescription
textstringYes--Styling instructions on how to synthesize the content in the text field.Less than or equal to 8,000 bytes
languagestringYesEnglish (United States)Arabic (Egypt), Bangla (Bangladesh), Dutch (Netherlands), English (India), English (United States), French (France), German (Germany), Hindi (India), Indonesian (Indonesia), Italian (Italy), Japanese (Japan), Korean (South Korea), Marathi (India), Polish (Poland), Portuguese (Brazil), Romanian (Romania), Russian (Russia), Spanish (Spain), Tamil (India), Telugu (India), Thai (Thailand), Turkish (Turkey), Ukrainian (Ukraine), Vietnamese (Vietnam)Language spoken in the audio.
voicestringNoKoreAchernar, Achird, Algenib, Algieba, Alnilam, Aoede, Autonoe, Callirrhoe, Charon, Despina, Enceladus, Erinome, Fenrir, Gacrux, Iapetus, Kore, Laomedeia, Leda, Orus, Puck, Pulcherrima, Rasalgethi, Sadachbia, Sadaltager, Schedar, Sulafat, Umbriel, Vindemiatrix, Zephyr, ZubenelgenubiVoice for single-speaker synthesis. Ignored when speakers is provided.
speakersarray<object>No-0 ~ 2 itemsArray of terminoogies to use for translation. Optional: omit for single-speaker synthesis, in which case the voice field is used.

Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
data.idstringUnique identifier for the prediction, Task Id
data.modelstringModel ID used for the prediction
data.outputsarrayOutput values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed)
data.urlsobjectObject containing related API endpoints
data.statusstringTask status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses.
data.created_atstringISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”)
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds

Result Request Parameters

ParameterTypeRequiredDefaultDescription
idstringYes-Task ID

Result Response Parameters

ParameterTypeDescription
codeintegerHTTP status code (e.g., 200 for success)
messagestringStatus message (e.g., “success”)
dataobjectThe prediction data object containing all details
data.idstringUnique identifier for the prediction
data.modelstringModel ID used for the prediction
data.outputsarray<string | object>Array of generated outputs (empty when status is not completed). Items are usually URL strings, but may be text strings or structured result objects, depending on the model.
data.urlsobjectObject containing related API endpoints
data.statusstringStatus: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses
data.created_atstringISO timestamp of when the request was created
data.errorstringError message (empty if no error occurred)
data.timingsobjectObject containing timing details
data.timings.inferenceintegerInference time in milliseconds
© 2026 WaveSpeedAI. All rights reserved.