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

# Moderations

> Check whether text content violates usage policies. Native OpenAI format.

## Headers

**Authorization** `string` *required*

Bearer token authentication. Format: `Authorization: Bearer sk-xxxxxx`

## Body

Format: `application/json`

**input** `string | string[]` *required*

The text to moderate. Can be a single string or an array of strings.

**model** `string`

Moderation model ID.

## Response

### 200 Successfully moderated

Format: `application/json`

**id** `string`

Moderation request ID.

**model** `string`

The model used.

**results** `object[]`

List of moderation results.

**Properties**

**flagged** `boolean`

Whether the content is flagged as violating.

**categories** `object`

Whether each category is violated.

**category\_scores** `object`

Scores for each category.

```bash cURL theme={"dark"}
curl -X POST "https://t.ato2.nodesms.com/v1/moderations" \
  -H "Authorization: Bearer $API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "input": "Text to moderate"
  }'
```

```python Python theme={"dark"}
from openai import OpenAI

client = OpenAI(
    api_key="sk-xxxxx",
    base_url="https://t.ato2.nodesms.com/v1"
)

response = client.moderations.create(input="Text to moderate")
print(response)
```

```json 200 theme={"dark"}
{
  "id": "string",
  "model": "string",
  "results": [
    {
      "flagged": true,
      "categories": {},
      "category_scores": {}
    }
  ]
}
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.