> For the complete documentation index, see [llms.txt](https://doc.afarensis.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://doc.afarensis.com/shi-du/kuai-su-ru-men.md).

# 快速入门

引言 Afarensis 文本审核端点是一个强大的工具，旨在帮助开发者检测并识别潜在有害内容。通过此端点，开发者可以有效地过滤不适当的文本，确保内容的安全性。

如何获取文本分类 要利用 Afarensis 文本审核端点对文本进行分类，您需要按照以下步骤操作：

发送请求： 使用以下命令向审核端点发送请求，以获得文本的分类信息。

curl <https://api.afarensis.com/v1/moderations\\>
-X POST\
-H "Content-Type: application/json"\
-H "Authorization: Bearer $AFARENSIS\_API\_KEY"\
-d '{"input": "这里填写样本文本"}' 解读响应： 请求成功后，您将收到如下格式的响应：

flagged: 标记内容是否被认为潜在有害。true 表示有害，false 表示无害。 categories: 每个类别的违规标志字典。true 表示违规，false 表示不违规。 category\_scores: 每个类别的模型原始分数，表示模型对违规的置信度，分数范围从 0 到 1。 示例输出：

{ "id": "modr-XXXXX", "model": "text-moderation-007", "results": \[ { "flagged": true, "categories": { "sexual": false, "hate": false, "harassment": false, "self-harm": false, "sexual/minors": false, "hate/threatening": false, "violence/graphic": false, "self-harm/intent": false, "self-harm/instructions": false, "harassment/threatening": true, "violence": true }, "category\_scores": { "sexual": 1.2282071e-6, "hate": 0.010696256, "harassment": 0.29842457, "self-harm": 1.5236925e-8, "sexual/minors": 5.7246268e-8, "hate/threatening": 0.0060676364, "violence/graphic": 4.435014e-6, "self-harm/intent": 8.098441e-10, "self-harm/instructions": 2.8498655e-11, "harassment/threatening": 0.63055265, "violence": 0.99011886 } } ] } 注意事项 我们不断升级 Afarensis 审核端点的基础模型，以提高准确性和效率。因此，随着时间推移，依赖于 category\_scores 的自定义策略可能需要调整和校准。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://doc.afarensis.com/shi-du/kuai-su-ru-men.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
