Authentication
API Keys
Section titled “API Keys”Sieve uses prefixed API keys to distinguish between production and test environments:
| Prefix | Environment | Description |
|---|---|---|
mod_live_ | Production | Full moderation pipeline. Calls are billed. |
mod_test_ | Test | Deterministic responses. No AI calls. No billing. |
You can create and manage API keys from the Sieve Dashboard.
Sending Your Key
Section titled “Sending Your Key”Include your API key in every request using one of two supported headers:
curl -X POST https://api.getsieve.dev/v1/moderate/text \ -H "Authorization: Bearer mod_live_abc123..." \ -H "Content-Type: application/json" \ -d '{"content": "Hello world"}'curl -X POST https://api.getsieve.dev/v1/moderate/text \ -H "X-API-Key: mod_live_abc123..." \ -H "Content-Type: application/json" \ -d '{"content": "Hello world"}'Both headers are equivalent. Use whichever fits your framework or HTTP client best.
Test Mode
Section titled “Test Mode”When you authenticate with a mod_test_ key, the API enters test mode:
- Deterministic scores — Known toxic phrases return high scores; benign input returns low scores.
- No AI calls — Requests never leave Sieve’s infrastructure. OpenAI and Claude are not invoked.
- No billing — Test calls are not counted toward your monthly quota.
- Same response format — The response shape is identical to production, so your integration code works without changes.
Test mode is ideal for:
- Unit and integration testing
- CI/CD pipelines
- Local development
- Validating your parsing logic against known inputs
Key Security
Section titled “Key Security”Sieve takes API key security seriously:
- Keys are SHA-256 hashed before storage. Sieve never stores your key in plaintext.
- Your full key is shown only once at creation time. Copy it immediately.
- If a key is compromised, revoke it from the dashboard and create a new one.
- Never commit API keys to version control. Use environment variables or a secrets manager.
Key Management
Section titled “Key Management”From the Sieve Dashboard, you can:
- Create new live or test keys
- Revoke compromised or unused keys
- View key metadata (creation date, last used, prefix)
- Label keys for easier identification (e.g., “production-backend”, “staging-ci”)