Serverless AI Text Generation

AI powered text generation service that creates engaging, relevant content based on the provided context in multiple languages.

Endpoint

Text generation based on context

POSThttps://api.xtartapp.com/text/generation

*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
contextstringYes250Short description of the content to generate.
languagestringYes-The language to generate the text in. Supported languages: en, es, fr, de, zh, ja, ko, pt, it, ru, ar, hi

Response

NameTypeDescription
dataobjectThe data of the text generation
data.generatedTextstringThe generated text based on the context
data.languagestringThe language used for text generation
metadataobjectMetadata about the text generation process
metadata.costnumberThe cost of the text generation request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400TEXT_GENERATION_ERROREx: could not generate 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.