---
title: "违禁词检测"
method: POST
path: "/api/v1/banned-words"
tags: ["Security Scan"]
---

# 违禁词检测

`POST /api/v1/banned-words`

## Request

- Base URL: `https://aishield.tools`
- URL: `https://aishield.tools/api/v1/banned-words`
- Auth: none required

检测文本中是否包含违禁词/敏感词。

可按类别筛选检测结果，返回命中的违禁词列表和位置。

## Request body

- BannedWordsRequest: 违禁词检测请求
  - `text` string, required: 待检测的文本
  - `categories` string[]: 检测类别（可选，默认全部）

## Response `200`

检测结果

- object
  - `safe` boolean
  - `hits` object[]
    - `word` string
    - `category` string
    - `position` integer
  - `total_hits` integer

## Other responses

- `400`: 参数缺失
- `429`: 速率限制
- `500`: 内部错误

---

[API](https://skmtc.dev/aishield/apis/aishield-api.md) · [All operations](https://skmtc.dev/aishield/apis/aishield-api/llms.txt) · [OpenAPI document](https://skmtc.dev/aishield/apis/aishield-api/revisions/9a04f4fb94bd?raw)
