Dashboard|

Moderation API

Content safety, fraud and scam detection for text and images.

Check user content for safety problems and scams before it reaches other users or a model. It returns the same response shape as OpenAI's moderation API, plus fraud and scam categories that OpenAI doesn't cover, a recommended action, and the evidence for each flag.

Most requests are free. You pay only when a message is unclear enough to need a model, and those messages are batched and cached.

How it works

Three layers run, cheapest first:

LayerWhat it doesCost
rulesFraud and scams, off-platform payment and contact, cheating, ethnic hate, grooming, and insults and threats in Nigerian English, Pidgin, Yoruba, Igbo and Hausa. Also applies your block listFree, runs on Cencori in about 0.01 ms per message
openaiOpenAI omni-moderation-latest: harassment, hate, illicit, self-harm, sexual, violence, for text and imagesFree
llmA cheap model (default DeepSeek deepseek-v4.1-flash, with thinking off) that reads context. Runs only for messages the rules found unclear (a signal, but not enough to block) and for your custom categoriesModel price plus the usual gateway markup. About $0.00003 per message, and $0 for a repeat

For a message the model reviewed, its judgement replaces the rules' score for the categories it checked: it can clear a false positive ("send me your number, we dey plan football") or confirm a scam. Messages the rules already block never reach the model.

If OpenAI or the model fails, you still get the other layers' results. The response lists the failure in errors and layers (for example "openai": "error"). An OpenAI failure also adds the X-Cencori-Moderation-Degraded: openai header.

Basic request

const result = await cencori.ai.moderation({
  input: 'Send 5k to my opay 8123456789 and receive 50k back in 1 hour',
});
 
const [r] = result.results;
if (r.action === 'block') {
  // drop the message
} else if (r.action === 'review') {
  // hide it until a moderator checks it
}

Request parameters

ParameterTypeRequiredDescription
inputstring | string[] | Part[]YesA string, up to 100 strings (one result each), or an array of {type:"text",text} / {type:"image_url",image_url:{url}} parts, which gives one result
modelstringNoOpenAI model for the openai layer. Default omni-moderation-latest
layers("rules" | "openai")[]NoWhich layers to run. Default both. ["rules"] never calls OpenAI and responds in milliseconds
thresholdsobjectNoFlag threshold per category, 0–1, e.g. {"fraud/off_platform_contact": 0.3}. "*" sets the default. Default 0.5
block_thresholdnumberNoScore at which action becomes block. Default 0.8. The SDK option is blockThreshold
escalate"auto" | "always" | "never"NoWhen the llm layer runs. auto (default) sends only unclear messages and custom categories
llm_modelstringNoModel for the llm layer. Default deepseek-v4.1-flash. Any gateway chat model works, e.g. gemini-2.5-flash-lite, gpt-5-nano, claude-haiku-5-5
custom_categoriesarrayNoUp to 20 of {name, description, threshold?}. The model scores each message against your description; results come back as custom/<name>
blockliststring[]NoTerms that always block, as custom/blocklist
allowliststring[]NoYour own terms that look like scam words (a "Lagos Life Bank" location, for example). Removed before the rules run
brand_namesstring[]NoYour brand and product names. Catches people posing as your staff ("Lagos Life admin here")
contextstringNoOne or two sentences about your platform, given to the model, e.g. "Game naira is fictional; selling it for real money is banned"

| previous_messages | array | No | Earlier messages in the same conversation, oldest first (up to 10 used), so the model can tell banter from a real ask. One array or null per input string; a flat array when the input is one string | | category_actions | object | No | The strongest action a category may lead to, "review" or "block". See Banter |

SDK options use camelCase: blockThreshold, llmModel, customCategories, brandNames, previousMessages, categoryActions.

Banter

Nigerian chat is full of banter: mock begging ("baby abeg send me 2k for transport 😂"), trash talk ("una be mumu"), and sarcasm about politics and tribes. The model is told to score these low, to use high scores only when intent is unmistakable, and to give middle scores to messages that could go either way, so a person reviews them.

Some categories are banter so often that, by default, a single message there leads to review at most, never block:

