Skip to main content

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. Include your API key in the X-API-Key header:

Authorization Method

Alternatively, you can use the Authorization header with Bearer token:

Getting an API Key

Request Access

To get an API key, contact the Whisky team:

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

HTTP Status: 401 Unauthorized

Missing API Key

HTTP Status: 401 Unauthorized

Rate Limited

HTTP Status: 429 Too Many Requests

Rate Limiting

The API implements rate limiting to ensure fair usage:

Rate Limits by Tier

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
“API key required” Error
  • Make sure the API key is included in headers
  • Check environment variable configuration
  • Verify the header name is correct
Rate Limiting Issues
  • Implement exponential backoff
  • Use multiple API keys if available
  • Monitor rate limit headers

Debug Mode

Support

For authentication issues: