generate_voice
Speak text aloud with a Gemini TTS voice and return a WAV (24 kHz, mono, 16-bit).
Takes ~15-25 seconds for up to 300 characters. Costs no image/video quota. Russian,
English and most other languages work; the voice name only sets the timbre.
text: what to say, up to 5000 characters. Google's TTS itself takes at most 500
characters (about 30 seconds of speech) per request, so text longer than 300
characters is split at sentence boundaries, spoken piece by piece and joined into
ONE WAV — about 30 seconds of waiting per 1000 characters; the result then also has
`chunks` and `media_ids`. A lone word or a fragment that reads like an instruction
("in a modern style.") may still be refused: give it a full sentence.
voice: one of list_voices() (default "Algieba").
style: optional delivery hint, e.g. "calm, slow" or "cheerful". Empty = neutral.
project_id: optional, a project from create_project; omit for the account's default.
include_preview: also return `wav_preview_b64`, the FIRST 8 KB of the file as base64.
Off by default: it is only the first fraction of a second and costs context. To get the
whole file open `download_url`, or call fetch_media(path=download_path, force_bytes=True).
Returns {audio_url, download_url, download_path, media_id, duration_sec_estimate,
size_bytes, voice} — `audio_url` is Google's signed link and EXPIRES, `download_url`
is ours. While still rendering, returns a job_id: call check_job.
idempotency_key: optional, any string unique to this logical request (e.g. a uuid).
Repeating a call with the same key within 24h returns the SAME job instead of a
new one — use it when you may retry after a timeout or a busy error.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| text | Yes | ||
| style | No | ||
| voice | No | Algieba | |
| project_id | No | ||
| idempotency_key | No | ||
| include_preview | No |