Key Types
Making Authenticated Requests
Include your API key in thex-api-key header with every request:
Authentication Errors
Failed authentication returns a401 response:
Common Authentication Issues
Best Practices
Store keys securely
Store keys securely
Use environment variables or a secrets manager to store your API keys. Never hardcode them in your source code.
Use different keys for different environments
Use different keys for different environments
Use test keys (
sk_test_) for development and live keys (sk_live_) for production.Rotate keys periodically
Rotate keys periodically
Regularly rotate your API keys as a security best practice.
Restrict key permissions
Restrict key permissions
If available, create keys with only the permissions your application needs.
