Usage guide
Setup, environment variables, and Python/JavaScript/Go usage examples.
SmallestAITTS
Low-latency text-to-speech with Smallest AI’s Lightning models, using your own Smallest AI API key. Supports English and Hindi voices. Authenticates with SMALLEST_API_KEY from your environment, or an explicitapi_key.
Fields
Lightning model: “lightning-v3.1” (latest, streaming), “lightning-v2”, “lightning-large” or “lightning”. Defaults to ‘lightning-v3.1’.
Voice to speak with, e.g. “magnus”. Voices are model-specific; v2 voices such as “emily” need model=“lightning-v2”. Defaults to ‘magnus’.
Language of the speech: “en” (English) or “hi” (Hindi). For Hindi, pick a Hindi-capable voice. Defaults to ‘en’.
Voice-clone similarity to the reference voice, 0 to 1. Lightning v2 only. Defaults to 0.0.
Send text one sentence at a time, so the first sentence plays while later ones are still being generated. Defaults to True.
Base URL of the Smallest AI Waves API. Defaults to ‘https://api.smallest.ai/waves/v1’.
Stream over a persistent WebSocket instead of one HTTP request per segment. Only works with “lightning-v3.1”. Defaults to True.
Seconds after which the streaming WebSocket is reopened, to stay within Smallest AI session limits. Defaults to 300.0.
Streaming only. Milliseconds the server waits after the last audio chunk before marking the request complete. Defaults to 0.