CategoryDefault strongest action
fraud/romancereview
fraud/off_platform_contactreview
harassmentreview
hatereview
custom/*review
everything else, including harassment/threatening, hate/ethnic, hate/threatening and the other fraud/*block

Raise or lower any category with category_actions, e.g. { "custom/politics": "block", "fraud/real_money_trading": "review" }.

Send previous_messages when you have them. "Send me 2k" in reply to "who dey owe me?" reads differently from a cold message to a stranger.

Image URLs must be https:// or a base64 data:image/... URL. Images need the openai layer.

Response

{
  "id": "modr-...",
  "model": "omni-moderation-latest",
  "layers": { "rules": "ok", "openai": "ok" },
  "rules_version": "cencori-rules-2026-11-10",
  "usage": { "llm_items": 0, "llm_cached_items": 0, "llm_calls": 0, "llm_model": null, "cost_usd": 0 },
  "results": [
    {
      "flagged": true,
      "action": "block",
      "flagged_categories": ["fraud", "fraud/off_platform_payment", "fraud/advance_fee"],
      "categories": { "fraud/advance_fee": true, "harassment": false, "...": false },
      "category_scores": { "fraud/advance_fee": 0.93, "harassment": 0.0001, "...": 0 },
      "matches": [
        {
          "layer": "rules",
          "category": "fraud/advance_fee",
          "score": 0.75,
          "rule": "send_to_receive",
          "text": "send 5k to my opay 8123456789 and receive 50k"
        }
      ],
      "layers_applied": ["openai", "rules"]
    }
  ]
}
  • action is allow, review (flagged, below the block threshold) or block.
  • categories and category_scores include every category below, so code written for OpenAI keeps working.
  • matches says which layer and rule flagged the content, and on what text. Model matches include a one-line reason. Moderators can see why.
  • usage.cost_usd is what the request cost. It is 0 unless the llm layer ran.
  • fraud/off_platform_contact is a risk signal: on its own it gives review, never block, and it doesn't count toward fraud. Next to a scam signal, it raises that score.

Categories

From OpenAI: harassment, harassment/threatening, hate, hate/threatening, illicit, illicit/violent, self-harm, self-harm/intent, self-harm/instructions, sexual, sexual/minors, violence, violence/graphic. The rules layer also scores harassment, hate and sexual for Pidgin and local-language content.

Cencori:

CategoryCatches
fraudThe highest of the fraud/* scores below
fraud/phishingAsking for an OTP, PIN, password, BVN, NIN, card details or login; fake "verify your account"
fraud/off_platform_paymentBank account numbers, transfers to a personal account, OPay/PalmPay/Moniepoint and other wallets, crypto addresses
fraud/off_platform_contactPhone numbers (including spelled out), WhatsApp, Telegram and other handles
fraud/advance_fee"Send 5k and get 50k", processing or release fees, fake winnings, inheritance and grant scams
fraud/investment"Double your money", guaranteed returns, Ponzi schemes, sure odds and fixed matches
fraud/giveawayFake giveaways, "first 50 people", "claim your free 100k"
fraud/impersonationPosing as staff, admins, support, a bank or EFCC/CBN/police; fake suspension notices
fraud/romanceSugar mummy/daddy connect and personal money requests
fraud/real_money_tradingSelling in-game currency, items or accounts for real money
fraud/cybercrimeYahoo formats, picking, carding, bank logs, money rituals
cheating/exploitMoney glitches, hacks, mod APKs, bots
hate/ethnicEthnic slurs and generalisations, such as "all X people are thieves"
child_safety/groomingSecrecy requests, asking for pictures, moving to private meetings

GET /v1/moderations lists the categories, models and defaults.

Configure it for your platform

const result = await cencori.ai.moderation({
  input: messages,
  brandNames: ['Lagos Life', 'Vatar'],
  allowlist: ['Lagos Life Bank'],
  blocklist: ['blue gate'],
  context: 'A life simulator set in Lagos. Game naira is fictional and cannot be withdrawn.',
  customCategories: [
    { name: 'politics', description: 'Partisan political campaigning or election content', threshold: 0.7 },
  ],
});

Batch requests

Send up to 100 strings at once. Results come back in the same order.

const { results } = await cencori.ai.moderation({
  input: messages.map((m) => m.text),
  layers: ['rules'], // free and instant; skip OpenAI and the model
});

HTTP API

curl -X POST https://api.cencori.com/v1/moderations \
  -H "Authorization: Bearer csk_..." \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Abeg send me the OTP wey dem send you",
    "thresholds": { "fraud/off_platform_contact": 0.3 }
  }'

To migrate from OpenAI, change the base URL and key. The request and response fields OpenAI uses are unchanged.