Google Gemini 2.5 Pro Text To Speech API Documentation
Playground
Try it on WaveSpeedAI!Google Gemini 2.5 Pro Text-to-Speech delivers natural multi-speaker voice synthesis with 30+ voices across 24 languages. Perfect for dialogues, conversations, and multilingual content. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Gemini 2.5 Pro Text-to-Speech is Google’s advanced multi-speaker speech synthesis model that turns written dialogue into natural, expressive audio. It supports multiple speakers with distinct voices in a single generation, making it ideal for podcasts, conversations, audiobooks, and any content that needs realistic multi-voice narration.
Why Choose This?
-
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 Powered by Gemini 2.5 Pro, 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
| Parameter | Required | Description |
|---|---|---|
| text | Yes | The script or dialogue text. Use “Speaker: line” format for multi-speaker content. |
| language | Yes | Language and locale for synthesis (e.g., English (United States), French (France)). |
| speakers | No | Optional. Provide two or more speaker entries (each a speaker name plus a voice) to generate multi-speaker dialogue. Omit it for single-speaker synthesis. |
| voice | No | Voice preset when generating with a single speaker. Ignored if speakers is provided. |
How to Use
- Write your script in the text field using the “Speaker: dialogue” format (e.g., “Rose: Welcome back to Tech Talk!”).
- Select the language from the dropdown.
- Choose your voices — for a single narrator, pick a
voice. For dialogue, add onespeakersentry per character, each with its name and voice. - Run — the model generates a single audio file with all speakers voiced naturally.
- Download the output audio.
Pricing
$0.04 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.
- Prototyping & Pre-production — Quickly audition dialogue and voice pairings before recording with real talent.
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.
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-pro/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
doneParameters
Task Submission Parameters
Request Parameters
| Parameter | Type | Required | Default | Range | Description |
|---|---|---|---|---|---|
| text | string | Yes | - | - | Styling instructions on how to synthesize the content in the text field.Less than or equal to 8,000 bytes |
| language | string | Yes | English (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. |
| voice | string | No | Kore | Achernar, 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, Zubenelgenubi | Voice for single-speaker synthesis. Ignored when speakers is provided. |
| speakers | array<object> | No | - | 0 ~ 2 items | Array of terminoogies to use for translation. Optional: omit for single-speaker synthesis, in which case the voice field is used. |
Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data.id | string | Unique identifier for the prediction, Task Id |
| data.model | string | Model ID used for the prediction |
| data.outputs | array | Output values, usually URL strings; some models return text strings or structured result objects (empty when status is not completed) |
| data.urls | object | Object containing related API endpoints |
| data.status | string | Task status. completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses. |
| data.created_at | string | ISO timestamp of when the request was created (e.g., “2023-04-01T12:34:56.789Z”) |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |
Result Request Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| id | string | Yes | - | Task ID |
Result Response Parameters
| Parameter | Type | Description |
|---|---|---|
| code | integer | HTTP status code (e.g., 200 for success) |
| message | string | Status message (e.g., “success”) |
| data | object | The prediction data object containing all details |
| data.id | string | Unique identifier for the prediction |
| data.model | string | Model ID used for the prediction |
| data.outputs | array<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.urls | object | Object containing related API endpoints |
| data.status | string | Status: completed is successful; failed, cancelled, timeout, and deleted are failure terminal statuses |
| data.created_at | string | ISO timestamp of when the request was created |
| data.error | string | Error message (empty if no error occurred) |
| data.timings | object | Object containing timing details |
| data.timings.inference | integer | Inference time in milliseconds |