API Keys
API keys are the primary method of authenticating requests to the NSFWGuard API. Each key is cryptographically generated and hashed for storage — the raw key is only displayed once during creation.
Generating Keys
Navigate to Dashboard → API Keys and click "Generate New Key". When a new key is generated, all previously active keys are automatically revoked
- Keys use the format
sk_<48 hex chars> - Only the first 7 characters (prefix) are stored in plaintext for identification
- The full key is hashed with SHA-256 before storage
Using Keys in Requests
Include your API key in the X-API-Key header of every request:
Key Rotation
We recommend rotating your API keys regularly. Generating a new key automatically revokes all previous keys. Revoked keys will immediately return 401 Unauthorized.
On This Page