Перейти к содержимому

Text Moderation

Модерация текста

POST https://gptunnel.ru/v1/moderations

Синхронный запрос к модели text-moderation-latest.

Headers

ПараметрТипОписание
Authorization*stringAPI ключ

Request Body

ПараметрТипОписание
input*stringТекст для модерации
useWalletBalanceboolИспользовать личный счёт

Пример запроса

import axios from 'axios'
const response = await axios({
method: 'POST',
url: 'https://gptunnel.ru/v1/moderations',
headers: {
Authorization: 'YOUR_API_KEY',
},
data: {
input: 'Your text string goes here',
},
})
console.log(response.data)

Пример ответа

{
"id": "modr-9b51yQZrBNIHDrIeX5bBcftbj5wgs",
"model": "text-moderation-007",
"results": [
{
"flagged": false,
"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": false,
"violence": false
},
"category_scores": {
"sexual": 0.00009054,
"hate": 0.00007182,
"harassment": 0.00016347,
"self-harm": 0.0000020744,
"sexual/minors": 0.00001351,
"hate/threatening": 0.0000010106,
"violence/graphic": 0.00001040,
"self-harm/intent": 0.0000004586,
"self-harm/instructions": 0.0000003988,
"harassment/threatening": 0.00002314,
"violence": 0.00013958
}
}
],
"usage": {
"prompt_tokens": 5,
"completion_tokens": 0,
"prompt_cost": 0.00005,
"completion_cost": 0,
"total_cost": 0.00005
}
}

Ошибки

{
"error": {
"message": "The model 'gpt-5' does not exist",
"type": "invalid_request_error",
"param": null,
"code": "model_not_found"
}
}