Instant Voice Clone (Python SDK)
Instant Voice Clone (Python SDK)
Create an instant voice clone by uploading a short audio sample (5-15 seconds) via the Python SDK.
You can access the source code for the Python SDK on our GitHub repository.
Prefer plain HTTP? The Instant Voice Clone (REST API) page covers the same operation without the 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.
Setup
Install our SDK
Set your API key as an environment variable.
Add your Voice
The Smallest AI SDK allows you to clone your voice by uploading an audio file. This feature is available both synchronously and asynchronously, making it flexible for different use cases. Below are examples of how to use this functionality.
Synchronously
Asynchronously
Parameters
api_key: Your API key. Set theSMALLEST_API_KEYenvironment variable, or pass it explicitly withSmallestAI(api_key="YOUR_API_KEY").display_name: Name of the voice to be created.file: The audio file to clone from, opened in binary mode.- Optional:
description,accent,tags,language, andmodel. - Pass the file as a
(filename, file_object, content_type)tuple so the upload carries the right file type.
These parameters are part of the create_voice_clone function. They can be set when calling the function as shown above.
Get All Cloned Voices
Once you have cloned your voices, you can retrieve a list of all cloned voices associated with your account using the following code:
If you have any questions or run into any issues, our community is here to help!
- Join our Discord server to connect with other developers and get real-time support.
- Reach out to our team via email: support@smallest.ai.

