Serverless AI Text Correction
AI powered text correction service that analyzes and corrects spelling, grammar, punctuation, and style errors while preserving the original meaning and tone of the text.
Endpoint
Text correction with language detection
POSThttps://api.xtartapp.com/text/correction
*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 correct |
language | string | Yes | - | The language of input text. If you provide wrong language, the text will not be corrected, 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 correction |
data.originalText | string | The original input text |
data.correctedText | string | The corrected text with spelling, grammar and style improvements |
data.detectedLanguage | string | The detected language code of the text (only returned when language is set to 'auto') |
metadata | object | Metadata about the text correction process |
metadata.cost | number | The cost of the text correction 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_CORRECTION_ERROR | Ex: could not correct 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. |