Python SDK
Authentication
Authenticate with the Cleanvoice Python SDK.
Get your API key
Go to app.cleanvoice.ai/developer/api-keys and create a new key.
Initialize the client
Recommended — read from environment variable:
from cleanvoice import Cleanvoice
client = Cleanvoice.from_env()This reads the CLEANVOICE_API_KEY environment variable automatically. Set it before running your script:
export CLEANVOICE_API_KEY="your_api_key_here"Explicit API key:
from cleanvoice import Cleanvoice
client = Cleanvoice(api_key="YOUR_API_KEY")Custom base URL and timeout
client = Cleanvoice(
api_key="YOUR_API_KEY",
base_url="https://api.cleanvoice.ai/v2",
timeout=120,
)timeout is in seconds. The default is suitable for most requests, but long audio files may benefit from a higher value.
Verify your key
account = client.check_auth()
print(account)Returns your account information including remaining credits.
Keep your API key secret. Never commit it to source control or expose it in client-side code. Use environment variables or a secrets manager.