Serverless AI Zero-Shot Classification
AI powered zero-shot text classification service that classifies text into multiple labels with confidence scores.
Endpoint
Zero-shot text classification with label confidence scoring
POSThttps://api.xtartapp.com/text/classification/zero-shot
*Authentication
You must use a Bearer token provided by the dashboard to use for authentication. Add the token to the Authorization header.
Request body
Name | Type | Required | Max | Description |
---|---|---|---|---|
text | string | Yes | 2500 | The text to classify |
labels | array of strings | Yes | 25 | The candidate labels for classification |
Response
Name | Type | Description |
---|---|---|
data | array | Array of classification objects |
data[].label | string | The classified label |
data[].confidence | number | The confidence score of the classification |
metadata | object | Metadata about the classification process |
metadata.cost | number | The cost of the classification request |
Errors
{
"error": "string",
"code": "string"
}
HTTP Status | Error Code | Message |
---|---|---|
400 | INVALID_PAYLOAD | Occurs when the payload is invalid. |
400 | INVALID_REQUEST | Ex.: The request is invalid. |
400 | TEXT_ZERO_SHOT_CLASSIFICATION_ERROR | Ex: could not classify the text | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |