SDKs
Python SDK
The official Python client for Shunya TTS. Supports async batch and streaming synthesis out of the box.
Installation
terminal
# TTS only
pip install shunyalabs[TTS]
# All products (TTS, ASR, etc.)
pip install shunyalabs[all]
# With optional extras (audio playback, format conversion)
pip install shunyalabs[extras]Minimum requirements
- Python 3.8 or higher
- pip 21.0 or higher
Importing & client setup
python
from shunyalabs import AsyncShunyaClient
from shunyalabs.tts import TTSConfig
from shunyalabs.exceptions import ShunyalabsError
# Preferred — reads SHUNYALABS_API_KEY from env
client = AsyncShunyaClient()
# With all options
client = AsyncShunyaClient(
api_key="your-api-key",
timeout=60.0,
max_retries=2,
)AsyncShunyaClient Configuration
All parameters below are passed to AsyncShunyaClient at instantiation.
| PARAMETER | TYPE | DEFAULT | DESCRIPTION |
|---|---|---|---|
api_key | string | None | Falls back to SHUNYALABS_API_KEY env var. |
timeout | float | 60.0 | Request timeout in seconds. |
max_retries | int | 2 | Retries on 5xx and connection errors. |
Repositories
PyPI: https://pypi.org/project/shunyalabs
GitHub: https://github.com/Shunyalabsai/shunyalabs-python-sdk