Authentication
The Whisky API uses API key authentication to secure access to all endpoints. This ensures that only authorized users can access the API and helps prevent abuse.API Key Authentication
All API requests must include a valid API key in the request headers.Header Method (Recommended)
Include your API key in theX-API-Key header:
Authorization Method
Alternatively, you can use theAuthorization header with Bearer token:
Getting an API Key
Request Access
To get an API key, contact the Whisky team:- Email: api@whisky.casino
- Discord: Whisky Gaming Discord
- GitHub: Create an issue
API Key Format
API keys are 64-character hexadecimal strings:Environment Setup
Environment Variables
Add your API key to your environment variables:JavaScript/TypeScript
Python
Error Responses
Invalid API Key
401 Unauthorized
Missing API Key
401 Unauthorized
Rate Limited
429 Too Many Requests
Rate Limiting
The API implements rate limiting to ensure fair usage:Rate Limits by Tier
| Tier | Requests per Minute | Burst Limit |
|---|---|---|
| Standard | 100 | 200 |
| Premium | 1000 | 2000 |
| Enterprise | Custom | Custom |
Rate Limit Headers
Rate limit information is included in response headers:Handling Rate Limits
Security Best Practices
Keep API Keys Secure
- Never commit API keys to version control
- Use environment variables
- Rotate keys regularly
- Use different keys for different environments
Example: Secure Configuration
API Key Rotation
SDK Integration
Whisky API Client
Usage Example
Troubleshooting
Common Issues
“Invalid API key” Error- Verify the API key is correct
- Check for extra spaces or characters
- Ensure the key hasn’t expired
- Make sure the API key is included in headers
- Check environment variable configuration
- Verify the header name is correct
- Implement exponential backoff
- Use multiple API keys if available
- Monitor rate limit headers
Debug Mode
Support
For authentication issues:- Documentation: This documentation
- Community: Discord Server
- Issues: GitHub Issues
- Email: api@whisky.casino
