Content moderation

$0.002 per call · USDC via x402 · POST /api/moderate

Check text for harmful content using OpenAI moderation (omni-moderation-latest). Send POST /api/moderate with the required field text and pay $0.002 per call over x402 or MPP (there is no free tier). It returns a JSON object with model, flagged, categories and category_scores.

Returns flagged status, category breakdown (harassment, hate, self-harm, sexual, violence, etc.), and confidence scores. No API key needed; pay per call via x402. Text capped at 10k chars.

Category: AI & compute · Tags: moderation safety content-filter ai openai trust-and-safety

TRY IN PLAYGROUND →

Parameters

NameTypeRequiredDescription
textstringyesText to check for policy violations (max 10,000 chars) Also accepted as content, str, string, input, body, data.

Example request

curl -i -X POST https://agent402.tools/api/moderate \
  -H "Content-Type: application/json" \
  -d '{"text":"This is a perfectly normal sentence about cooking pasta."}'

Without payment this returns HTTP 402 Payment Required with the exact price for moderate; any x402 v2 or MPP client pays it and retries.

Example response

{
  "model": "omni-moderation-latest",
  "flagged": false,
  "categories": {
    "harassment": false,
    "harassment/threatening": false,
    "hate": false,
    "hate/threatening": false,
    "self-harm": false,
    "sexual": false,
    "violence": false
  },
  "category_scores": {
    "harassment": 0.00012,
    "hate": 0.00003
  }
}
FieldTypeAlways presentIn the example
modelstringyesomni-moderation-latest
flaggedbooleanyesfalse
categoriesobjectyes7 fields: harassment, harassment/threatening, hate, hate/threatening, self-ha...
category_scoresobjectyes2 fields: harassment, hate

From an MCP client

catalog.call {
  "slug": "moderate",
  "params": {
    "text": "This is a perfectly normal sentence about cooking pasta."
  }
}

The hosted connector at https://agent402.tools/mcp needs a payment for moderate; the stdio package pays it from a wallet or from AGENT402_CREDITS_KEY. Local install: npx -y agent402-mcp.

Errors and behavior

Paid call (JavaScript agent)

import { wrapFetchWithPayment } from "@x402/fetch";
import { x402Client } from "@x402/core/client";
import { registerExactEvmScheme } from "@x402/evm/exact/client";
import { privateKeyToAccount } from "viem/accounts";

const client = new x402Client();
client.setSpendControls?.(false); // keep your own spending ceiling in code
registerExactEvmScheme(client, { signer: privateKeyToAccount(KEY) });
const payFetch = wrapFetchWithPayment(fetch, client);

const res = await payFetch("https://agent402.tools/api/moderate", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
    "text": "This is a perfectly normal sentence about cooking pasta."
  }),
});

Related tools

Decisions (OpenAI wire)

$0.001 · POST /v1/decisions

OpenAI's Decisions API on its own wire: point an OpenAI SDK's base URL here and client.decisions.create works unchanged,…

Image generation

$0.030 · POST /api/image-gen

Generate an image from a text prompt using GPT Image 2 (low quality, 1024x1024). No API key needed; pay per call via x40…

Image generation (HD)

$0.100 · POST /api/image-gen-hd

Generate a higher-quality image from a text prompt using GPT Image 2 (medium quality, 1024x1024). No API key needed; pay…

Image generation (Premium)

$0.150 · POST /api/image-gen-premium

Generate a larger image from a text prompt using GPT Image 2 (medium quality): 1536x1024 landscape by default, 1024x1536…

LLM inference

$0.010 · POST /api/llm

LLM inference proxy - send an OpenAI-format chat/completions request and get a response from GPT-4o-mini. Supports visio…

LLM inference (Premium)

$0.500 · POST /api/llm-premium

LLM inference proxy (Premium tier) - o3 or o3-mini reasoning models. Supports vision (up to 2 image URLs) and structured…