> ## Documentation Index
> Fetch the complete documentation index at: https://www.edenai.co/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Text Moderation

> Text moderation scans text for offensive, sexually explicit or suggestive content, it also checks if there is any content of self-harm, violence, racist or hate speech.

export const TechArticleSchema = ({title, description, path, articleSection, about, proficiencyLevel = "Beginner", dependencies, keywords = [], datePublished, dateModified, image, inLanguage = "en"}) => {
  const baseUrl = "https://www.edenai.co/docs";
  const canonicalUrl = `${baseUrl}/${path}`.replace(/\/+$/, "");
  const ogParams = new URLSearchParams({
    division: articleSection || "",
    title: title || "",
    description: description || ""
  });
  const resolvedImage = image || `https://edenai.mintlify.app/_mintlify/api/og?${ogParams.toString()}`;
  const data = {
    "@context": "https://schema.org",
    "@type": "TechArticle",
    "@id": `${canonicalUrl}#techarticle`,
    mainEntityOfPage: {
      "@type": "WebPage",
      "@id": canonicalUrl
    },
    headline: title,
    name: title,
    description: description,
    url: canonicalUrl,
    inLanguage: inLanguage,
    isPartOf: {
      "@type": "WebSite",
      name: "Eden AI Documentation",
      url: baseUrl
    },
    author: [{
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/"
    }],
    publisher: {
      "@type": "Organization",
      name: "Eden AI",
      url: "https://www.edenai.co/",
      logo: {
        "@type": "ImageObject",
        url: "https://www.edenai.co/assets/logo.png"
      }
    }
  };
  if (articleSection) data.articleSection = articleSection;
  if (about) data.about = {
    "@type": "Thing",
    name: about
  };
  if (proficiencyLevel) data.proficiencyLevel = proficiencyLevel;
  if (dependencies) data.dependencies = dependencies;
  if (keywords && keywords.length) data.keywords = keywords;
  if (datePublished) data.datePublished = datePublished;
  if (dateModified) data.dateModified = dateModified;
  data.image = Array.isArray(resolvedImage) ? resolvedImage : [resolvedImage];
  const json = JSON.stringify(data);
  const schemaId = `techarticle-${canonicalUrl}`;
  React.useEffect(() => {
    if (typeof document === "undefined") return;
    document.querySelectorAll(`script[data-schema-id="${schemaId}"]`).forEach(n => n.remove());
    const script = document.createElement("script");
    script.type = "application/ld+json";
    script.dataset.schemaId = schemaId;
    script.textContent = json;
    document.head.appendChild(script);
    return () => script.remove();
  }, [json, schemaId]);
  return null;
};

<TechArticleSchema title={`Text Moderation`} description={`Text moderation scans text for offensive, sexually explicit or suggestive content, it also checks if there is any content of self-harm, violence, racist or hate speech.`} path="v3/expert-models/features/text/moderation" articleSection="Text Features" about={`NLP API`} proficiencyLevel="Intermediate" keywords={[`Eden AI`, `AI API`, `text analysis`, `NLP`]} datePublished="2026-05-06T00:00:00Z" dateModified="2026-05-07T00:00:00Z" />

## Endpoint

`POST /v3/universal-ai` (sync)

Model string pattern: `text/moderation/{provider}[/{model}]`

## Input

| Field    | Type   | Required | Description             |
| -------- | ------ | -------- | ----------------------- |
| text     | string | Yes      | Text to moderate        |
| language | string | No       | ISO 639-1 language code |

## Output

| Field                   | Type           | Required | Description |
| ----------------------- | -------------- | -------- | ----------- |
| nsfw\_likelihood        | int            | Yes      |             |
| **items**               | array\[object] | No       |             |
|     label               | string         | Yes      |             |
|     likelihood          | int            | Yes      |             |
|     category            | enum           | Yes      |             |
|     subcategory         | enum           | Yes      |             |
|     likelihood\_score   | float          | Yes      |             |
| nsfw\_likelihood\_score | float          | Yes      |             |

## Available Providers

| Provider                        | Model String                                    | Price                   |
| ------------------------------- | ----------------------------------------------- | ----------------------- |
| google                          | `text/moderation/google`                        | \$5 per 1,000,000 chars |
| microsoft                       | `text/moderation/microsoft`                     | \$1 per 1,000 requests  |
| openai                          | `text/moderation/openai`                        | Free                    |
| openai (text-moderation-007)    | `text/moderation/openai/text-moderation-007`    | Free                    |
| openai (text-moderation-latest) | `text/moderation/openai/text-moderation-latest` | Free                    |
| openai (text-moderation-stable) | `text/moderation/openai/text-moderation-stable` | Free                    |

## Quick Start

<CodeGroup>
  ```python Python theme={null}
  import requests

  url = "https://api.edenai.run/v3/universal-ai"
  headers = {
      "Authorization": "Bearer YOUR_API_KEY",
      "Content-Type": "application/json"
  }

  payload = {
      "model": "text/moderation/google",
      "input": {
          "text": "The quick brown fox jumps over the lazy dog.",
          "language": "en"
      }
  }

  response = requests.post(url, headers=headers, json=payload)
  print(response.json())
  ```

  ```bash cURL theme={null}
  curl -X POST https://api.edenai.run/v3/universal-ai \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "model": "text/moderation/google",
      "input": {"text": "The quick brown fox jumps over the lazy dog.", "language": "en"}
    }'
  ```
</CodeGroup>
