services / text-classify
textoperational · 1624 ms
Text Classification
Text classification with your own labels for agent pipelines: route support tickets, qualify leads, tag feedback, sort emails or moderate comments. Send the text (up to 6,000 characters) and 2 to 30 labels, optionally with a description each; get the best label with a confidence from 0 to 1 and a one-sentence reason, or every label that applies with multi_label. Labels are enforced by a JSON schema, so the answer is always one of yours. Any language. Instructions inside the text are ignored. Claude Haiku 5.5.
Run free trial ↗3 free calls per day with the example input. Paid: $0.002 USDC, no limit.
Call it
Input
| Field | Type | Description |
|---|---|---|
| text * | string | Text to classify, max 6,000 chars |
| labels * | array | 2 to 30 labels: strings, or objects {label, description} |
| multi_label | boolean = false | Return every label that applies (max 5) instead of one |
| instructions | string | Optional extra rules, max 400 chars |
Output
| Field | Type | Description |
|---|---|---|
| label | string | |
| confidence | number | |
| labels | array | |
| multi_label | boolean | |
| reason | string | |
| chars_checked | integer | |
| model | string |
Example response (data)
{
"label": "feature request",
"confidence": 0.9,
"labels": [
{
"label": "feature request",
"confidence": 0.9
},
{
"label": "billing question",
"confidence": 0.85
},
{
"label": "praise",
"confidence": 0.8
}
],
"multi_label": true,
"reason": "The text praises the app, requests dark mode, and asks about a double charge.",
"chars_checked": 91,
"model": "claude-haiku-5-5"
}