Automated Content Safety API
Analyze text, comments, chat, conversations, search queries, images, video and audio against configurable compliance rulesets using one or more AI reviewer agents.
01Authentication
Every compliance request requires an API key sent as a Bearer token. Each key is scoped to specific content types, rulesets and agents.
Authorization: Bearer YOUR_API_KEY
02Endpoints
| Endpoint | Type | Use case |
|---|---|---|
POST/api/v1/compliance/text | Text | Articles, posts, descriptions |
POST/api/v1/compliance/comment | Comment | User comments, reviews |
POST/api/v1/compliance/chat | Chat | A single chat message |
POST/api/v1/compliance/conversation | Conversation | Multi-turn dialogues |
POST/api/v1/compliance/search | Search | Search queries |
POST/api/v1/compliance/image | Image | Image moderation |
POST/api/v1/compliance/video | Video | Video moderation |
POST/api/v1/compliance/audio | Audio | Speech, music and sound moderation |
GET/api/v1/account | Authenticated | Rulesets and agents available to your key |
GET/api/v1/public/agents | Public | List visible agents |
GET/api/v1/public/rulesets | Public | List visible rulesets |
GET/api/v1/public/rules?ruleset=ID | Public | List active rules in a ruleset |
03Compliance check
Request body
| Field | Type | Default | Description |
|---|---|---|---|
content | string | array | — | Required. Text, a conversation array, or a media URL / base64 data URI. |
agents | string[] | default agent | Agent IDs to run. Must be permitted for your key and support the content type. |
scans | integer | 1 | Number of successful scans to collect (1–25). Scans rotate across agents. amount is accepted as an alias. |
ruleset | string | default | Ruleset ID to evaluate against. |
timeout | integer | 60 | Overall request timeout in seconds (1–300). |
context | string | null | Additional context for reviewers (max 1024 characters). |
decision_method | string | average | average, any, all or score. |
excluded_categories | string[] | [] | Rule IDs to skip. |
custom_prompt | string | null | Replace the ruleset with custom instructions. |
verbose | integer | 0 | 0 (decision only), 1 (standard), 2 (detailed, includes every scan). |
Example request
{
"content": "User-generated text to evaluate",
"agents": ["reviewer-a", "reviewer-b"],
"scans": 4,
"ruleset": "default",
"timeout": 30,
"decision_method": "average",
"verbose": 2
}
Example response
{
"decision": "safe",
"reason": "Content is compliant.",
"score": "0/4",
"decision_method": "average",
"ruleset": "default",
"flagged_categories": [],
"agents": ["reviewer-a", "reviewer-b"],
"agent_decisions": [
{ "agent_name": "Reviewer A", "agent_id": "reviewer-a", "attempt": 1, "decision": "safe", "reason": "", "flagged_categories": [], "time": 0.84 }
],
"execution_time": 1.234,
"requested_scans": 4,
"requested_amount": 4,
"valid_responses": 4
}
04Agents & scans
Agents are the AI models that review content. If a request does not list agents, the configured default agent is used. If the default cannot handle the content type or is not permitted for your key, the highest-scoring permitted agent is used instead.
- With one agent and
scans: 3, the same agent reviews the content three times. - With agents
[A, B]andscans: 3, scans run as A, B, A. - With more agents than scans, only the first
scansagents run. - Failed or timed-out scans are retried on the next agent in the rotation until the requested number succeed or the deadline is reached.
Available agents
GET /api/v1/account to see the agents assigned to you.05Rulesets
Rules are organized into rulesets. Each request can target a ruleset via ruleset; otherwise the system default is used.
curl https://acs-v3.api.efficientstack.com/api/v1/public/rulesets
curl "https://acs-v3.api.efficientstack.com/api/v1/public/rules?ruleset=default"
06Default compliance rules
Active rules in the default ruleset.
07Decision methods
The final decision is computed from all successful scans.
Average (default)
Unsafe if 50% or more of scans flag the content.
Any
Unsafe if any single scan flags the content.
All
Unsafe only when every scan flags the content.
Score
Each scan is weighted by its agent's score; unsafe when flagged weight reaches 50%.
08Timeouts & retries
The API collects the requested number of successful scans. If a scan fails or times out, it is dispatched again on the next agent in the rotation, up to three attempts per requested scan.
timeout in seconds to cap total processing time. The deadline applies across all retries; scans still running at the deadline are discarded.09Media content
Image, video and audio endpoints accept a public URL, a base64 data URI, or raw base64.
{ "content": "https://example.com/clip.mp4", "scans": 2 }
{ "content": "data:audio/mpeg;base64,SUQzBAAAAAAA...", "scans": 1 }
Media is forwarded to the reviewer models as a file part. The MIME type is detected from the data URI or the URL extension, with defaults of image/jpeg, video/mp4 and audio/mpeg:
{
"type": "input_file",
"file_name": "clip.mp4",
"mime_type": "video/mp4",
"file_url": "https://example.com/clip.mp4"
}
image, video or audio) can review media. Large files sent inline as base64 increase latency; prefer URLs where possible.10Account
Returns the rulesets and agents your key may use, plus the effective defaults.
curl https://acs-v3.api.efficientstack.com/api/v1/account -H "Authorization: Bearer YOUR_API_KEY"
{
"description": "Acme Moderation",
"permissions": ["text", "image"],
"rulesets": [{ "id": "default", "name": "Default", "description": "", "is_default": true }],
"agents": [{ "id": "reviewer-a", "name": "Reviewer A", "capabilities": ["text", "image"], "is_default": true }],
"defaults": { "ruleset": "default", "agent": "reviewer-a", "scans": 1, "decision_method": "average", "verbose": 0 },
"limits": { "max_scans": 25 }
}
11Errors
Errors return { "error": true, "message": "...", "code": "..." }.
| Status | Code | Description |
|---|---|---|
| 400 | invalid_request | Missing or invalid parameters, unknown ruleset or agent, or an agent that does not support the content type |
| 401 | invalid_api_key | Missing or invalid API key |
| 403 | unauthorized | Key not permitted for the content type, ruleset or agent |
| 403 | account_disabled | API key is disabled |
| 405 | invalid_request | Wrong HTTP method |
| 500 | internal_error | No capable agents, provider not configured, or server error |
12Code examples
curl -X POST "https://acs-v3.api.efficientstack.com/api/v1/compliance/image" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"content": "https://example.com/image.jpg",
"agents": ["reviewer-a"],
"scans": 3,
"ruleset": "default",
"timeout": 30,
"verbose": 2
}'
import requests
resp = requests.post(
"https://acs-v3.api.efficientstack.com/api/v1/compliance/image",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={
"content": "https://example.com/image.jpg",
"agents": ["reviewer-a"],
"scans": 3,
"ruleset": "default",
"timeout": 30,
"verbose": 2
},
timeout=35
)
print(resp.json())
const res = await fetch("https://acs-v3.api.efficientstack.com/api/v1/compliance/image", {
method: "POST",
headers: {
"Authorization": "Bearer YOUR_API_KEY",
"Content-Type": "application/json"
},
body: JSON.stringify({
content: "https://example.com/image.jpg",
agents: ["reviewer-a"],
scans: 3,
ruleset: "default",
timeout: 30,
verbose: 2
})
});
const data = await res.json();