x-api-key header. Your API keys carry many privileges, so be sure to keep them secure!
Getting an API Key
Sign up for Deframe
Create an account at deframe.io
Using Your API Key
Include your API key in thex-api-key header with every request:
Store your API key in a secure server-side environment variable (e.g.
DEFRAME_API_KEY).
Do not expose it in frontend code or commit it to git.API Key Authentication
Recommended for all integrations Use thex-api-key header for all API requests:
- Backend services
- Server-to-server communication
- Automated scripts and bots
- CI/CD pipelines
- All application types
API keys are tied to your customer account and can be rotated or revoked at any time from your dashboard.
Rate Limits
API keys are subject to rate limits to ensure fair usage:Rate Limits
- 100 requests per minute per API key
- 1,000 requests per hour per API key
- Rate limit headers included in every response
Rate Limit Headers
Every API response includes headers showing your current rate limit status:Handling Rate Limits
When you exceed the rate limit, you’ll receive a429 Too Many Requests response:
Security Best Practices
Store Keys Securely
Store Keys Securely
Never hardcode API keys in your source code.Do:
- Use environment variables
- Use secret management services (AWS Secrets Manager, HashiCorp Vault)
- Use encrypted configuration files
- Commit keys to version control
- Include keys in client-side code
- Share keys via email or messaging apps
Rotate Keys Regularly
Rotate Keys Regularly
Rotate your API keys periodically to minimize security risks.Recommended rotation schedule:
- Production keys: Every 90 days
- Development keys: Every 180 days
- Immediately if compromised
- Generate a new API key in your dashboard
- Update your application with the new key
- Test that the new key works
- Delete the old key
Use Different Keys per Environment
Use Different Keys per Environment
Create separate API keys for each environment to isolate security risks.This way, if a development key is compromised, your production environment remains secure.
Monitor API Key Usage
Monitor API Key Usage
Regularly check your API key usage in the dashboard:
- Track request volume
- Monitor for unusual patterns
- Review error rates
- Check which endpoints are being accessed
- Unusually high request volume
- Requests from unexpected IP addresses
- High error rates
Implement Request Signing (Advanced)
Implement Request Signing (Advanced)
For additional security, implement request signing to verify request authenticity.
Troubleshooting
401 Unauthorized
401 Unauthorized
403 Forbidden
403 Forbidden
Problem: Your request returns a 403 Forbidden error.Possible causes:
- API key doesn’t have permission for this endpoint
- Account has been suspended
- Request from blocked IP address
API Key Not Working
API Key Not Working
Problem: New API key doesn’t work immediately.Solution: API keys may take up to 30 seconds to propagate. Wait a moment and try again.If the issue persists:
- Verify you copied the entire key
- Check for hidden characters or spaces
- Try generating a new key