POST

Classify the sentiment of English text (positive/negative with score). Runs DistilBERT ONNX locally on CPU

/v1/nlp/sentiment

Powered by Hugging Face

Request → Response

Examples from schemas.json.

Requestapplication/json
POST /v1/nlp/sentiment
Content-Type: application/json

{
  "text": "Hello, world!",
  "lang": "en"
}
Responseapplication/json
HTTP/1.1 200 OK
Content-Type: application/json

// Endpoint-specific body after 402 settlement

Overview

Classify the sentiment of English text (positive/negative with score). Runs DistilBERT ONNX locally on CPU via transformers.js.

Platform hosting open-source machine learning models and datasets.

Request schema

Body: JSON · application/json

FieldTypeDescription
textstringrequired
langstringoptional
IMPLEMENTATION
curl -X POST https://api.tools402.dev/v1/nlp/sentiment \
  -H "Content-Type: application/json" \
  -d '{
  "text": "Hello, world!",
  "lang": "en"
}'

402 payment flow omitted — see Integrations for settlement.