Google Gemini 3.1 Flash Text To Speech API Documentation
Playground
Try it on WaveSpeedAI!Gemini 3.1 Flash Text to Speech generates expressive multi-speaker audio from text, with natural voices and multilingual language control for dialogue, narration, localization, and AI voice workflows. Ready-to-use REST inference API, best performance, no coldstarts, affordable pricing.
Features
Gemini 3.1 Flash Text-to-Speech turns scripts and labelled dialogue into expressive spoken audio. Assign a distinct voice to each speaker and generate one natural, multilingual audio track for narration, conversations, and voiceover workflows.
Why Choose This?
-
Expressive speech generation
Create natural pacing, tone, and delivery from written scripts. -
Multi-speaker dialogue
Assign different voices to up to two named speakers in one generation. -
Multilingual voice output
Select the language and locale that match the script for stronger pronunciation. -
Voice preset control
Choose from a library of voice presets for narration, dialogue, announcements, and character reads. -
Standard audio output
Generated audio is returned as a URL in the standard WaveSpeed prediction response.
Parameters
| Parameter | Required | Description |
|---|---|---|
| text | Yes | Script or dialogue to synthesize. Use each speaker name exactly as configured in speakers. |
| language | Yes | Language and locale spoken in the generated audio. |
| 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 — Use a consistent
Speaker: dialogueformat, such asNarrator: Welcome to the show. - Choose a language — Select the language and locale for the spoken audio.
- Choose your voices — for a single narrator, pick a
voice. For dialogue, add onespeakersentry per speaker label used in the script. - Submit — Generate the spoken audio and retrieve the output URL.
Pricing
Pricing is $0.20 per 1,000 characters of input text, billed by actual character count with a $0.01 minimum per request.
| Text Length | Price |
|---|---|
| 50 characters | $0.01 (minimum) |
| 250 characters | $0.05 |
| 1,000 characters | $0.20 |
| 2,000 characters | $0.40 |
| 5,000 characters | $1.00 |
Best Use Cases
- Dialogue generation — Create conversations with different named voices.
- Narration and voiceover — Produce spoken scripts for videos, presentations, and explainers.
- Podcasts and audio stories — Generate host or character dialogue from structured scripts.
- Multilingual content — Create localized speech with language-aware voice output.
- Product demos — Turn scripted product messaging into polished audio.
Pro Tips
- Make every speaker label in the script exactly match the corresponding speaker entry.
- Keep punctuation clear to guide pauses, emphasis, and delivery.
- Use one speaker for narration and two speakers for dialogue.
- Match the selected language to the language used in the script.
- Split long scripts into logical sections for more consistent pacing.
## Authentication
For authentication details, please refer to the [Authentication Guide](/api-authentication).
## API Endpoints
### Submit Task & Query Result
<ApiTabs submitUrl={model.submitUrl} resultUrl={model.resultUrl} payload={model.defaultValues} />
## Parameters
### Task Submission Parameters
#### Request Parameters
<RequestParams params={model.params} />
#### Response Parameters
<SubmitResponse />
#### 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 |