CleanvoiceDocs

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

  1. Log in to the Cleanvoice dashboard
  2. Navigate to Settings → API Keys
  3. 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

StatusMeaning
401 UnauthorizedMissing or invalid API key
403 ForbiddenKey is valid but lacks permission for this resource