Moderate Text
Request
Section titled “Request”The text content to moderate. Maximum 50,000 characters.
The type of content being moderated. Controls how the pipeline interprets the input.
Supported values:
default— General-purpose moderation.username— Username validation. Stricter matching for slurs, impersonation, and inappropriate names.chat— Real-time chat messages. Optimized for short, informal text.forum_post— Forum or community posts. Allows longer-form discussion patterns.comment— User comments on content. Balances between chat and forum post handling.
An optional identifier for the user who authored the content. Used for per-user analytics and repeat offender tracking in the dashboard.
Response
Section titled “Response”Unique identifier for this moderation request.
Recommended action based on category scores and thresholds. One of allow, flag, or block.
true if any category score exceeded its configured threshold.
Per-category moderation results.
Each category contains:
Confidence score from 0.0 to 1.0.
The configured threshold for this category. Scores above this value are flagged.
true if the score exceeds the threshold.
Which pipeline tier handled the request:
0— Local Rust/WASM processing (fastest, no cost)1— OpenAI omni-moderation2— Claude Haiku (ambiguous or custom categories)
Total processing time in milliseconds.
Categories
Section titled “Categories”The following categories are evaluated by default:
| Category | Description |
|---|---|
toxicity | Generally toxic, rude, or disrespectful language. |
harassment | Targeted insults, bullying, or intimidation. |
hate_speech | Attacks based on race, religion, gender, orientation, or other protected attributes. |
sexual | Sexually explicit or suggestive content. |
violence | Graphic violence, threats, or glorification of harm. |
self_harm | Content promoting or describing self-harm or suicide. |
spam | Spam, scams, or unsolicited commercial content. |
Examples
Section titled “Examples”Request
Section titled “Request”curl -X POST https://api.getsieve.dev/v1/moderate/text \ -H "Authorization: Bearer mod_live_abc123..." \ -H "Content-Type: application/json" \ -d '{ "content": "You are such a terrible person, I hope bad things happen to you", "context": "chat", "user_id": "user_456" }'const response = await fetch("https://api.getsieve.dev/v1/moderate/text", { method: "POST", headers: { "Authorization": "Bearer mod_live_abc123...", "Content-Type": "application/json", }, body: JSON.stringify({ content: "You are such a terrible person, I hope bad things happen to you", context: "chat", user_id: "user_456", }),});
const result = await response.json();import requests
response = requests.post( "https://api.getsieve.dev/v1/moderate/text", headers={ "Authorization": "Bearer mod_live_abc123...", "Content-Type": "application/json", }, json={ "content": "You are such a terrible person, I hope bad things happen to you", "context": "chat", "user_id": "user_456", },)
result = response.json()Response
Section titled “Response”{ "request_id": "req_7f3a2b1c", "action": "flag", "flagged": true, "categories": { "toxicity": { "score": 0.89, "threshold": 0.7, "flagged": true }, "harassment": { "score": 0.76, "threshold": 0.7, "flagged": true }, "hate_speech": { "score": 0.05, "threshold": 0.7, "flagged": false }, "sexual": { "score": 0.01, "threshold": 0.8, "flagged": false }, "violence": { "score": 0.42, "threshold": 0.7, "flagged": false }, "self_harm": { "score": 0.03, "threshold": 0.7, "flagged": false }, "spam": { "score": 0.01, "threshold": 0.9, "flagged": false } }, "pipeline_tier": 1, "latency_ms": 145}Username Moderation
Section titled “Username Moderation”curl -X POST https://api.getsieve.dev/v1/moderate/text \ -H "Authorization: Bearer mod_live_abc123..." \ -H "Content-Type: application/json" \ -d '{ "content": "xX_SlurWord_Xx", "context": "username" }'const response = await fetch("https://api.getsieve.dev/v1/moderate/text", { method: "POST", headers: { "Authorization": "Bearer mod_live_abc123...", "Content-Type": "application/json", }, body: JSON.stringify({ content: "xX_SlurWord_Xx", context: "username", }),});import requests
response = requests.post( "https://api.getsieve.dev/v1/moderate/text", headers={"Authorization": "Bearer mod_live_abc123..."}, json={ "content": "xX_SlurWord_Xx", "context": "username", },)Errors
Section titled “Errors”| Status | Code | Description |
|---|---|---|
400 | invalid_request | Missing content field or content exceeds 50,000 characters. |
401 | unauthorized | Missing or invalid API key. |
429 | rate_limit_exceeded | Too many requests. Check the Retry-After header. |
{ "error": { "code": "invalid_request", "message": "The 'content' field is required and must be a non-empty string." }}{ "error": { "code": "unauthorized", "message": "Invalid or missing API key. Include a valid key in the Authorization header." }}{ "error": { "code": "rate_limit_exceeded", "message": "Rate limit exceeded. Retry after 1 second.", "retry_after": 1 }}