> ## 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.

# 内容审查

> 检查文本内容是否违反使用政策。原生 OpenAI 格式。

## 请求头

**Authorization** `string` *required*

使用 Bearer Token 认证。格式：`Authorization: Bearer sk-xxxxxx`

## 请求体

格式：`application/json`

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

需要审查的文本，可以是单个字符串或字符串数组。

**model** `string`

审查模型 ID

## 响应

### 200 成功审核

格式：`application/json`

**id** `string`

审查请求 ID

**model** `string`

使用的模型

**results** `object[]`

审查结果列表

**属性**

**flagged** `boolean`

是否被标记为违规

**categories** `object`

各分类是否违规

**category\_scores** `object`

各分类的得分

```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": "需要审查的文本"
  }'
```

```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="需要审查的文本")
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.