Get your API key
To obtain your API key:- Sign up for an account at lettergenerator.co
- Log in to your dashboard
- Navigate to Settings > API Keys
- Click Generate New API Key
- Copy and securely store your API key
Authentication method
Include your API key in theAuthorization header of every request using the Bearer token format:
Example request
Here’s how to authenticate a request to the Letter Generator API:Managing API keys
Rotate keys regularly
For security best practices, rotate your API keys periodically:- Generate a new API key in your dashboard
- Update your application to use the new key
- Test that the new key works correctly
- Delete the old API key
Multiple API keys
You can create multiple API keys for different applications or environments:- Development - Use a separate key for testing
- Production - Use a dedicated key for your live application
- Team members - Issue individual keys for tracking and revocation
Revoke compromised keys
If your API key is compromised:- Immediately delete the compromised key from your dashboard
- Generate a new API key
- Update all applications using the old key
- Monitor your usage logs for suspicious activity
Authentication errors
You may encounter these authentication errors:Your API key is missing, invalid, or expired. Verify that you’re including the correct key in the Authorization header.
Your API key is valid but doesn’t have permission to access this resource. Check your plan limits.
Example error response
Best practices
Store keys securely
Store keys securely
Use environment variables or secure credential management systems to store your API keys. Never hardcode keys in your source code.
Use HTTPS only
Use HTTPS only
Always make API requests over HTTPS to encrypt your API key in transit. HTTP requests will be rejected.
Monitor usage
Monitor usage
Regularly check your API usage in the dashboard to detect unauthorized access or unusual patterns.
Implement error handling
Implement error handling
Handle authentication errors gracefully in your application and log failures for debugging.