# Unofficial agent skill for Gemini 3.8 TTS An installable agent skill for **Gemini 3.8 Flash TTS** (`gemini-3.8-flash-tts`) and **Gemini 3.8 Flash-Lite TTS** (`gemini-3.8-flash-lite-tts`). It explains how to direct emotion, pacing, vocal events, two-speaker dialogue, backchannels, and scripted overlapping reactions. A Python helper sends prepared scripts to the Gemini API with a Google AI Studio API key and saves WAV audio. This is an independent community project by [RobTar97](https://github.com/RobTar97). It is **not an official Google skill** and is not affiliated with, sponsored by, or endorsed by Google. ## Install with skills.sh The repository contains one skill at [`skills/gemini-tts/`](skills/gemini-tts/SKILL.md). Install it with the [skills.sh CLI](https://www.skills.sh/docs/cli): ```bash npx skills add RobTar97/gemini-3-8-tts-skill --skill gemini-tts ``` For a global install across agents supported by your skills.sh CLI: ```bash npx skills add RobTar97/gemini-3-8-tts-skill --global --agent '*' --skill gemini-tts --yes ``` You can invoke it as `$gemini-tts` in an agent that supports Agent Skills. The skill follows the [Agent Skills directory and `SKILL.md` specification](https://agentskills.io/specification). Some agents support project installation only; use the first command in the relevant project for those agents. ## Generate speech with your AI Studio key Create a key in [Google AI Studio](https://aistudio.google.com/app/apikey), then set `GEMINI_API_KEY` in the terminal session. Python 3.9+ is required; the helper has no third-party Python dependencies. PowerShell: ```powershell $env:GEMINI_API_KEY = 'your-key' python skills/gemini-tts/scripts/gemini_tts.py --input skills/gemini-tts/examples/single.json --output single.wav python skills/gemini-tts/scripts/gemini_tts.py --input skills/gemini-tts/examples/dialogue.json --output dialogue.wav ``` bash/zsh: ```bash export GEMINI_API_KEY='your-key' python3 skills/gemini-tts/scripts/gemini_tts.py --input skills/gemini-tts/examples/single.json --output single.wav ``` Run those commands from the repository root. The single-speaker example uses Flash-Lite; the two-speaker example uses Flash. Change models without editing the JSON: ```bash python3 skills/gemini-tts/scripts/gemini_tts.py --input skills/gemini-tts/examples/dialogue.json --model gemini-3.8-flash-lite-tts --output dialogue-lite.wav ``` To validate and inspect a request without a key or API call: ```bash python3 skills/gemini-tts/scripts/gemini_tts.py --input skills/gemini-tts/examples/dialogue.json --dry-run ``` The generated call uses the Gemini `v1beta/interactions` API. Each actual run can consume quota or incur charges on the API-key project. Keep the key out of files and commits. ## What the skill teaches - Put sustained emotion and delivery in each turn's `speech_metadata.style`. - Put spoken words in `text`, with ``, ``, ``, and similar tags at precise moments. - Configure two voices for a scripted scene. Put a listener's brief overlapping reaction in `|pipes|` inside the active speaker's turn. - Give a true conversational handoff its own labeled turn. For incoming live audio and user barge-in, use the Gemini Live API instead of prepared-script TTS. Read the [skill entrypoint](skills/gemini-tts/SKILL.md), [emotion and dialogue guide](skills/gemini-tts/references/emotion-and-dialogue.md), and [API usage guide](skills/gemini-tts/references/api-and-usage.md) for detailed patterns and limits. ## Verification The skill passed the Codex skill-creator validator. The helper was exercised against both Gemini 3.8 TTS models with an AI Studio API key; both returned valid 24 kHz, mono, 16-bit WAV files. Model behavior and API details can change, so consult the current Google documentation before changing the helper. ## Sources and rights This repository paraphrases and links to [Google AI Studio's Gemini 3.8 Flash TTS developer guide](https://aistudio.google.com/learn/gemini-3-8-flash-tts-developer-guide), the [Gemini API speech-generation documentation](https://ai.google.dev/gemini-api/docs/speech-generation), and [Google's Gemini 3.8 TTS announcement](https://blog.google/innovation-and-ai/models-and-research/gemini-models/gemini-3-8-text-to-speech/). Additional source and rights details are in [NOTICE.md](NOTICE.md). The original skill instructions, examples, and helper code in this repository are released under the [MIT License](LICENSE) by RobTar97. **Google retains all rights in Gemini, Google AI Studio, its models, services, documentation, voices, and brand features.** This license does not grant rights to Google's products or trademarks, and use of the Gemini API remains subject to Google's terms.