For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
DocumentationAPI ReferenceClient LibrariesChangelog
DocumentationAPI ReferenceClient LibrariesChangelog
  • Introduction
    • Introduction
  • Getting Started
    • Quickstart
    • Models
    • Authentication
    • HTTP Streaming
  • Text to Speech
    • How to TTS
    • LLM to TTS
    • Voice Models & Languages
  • Voice Cloning
    • Types of Cloning
    • Voice Clone via UI
    • How to Voice Clone
    • Delete Cloned Voice
    • Professional Voice Cloning
  • Integrations
    • LiveKit
    • Plivo
    • Vonage
  • Product
    • Projects
  • Best Practices
    • Voice Cloning Best Practices
    • PVC Best Practices
    • TTS Best Practices
LogoLogo
Voice AgentsModels
Voice AgentsModels
On this page
  • Requirements
  • Install the SDK
  • Fetch Available Voices, Models, and Languages
  • Explanation of Functions
  • Need Help?
Text to Speech

Get available Voices, Models and Languages

||View as Markdown|
Was this page helpful?
Previous

How to stream LLM to TTS in Realtime

Next

Types of Cloning: Instant vs Professional

Built with

In this tutorial, you will learn how to use the Smallest AI platform to fetch the available languages, models, and voices. By the end of this guide, you’ll be able to retrieve and display this information using the Smallest AI SDK.

Requirements

Before you begin, ensure you have the following:

  • Python (3.9 or higher) installed on your machine.
  • An API key from the Smallest AI platform (sign up here).
  • The Smallest AI Python SDK installed. If you haven’t installed it yet, follow the instructions below:

Install the SDK

$pip install smallestai

Set your API key as an environment variable:

$export SMALLEST_API_KEY=YOUR_API_KEY

Fetch Available Voices, Models, and Languages

The Smallest AI SDK allows you to query the available languages, voices, and models for your TTS needs. Here’s how you can do it:

python
1from smallestai.waves import WavesClient
2
3def main():
4 client = WavesClient(api_key="YOUR_API_KEY")
5
6 # Get available languages
7 languages = client.get_languages()
8 print(f"Available Languages: {languages}")
9
10 # Get available voices for the "lightning" model, alternatively `lightning-large`
11 voices = client.get_voices(model="lightning")
12 print(f"Available Voices (Model: 'lightning'): {voices}")
13
14 # Get user-specific cloned voices
15 cloned_voices = client.get_cloned_voices()
16 print(f"Available Cloned Voices: {cloned_voices}")
17
18 # Get available models
19 models = client.get_models()
20 print(f"Available Models: {models}")
21
22if __name__ == "__main__":
23 main()

Explanation of Functions

  • get_languages(): Retrieves the list of supported languages for Text-to-Speech.
  • get_voices(model="model_name"): Retrieves the voices available for a specific model (e.g., “lightning”).
  • get_cloned_voices(): Fetches all user-specific cloned voices.
  • get_models(): Retrieves the TTS models on the platform available through API.

Need Help?

If you have any questions or encounter issues, our community is here to help!

  • Join our Discord server to connect with other developers and get real-time support.
  • Contact us via email: support@smallest.ai.