Quickstart
Get your API key
Section titled “Get your API key”Sign up at getsieve.dev/signup and grab your API key from the dashboard.
You’ll get two keys:
mod_test_— test mode, returns deterministic scores without calling AI modelsmod_live_— production mode, full pipeline
Make your first request
Section titled “Make your first request”curl -X POST https://api.getsieve.dev/v1/moderate/text \ -H "Authorization: Bearer mod_live_xxxxx" \ -H "Content-Type: application/json" \ -d '{ "content": "I will find you and end you", "context": "gaming_chat" }'const response = await fetch("https://api.getsieve.dev/v1/moderate/text", { method: "POST", headers: { "Authorization": "Bearer mod_live_xxxxx", "Content-Type": "application/json", }, body: JSON.stringify({ content: "I will find you and end you", context: "gaming_chat", }),});
const result = await response.json();console.log(result.action); // "flag" or "block" or "allow"import requests
response = requests.post( "https://api.getsieve.dev/v1/moderate/text", headers={"Authorization": "Bearer mod_live_xxxxx"}, json={ "content": "I will find you and end you", "context": "gaming_chat", },)
result = response.json()print(result["action"]) # "flag" or "block" or "allow"Understand the response
Section titled “Understand the response”{ "id": "mod_r_9x7mw2", "flagged": true, "action": "flag", "tier_used": 1, "latency_ms": 142, "categories": { "toxicity": { "score": 0.72, "threshold": 0.7, "flagged": true }, "threat": { "score": 0.85, "threshold": 0.6, "flagged": true }, "harassment": { "score": 0.45, "threshold": 0.6, "flagged": false }, "profanity": { "score": 0.05, "threshold": 0.8, "flagged": false } }, "context": "gaming_chat", "metadata": { "pipeline_mode": "general", "shadow_validated": true }}Here’s what each field means:
| Field | Description |
|---|---|
id | Unique moderation result ID. Use this for appeals or audit logs. |
flagged | true if any category score exceeds its threshold. |
action | The recommended action: allow, flag (send to human review), or block. |
tier_used | Which pipeline tier handled the request (0 = local, 1 = standard AI, 2 = advanced AI). |
latency_ms | End-to-end processing time in milliseconds. |
categories | Per-category breakdown with score (0.0 - 1.0), threshold, and whether it was flagged. |
context | The content context you provided. Affects scoring behavior. |
Choose a pipeline mode
Section titled “Choose a pipeline mode”Pipeline modes control how Sieve classifies content. Set this per-request or as an account default.
Best for: Forums, comments, social apps
The default mode. Balanced scoring across all categories with standard thresholds.
{ "content": "your message here", "context": "comment", "mode": "general"}Best for: In-game chat, gaming communities, Discord bots
Higher tolerance for competitive banter (“gg ez”, “you’re trash”), stricter on real threats and hate speech. Understands gaming-specific slang.
{ "content": "gg ez get rekt noob", "context": "gaming_chat", "mode": "gaming"}Best for: Speed-critical paths, high-volume ingestion
Tier 0 only — local Rust processing, no AI calls. Sub-5ms latency, zero per-request cost. Use this when you need speed over nuance.
{ "content": "message to check", "context": "chat", "mode": "edge"}Install an SDK
Section titled “Install an SDK”Pick your language and install the official SDK.
npm install @sieve/sdkpip install sieve-moddotnet add package Sieve.ModerationThen initialize the client:
import Sieve from "@sieve/sdk";
const sieve = new Sieve("mod_live_xxxxx");
const result = await sieve.moderate.text({ content: "check this message", context: "gaming_chat",});
if (result.action === "block") { // reject the message}from sieve_mod import Sieve
sieve = Sieve("mod_live_xxxxx")
result = sieve.moderate.text( content="check this message", context="gaming_chat",)
if result.action == "block": # reject the message passusing Sieve.Moderation;
var client = new SieveClient("mod_live_xxxxx");
var result = await client.Moderate.TextAsync(new TextRequest{ Content = "check this message", Context = "gaming_chat",});
if (result.Action == "block"){ // reject the message}Next Steps
Section titled “Next Steps”Understand the 3-tier pipeline and how scoring works under the hood.
Best practices for moderating real-time gaming communication.
Add your own blocklists, allowlists, and regex patterns.
Drop-in replacement for the Google Perspective API.