Authentication
Overview
All API requests to Smallest Self-Host require authentication using your license key. This ensures only authorized clients can access the speech-to-text service.
Authentication Method
Smallest Self-Host uses Bearer token authentication with your license key.
Authorization Header
Include your license key in the Authorization header:
Example Requests
cURL
Python
JavaScript
Go
Response Codes
Error Responses
401 Unauthorized
Solutions:
- Verify license key is correct
- Check Authorization header format
- Ensure license hasn’t expired
403 Forbidden
Solutions:
- Renew license with Smallest.ai
- Contact support@smallest.ai
429 Rate Limited
Solutions:
- Wait and retry after specified seconds
- Implement exponential backoff
- Contact support for higher limits
Security Best Practices
Secure Key Storage
Never hardcode license keys in source code.
Use environment variables:
Or secret managers:
- AWS Secrets Manager
- HashiCorp Vault
- Kubernetes Secrets
Use HTTPS in Production
Always use HTTPS for API requests in production:
Configure TLS:
Rotate Keys Regularly
Implement key rotation policy:
- Rotate keys every 90 days
- Use different keys for dev/staging/prod
- Revoke compromised keys immediately
Monitor Usage
Track API usage to detect anomalies:
- Unusual traffic patterns
- Failed authentication attempts
- Quota approaching limits
Implement Rate Limiting
Add client-side rate limiting:
SDK Integration
Python SDK
JavaScript SDK
SDKs automatically handle authentication, retries, and error handling.
Testing Authentication
Health Check (No Auth Required)
Expected response:
Verify License Key
Successful authentication returns transcription results.

