Overview
MySafeCache uses API key authentication to secure access to your cache. All API requests must include a valid API key in the Authorization header.Getting Your API Key
1
Create Account
Sign up for a MySafeCache account at mysafecache.com
2
Access Dashboard
Log in and navigate to your dashboard
3
Generate API Key
Go to the “API Keys” tab and click “Generate New Key”
4
Save Securely
Copy your API key and store it securely (you won’t be able to see it again)
Authentication Format
Include your API key in theAuthorization header of every request:
Examples
Environment Variables
Store your API key securely using environment variables:API Key Management
Multiple API Keys
You can generate multiple API keys for different environments or applications:- Development: For testing and development
- Staging: For pre-production testing
- Production: For live applications
Rotating API Keys
For security best practices:- Generate a new API key
- Update your applications to use the new key
- Test that everything works
- Delete the old API key
API Key Permissions
Currently, all API keys have the same permissions:- Read and write access to your cache
- Access to usage analytics
- Ability to store and retrieve cached responses
Security Best Practices
Never Hardcode API Keys
Never Hardcode API Keys
Always use environment variables or secure credential management systems. Never commit API keys to version control.
Use Different Keys for Different Environments
Use Different Keys for Different Environments
Generate separate API keys for development, staging, and production to limit potential security exposure.
Rotate Keys Regularly
Rotate Keys Regularly
Periodically rotate your API keys as part of your security maintenance routine.
Monitor API Key Usage
Monitor API Key Usage
Regularly check your usage analytics to detect any unusual activity.
Restrict Network Access
Restrict Network Access
If possible, restrict API access to specific IP addresses or networks.
Error Responses
Invalid API Key
Missing API Key
Malformed Authorization Header
Testing Your Authentication
Use this simple test to verify your API key is working:Rate Limits
API keys are subject to rate limits based on your plan:| Plan | Requests per minute | Burst limit |
|---|---|---|
| Free | 60 | 100 |
| Pro | 600 | 1000 |
| Enterprise | 6000 | 10000 |
429 Too Many Requests response: