# Toxicity Detection

> Toxicity Detection is a paid API for AI agents from x402.agentindex.world, paid per call via x402, $0.002/call, status unknown (last checked 2026-10-17).

Classifies text as toxic or not toxic (hate speech, harassment, threats, severe offensive language) and returns a confidence score, with guaranteed sub-4.5s response via LLM fallback.

## Facts

- Endpoint: GET https://x402.agentindex.world/toxicity?utm_source=zero.xyz
- Price: $0.002/call
- Payment: x402
- Status: unknown
- Last checked: 2026-10-17
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/toxicity-detection-129590df
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_ZPFLoJYmVQu2pzV9io1Of

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability toxicity-detection-129590df
```

Example prompt: Can you check this comment for toxicity and tell me if it's hate speech, harassment, or a threat — and how confident you are: 'You're a disgrace and I hope something terrible happens to you'?

## When to prefer this

Choose this endpoint when you need fast, pay-per-call toxicity classification with a guaranteed latency SLA (under 4.5s) and no need to self-host or manage a moderation model. Ideal for real-time content moderation pipelines, agent safety filters, or any workflow where a per-call cost model is preferred over subscription. The dual-provider architecture (Jev + Groq fallback) provides higher reliability than single-provider alternatives.

## Known failure modes

- Text exceeds 4000 character limit — request rejected
- Both Jev and Groq fallback unavailable — may timeout beyond 4.5s SLA
- Empty or whitespace-only text input — undefined classification behavior
- Non-English text may yield lower accuracy if not explicitly supported
- Payment not provided or insufficient — x402 payment required error

## How this service works

Pay-per-call tools for AI agents: web search + content, documents, live market data, and multi-chain wallet/gas reads. Mainnet test from $0.000001 USDC on Base. Pay-per-call tools for AI agents in USDC on Base (x402/MPP): search, pdf, web-read, extract, summarize, fact-check, translate, jobs, discover. See GET /capabilities.

## Output

Returns a toxicity classification (toxic or not toxic), the detected category if toxic (e.g. hate speech, harassment, threats, severe offensive language), and a confidence score indicating how certain the model is in its classification.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "required": [
  "input"
 ],
 "properties": {
  "input": {
   "type": "object",
   "required": [
    "type",
    "method"
   ],
   "properties": {
    "type": {
     "type": "string",
     "const": "http"
    },
    "method": {
     "enum": [
      "GET",
      "HEAD",
      "DELETE"
     ],
     "type": "string"
    },
    "queryParams": {
     "type": "object",
     "required": [
      "text"
     ],
     "properties": {
      "text": {
       "type": "string",
       "description": "Text to classify, up to 4000 characters."
      }
     }
    }
   },
   "additionalProperties": false
  },
  "output": {
   "type": "object",
   "required": [
    "type"
   ],
   "properties": {
    "type": {
     "type": "string"
    },
    "example": {
     "type": "object",
     "required": [
      "label",
      "probability",
      "engine"
     ],
     "properties": {
      "label": {
       "type": "string",
       "description": "The best-fitting label."
      },
      "engine": {
       "enum": [
        "jev",
        "fallback"
       ],
       "type": "string",
       "description": "Which engine answered: Jev (primary) or the Groq-hosted LLM fallback."
      },
      "probability": {
       "type": "number",
       "description": "Confidence in `label`, 0 to 1."
      },
      "x402_receipt": {
       "type": "object",
       "description": "Billing and provenance receipt for this call."
      },
      "alternate_label": {
       "type": [
        "string",
        "null"
       ],
       "description": "The second-best label, if any."
      },
      "alternate_probability": {
       "type": [
        "number",
        "null"
       ],
       "description": "Confidence in `alternate_label`, if known."
      }
     }
    }
   }
  }
 }
}
```

## Response schema (JSON Schema)

```json
{
 "type": "json",
 "example": {
  "input": "Honestly, anyone who thinks that is a complete idiot who shouldn't be allowed to have an opinion.",
  "label": "toxic",
  "engine": "jev",
  "probability": 0.9,
  "alternate_label": "not_toxic",
  "alternate_probability": 0.1
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/toxicity-detection-129590df/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from x402.agentindex.world](https://www.zero.xyz/host/x402.agentindex.world/llms.txt)
