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

NameTypeRequiredMaxDescription
textstringYes2500The text to correct
languagestringYes-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

NameTypeDescription
dataobjectThe data of the text correction
data.originalTextstringThe original input text
data.correctedTextstringThe corrected text with spelling, grammar and style improvements
data.detectedLanguagestringThe detected language code of the text (only returned when language is set to 'auto')
metadataobjectMetadata about the text correction process
metadata.costnumberThe cost of the text correction request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_CORRECTION_ERROREx: could not correct the text | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.