ACS API · v2

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

EndpointTypeUse case
POST/api/v1/compliance/textTextArticles, posts, descriptions
POST/api/v1/compliance/commentCommentUser comments, reviews
POST/api/v1/compliance/chatChatA single chat message
POST/api/v1/compliance/conversationConversationMulti-turn dialogues
POST/api/v1/compliance/searchSearchSearch queries
POST/api/v1/compliance/imageImageImage moderation
POST/api/v1/compliance/videoVideoVideo moderation
POST/api/v1/compliance/audioAudioSpeech, music and sound moderation
GET/api/v1/accountAuthenticatedRulesets and agents available to your key
GET/api/v1/public/agentsPublicList visible agents
GET/api/v1/public/rulesetsPublicList visible rulesets
GET/api/v1/public/rules?ruleset=IDPublicList active rules in a ruleset

03Compliance check

Request body

FieldTypeDefaultDescription
contentstring | array—Required. Text, a conversation array, or a media URL / base64 data URI.
agentsstring[]default agentAgent IDs to run. Must be permitted for your key and support the content type.
scansinteger1Number of successful scans to collect (1–25). Scans rotate across agents. amount is accepted as an alias.
rulesetstringdefaultRuleset ID to evaluate against.
timeoutinteger60Overall request timeout in seconds (1–300).
contextstringnullAdditional context for reviewers (max 1024 characters).
decision_methodstringaverageaverage, any, all or score.
excluded_categoriesstring[][]Rule IDs to skip.
custom_promptstringnullReplace the ruleset with custom instructions.
verboseinteger00 (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] and scans: 3, scans run as A, B, A.
  • With more agents than scans, only the first scans agents 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

Loading agents
Some agents may be hidden from this list but still available to your key. Use 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.

Loading rules

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.

Per-request timeout: set 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"
}
Only agents with the matching capability (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": "..." }.

StatusCodeDescription
400invalid_requestMissing or invalid parameters, unknown ruleset or agent, or an agent that does not support the content type
401invalid_api_keyMissing or invalid API key
403unauthorizedKey not permitted for the content type, ruleset or agent
403account_disabledAPI key is disabled
405invalid_requestWrong HTTP method
500internal_errorNo 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();