🚢
API Docs
  • С чего начать?
  • Стоимость запросов
  • Интеграция чат-ботов
  • Токенизация
  • API - Ассистенты
    • Assistant API
    • Чат с ассистентом
  • API - Общие запросы
    • Запрос баланса
  • API - OpenAI -ChatGPT
    • Список моделей
    • Запрос чату
  • API - OpenAI - Embedding
    • embedding-ada-v2
    • text-embedding-3-small
    • text-embedding-3-large
  • Moderation
    • text-moderation
  • RAG DATABASE
    • List of RAGs
    • List of files
    • Add file to RAG
    • Delete file from RAG
  • FaceSwap 2.0
    • /create
    • /result
  • Background Remover
    • /create
    • /result
  • API -Midjourney
    • /imagine
    • /result
    • /upsample
    • /variation
    • /outpaint
    • /pan
    • /upscale
    • /inpaint
    • /reroll
Powered by GitBook
On this page
  • Модерация текста
  • Пример запроса
  • Пример ответа
  1. Moderation

text-moderation

Отправить синхронный запрос используя модель text-moderation-007

Previoustext-embedding-3-largeNextList of RAGs

Last updated 11 months ago

Чтобы отправлять авторизованные запросы нужно получить API ключ, как это сделать написано в разделе

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

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

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

Headers

Name
Type
Description

Authorization*

string

API ключ

Request Body

Name
Type
Description

input*

string

Контент

useWalletBalance

bool

Использовать личный счет

{
	"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.00009054947440745309,
				"hate": 0.00007182655826909468,
				"harassment": 0.00016347762721125036,
				"self-harm": 0.0000020744676021422492,
				"sexual/minors": 0.000013518638297682628,
				"hate/threatening": 0.0000010106600711878855,
				"violence/graphic": 0.00001040412189468043,
				"self-harm/intent": 4.586087243296788e-7,
				"self-harm/instructions": 3.98835481973947e-7,
				"harassment/threatening": 0.000023142851205193438,
				"violence": 0.00013958947965875268
			}
		}
	],
	"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"
  }
}
{
  "error": {
    "message": "Organization balance is too low to use API",
    "type": "insufficient_balance_error",
    "param": null,
    "code": null
  }
}
{
  "error": {
    "message": "Unauthorized",
    "type": "unauthorized_request_error",
    "param": null,
    "code": null,
  }
}

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

import axios from 'axios'

const request = axios({
  method: 'POST',
  url: 'https://gptunnel.ru/v1/moderations',
  headers: {
    // use your API key here
    Authorization: 'YOUR_API_KEY',
  },
  data: {
     input: "Your text string goes here",
  },
})

request.then((result) => {
  console.log(result)
}).catch((error) => {
  console.error(error)
})
curl --request POST \
  --url https://gptunnel.ru/v1/moderations \
  --header 'Authorization: YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
      "input": "Your text string goes here"
}'

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

{
	"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.00009054947440745309,
				"hate": 0.00007182655826909468,
				"harassment": 0.00016347762721125036,
				"self-harm": 0.0000020744676021422492,
				"sexual/minors": 0.000013518638297682628,
				"hate/threatening": 0.0000010106600711878855,
				"violence/graphic": 0.00001040412189468043,
				"self-harm/intent": 4.586087243296788e-7,
				"self-harm/instructions": 3.98835481973947e-7,
				"harassment/threatening": 0.000023142851205193438,
				"violence": 0.00013958947965875268
			}
		}
	],
	"usage": {
		"prompt_tokens": 5,
		"completion_tokens": 0,
		"prompt_cost": 0.00005,
		"completion_cost": 0,
		"total_cost": 0.00005
	}
}

С чего начать?