Serverless AI Intent Validator
AI powered text intent validation. Determine if a given text matches a specified intent, such as validating if a company description aligns with its stated purpose or if content matches specific criteria.
Endpoint
Validate text against a specified intent to determine relevance and alignment.
POSThttps://api.xtartapp.com/text/intent-validator
*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 validate against the specified intent |
intent | string | Yes | 250 | The intent or purpose against which the input text will be validated |
Response
Name | Type | Description |
---|---|---|
data | object | The result of the intent validation |
data.isValid | boolean | Whether the input text matches the specified intent |
data.confidence | number | Confidence score for the validation result (0.0 to 1.0) |
data.explanation | string | Brief explanation of why the text does or doesn't match the intent |
metadata | object | Metadata about the intent validation process |
metadata.cost | number | The cost of the intent validation 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_INTENT_VALIDATION_ERROR | Ex: could not validate the text against the intent | 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. |