Skip to main content

Overview

Smallest AI provides real-time speech-to-text transcription through a WebSocket-based integration with their Waves API. The service connects to wss://api.smallest.ai/waves/v1/stt/live?model=pulse to stream audio continuously and receive interim and final transcription results with low latency.

Smallest AI STT API Reference

Complete API reference for all parameters and methods

Example Implementation

Complete example with WebSocket streaming

Installation

Prerequisites

  1. Smallest AI Account: Sign up at Smallest AI
  2. API Key: Generate an API key from your account dashboard
Set the following environment variable:

Configuration

str
required
Smallest AI API key for authentication.
str
default:"wss://api.smallest.ai"
Base WebSocket URL for the Smallest API. Override for custom or proxied deployments.
str
default:"linear16"
Audio encoding format.
int
default:"None"
Audio sample rate in Hz. When None, uses the pipeline’s configured sample rate.
SmallestSTTService.Settings
default:"None"
Runtime-configurable settings. See Settings below.
float
default:"SMALLEST_TTFS_P99"
P99 latency from speech end to final transcript in seconds. Used for processing metrics.

Settings

Runtime-configurable settings passed via the settings constructor argument using SmallestSTTService.Settings(...). These can be updated mid-conversation with STTUpdateSettingsFrame. See Service Settings for details.

Usage

Basic Setup

With Advanced Features

Updating Settings at Runtime

Transcription settings can be changed mid-conversation using STTUpdateSettingsFrame:
Changing settings will trigger a WebSocket reconnection, which may cause a brief interruption in transcription.

Notes

  • WebSocket streaming: The service uses WebSocket connections for real-time streaming. The connection is automatically managed and will reconnect if interrupted.
  • VAD integration: Uses Pipecat’s VAD to detect when the user stops speaking and sends a finalize message to flush the final transcript while keeping the session alive for the next utterance.
  • Keepalive: The service sends periodic keepalive messages (every 5 seconds) to prevent idle timeouts on the WebSocket connection.
  • Response format: The service receives transcription responses containing transcript (the recognized text), is_final (whether this is a final vs. interim result), is_last (whether this is the last message of the session, only True after close_stream is sent at call end), language (detected or specified language), and session_id (unique identifier for the WebSocket session).
  • Language support: Supports 31 languages including Bulgarian, Bengali, Czech, Danish, German, English, Spanish, Estonian, Finnish, French, Gujarati, Hindi, Hungarian, Italian, Kannada, Lithuanian, Latvian, Malayalam, Marathi, Maltese, Dutch, Odia, Punjabi, Polish, Portuguese, Romanian, Russian, Slovak, Swedish, Tamil, Telugu, and Ukrainian.

Event Handlers

Smallest AI STT supports the standard service connection events: