Skip to content

SmallestTTS

Convert text to speech using Smallest.ai's Lightning models via the Waves REST API.

Use SmallestTTS when you want ultra-low-latency speech synthesis from Smallest.ai’s Lightning models via a simple REST call. Each synthesize() request hits the unified Waves POST /waves/v1/tts endpoint and returns the complete audio as a Blob — no WebSocket management required. Voices from the Waves catalog and cloned voices are both supported through the voiceId option.

Prerequisites

  • A Smallest.ai API key or a CompositeVoice proxy server
  • No additional dependencies required. SmallestTTS uses native fetch internally.

Basic setup

import { CompositeVoice, NativeSTT, AnthropicLLM, SmallestTTS, BrowserAudioOutput } from 'composite-voice';

const voice = new CompositeVoice({
  providers: [
    new NativeSTT(),
    new AnthropicLLM({
      proxyUrl: '/api/proxy/anthropic',
      model: 'claude-haiku-4-5',
    }),
    new SmallestTTS({
      proxyUrl: '/api/proxy/smallest',
      voiceId: 'meher',
      model: 'lightning_v3.1',
      outputFormat: 'wav',
    }),
    new BrowserAudioOutput(),
  ],
});

await voice.initialize();
await voice.startListening();

Configuration options

OptionTypeDefaultDescription
apiKeystringSmallest.ai API key (direct mode)
proxyUrlstringProxy server URL (recommended for production)
voiceIdstringrequiredVoice identifier from the Waves catalog or a cloned voice
modelstring'lightning_v3.1'lightning_v3.1, lightning_v3.1_pro
outputFormatstring'wav'Output format: wav, mp3, pcm, ulaw, alaw
sampleRatenumber44100Output sample rate: 8000, 16000, 24000, 44100
speednumber1.0Speech speed multiplier, 0.5 to 2.0
languagestring'en'ISO 639-1 code matching the voice (e.g. en, hi, es)
endpointstringCustom API endpoint URL
maxRetriesnumber3Retry count for failed requests

Available voices

Browse and preview voices in the Waves console, or clone your own. The quickstart voices meher, magnus, and olivia are good starting points.

Output formats

FormatUse case
wavDirectly playable in browsers, uncompressed (default)
mp3Good compression, wide browser support
pcmRaw 16-bit PCM, lowest latency, needs a decoder to play
ulawmu-law encoding for telephony
alawA-law encoding for telephony

Complete example

import { CompositeVoice, MicrophoneInput, DeepgramSTT, AnthropicLLM, SmallestTTS, BrowserAudioOutput } from 'composite-voice';

const tts = new SmallestTTS({
  proxyUrl: '/api/proxy/smallest',
  voiceId: 'meher',
  model: 'lightning_v3.1_pro',
  outputFormat: 'wav',
  sampleRate: 24000,
  speed: 1.0,
});

const voice = new CompositeVoice({
  providers: [
    new MicrophoneInput(),
    new DeepgramSTT({ proxyUrl: '/api/proxy/deepgram' }),
    new AnthropicLLM({
      proxyUrl: '/api/proxy/anthropic',
      model: 'claude-haiku-4-5',
    }),
    tts,
    new BrowserAudioOutput(),
  ],
});

voice.on('tts.start', () => console.log('Speaking...'));
voice.on('tts.end', () => console.log('Done speaking'));

await voice.initialize();
await voice.startListening();

Model selection

  • lightning_v3.1 — The standard 44 kHz Lightning model with natural, expressive speech. Supports 12 languages (English, Hindi, Spanish, and 9 Indian languages) plus voice cloning. Best default.
  • lightning_v3.1_pro — Curated 44 kHz voice pool with improved naturalness across American, British, and Indian accents, at the same latency.

Older Lightning models (lightning, lightning-large, lightning-v2) and their per-model get_speech endpoints are deprecated by Smallest.ai; SmallestTTS only targets the unified /waves/v1/tts endpoint.

Tips

  • Smallest.ai recommends keeping each request under roughly 250 characters of text for the lowest latency.
  • SmallestTTS is REST-based, not streaming. The full audio Blob is returned after the API processes the entire input. For real-time streaming, consider DeepgramTTS.
  • The API’s own default output format is raw pcm; SmallestTTS defaults to wav instead so the returned Blob is directly playable in browsers.
  • Use proxyUrl in production so your API key stays server-side — set smallestApiKey in your proxy config.

Further reading

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency