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
promptstringYes2000The context to generate data from
contextstringNo50000The context to generate data from. Give more details about the data you want to generate.
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[].typestringNo-The type of the key value. Supported types: string, number, boolean, array, array. Default is string.
keys[].descriptionstringNo50Optional description that helps guide the content generation for this key. Maximum 50 characters.
limitnumberNo10Number of data objects to generate. Default is 1
formatstringNo-The format of the generated data, 'object' or 'array'. Default is 'object'.

Response

NameTypeDescription
dataobjectThe data of the data generation
data.generatedarray or objectArray of generated data objects with the specified keys. If 'format' is 'object', it will be a single object with all keys.
data.languagestringThe language used for data generation
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.