Agno
This guide walks you through using Smallest AI text-to-speech inside Agno, the open-source Python framework for building multi-agent systems. The SmallestTools toolkit lets any Agno agent generate natural speech with the Lightning v3.1 and Lightning v3.1 Pro models as part of its tool-calling loop.
Code Example
The complete runnable example lives in the Agno repository:
Agno Cookbook — Smallest AI Tools
Setup
1. Install Agno
The Smallest AI toolkit uses Agno’s built-in HTTP client — no extra packages are required.
2. Set your API key
Get an API key from the Smallest AI dashboard (Developer → API Keys) and export it:
Usage
Attach SmallestTools to an agent and it gains two tools: text_to_speech and get_voices.
Generated audio is returned to the agent run as a list of audio artifacts (response.audio[0]), and can optionally be written to disk with target_directory.
Premium voices with Lightning v3.1 Pro
For broadcast-quality voices across American, British, and Indian accents, use the Pro pool:
Configuration
Models
Tools
text_to_speech(prompt, voice_id=None)— synthesizes speech via the unified/waves/v1/ttsroute and attaches the audio to the agent’s response. The optionalvoice_idoverrides the toolkit default per call. Non-audio responses (e.g. a JSON error body returned with an HTTP 200) are detected and surfaced as a tool error instead of being saved as a corrupt audio file.get_voices()— lists the voice catalog for the configured model. The standard and Pro models have separate catalogs, so the toolkit queries the endpoint matchingmodel. The response is normalized to a list of{id, name, gender, accent, languages}objects regardless of whether the API returns them under avoiceskey, adatakey, or as a bare list.
Notes
- Pair voices with the right model: Pro voices (e.g.
meher) requiremodel="lightning_v3.1_pro"; standard voices (e.g.magnus) use the default. Mismatched pairings are not rejected by the API but can produce wrong audio. - Cloned voices (
voice_*IDs) work onlightning_v3.1only. - For any issues or questions, open an issue in the Agno repository or contact us on Discord.

