Authentication
Authenticate API requests using your Cleanvoice API key.
All requests to the Cleanvoice API must be authenticated with an API key passed as the X-API-Key request header.
Getting your API key
- Log in to the Cleanvoice dashboard
- Navigate to Settings → API Keys
- Click Generate new key and copy it immediately — it is only shown once
Keep your API key secret. Do not expose it in client-side code, public repositories, or logs.
Using your API key
Pass your key in the X-API-Key header on every request:
curl https://api.cleanvoice.ai/v2/edits \
-H "X-API-Key: YOUR_API_KEY"from cleanvoice import Cleanvoice
# Pass directly
client = Cleanvoice(api_key="YOUR_API_KEY")
# Or read from environment variable CLEANVOICE_API_KEY
client = Cleanvoice.from_env()import Cleanvoice from 'cleanvoice';
const client = new Cleanvoice({ apiKey: 'YOUR_API_KEY' });Verify authentication
You can verify your key is working with the auth check endpoint:
curl https://api.cleanvoice.ai/v2/auth \
-H "X-API-Key: YOUR_API_KEY"account = client.check_auth()
print(account)const account = await client.checkAuth();
console.log(account);Using environment variables
Store your key in an environment variable to avoid hardcoding it:
# .env
CLEANVOICE_API_KEY=your_api_key_here# Python — reads CLEANVOICE_API_KEY automatically
client = Cleanvoice.from_env()Error responses
| Status | Meaning |
|---|---|
401 Unauthorized | Missing or invalid API key |
403 Forbidden | Key is valid but lacks permission for this resource |