Serverless AI Text Normalization
AI powered text normalization service that standardizes spacing, punctuation, and character encoding while preserving the original meaning and content of the text.
Endpoint
Text normalization with language detection
POSThttps://api.xtartapp.com/text/normalization
*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 normalize |
language | string | No | - | The language of input text. If you provide wrong language, the text will not be normalized, and the original text will be returned. Supported languages: auto, en, es, fr, de, zh, ja, ko, pt, it, ru, ar, hi |
Response
Name | Type | Description |
---|---|---|
data | object | The data of the text normalization |
data.originalText | string | The original input text |
data.normalizedText | string | The normalized text with standardized spacing, punctuation, and character encoding |
data.detectedLanguage | string | The detected language code of the text (only returned when language is set to 'auto') |
metadata | object | Metadata about the text normalization process |
metadata.cost | number | The cost of the text normalization 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_NORMALIZATION_ERROR | Ex: could not normalize 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. |