Serverless AI Data Generation

AI powered data generation service that creates structured data objects based on provided context and keys in multiple languages.

Endpoint

Generate structured data objects based on context and keys

POSThttps://api.xtartapp.com/data/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
contextstringYes500The context to generate data from
languagestringYes-The language to generate the data in. Supported languages: auto, en, es, fr, de, zh, ja, ko, pt, it, ru, ar, hi
keysarrayYes-Array of key objects to include in each generated data object. Maximum 10 keys.
keys[].keystringYes25The key name to use in the generated objects. Maximum 25 characters.
keys[].descriptionstringNo50Optional description that helps guide the content generation for this key. Maximum 50 characters.
limitnumberNo50Number of data objects to generate. Default is 1

Response

NameTypeDescription
dataobjectThe data of the data generation
data.itemsarrayArray of generated data objects with the specified keys
data.countnumberThe number of data objects generated
metadataobjectMetadata about the data generation process
metadata.costnumberThe cost of the data generation request (calculated as $0.0005 per generated item)

Errors

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