Skip to content

Authentication

Sieve uses prefixed API keys to distinguish between production and test environments:

PrefixEnvironmentDescription
mod_live_ProductionFull moderation pipeline. Calls are billed.
mod_test_TestDeterministic responses. No AI calls. No billing.

You can create and manage API keys from the Sieve Dashboard.

Include your API key in every request using one of two supported headers:

Terminal window
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"}'
Terminal window
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.

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

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.

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”)