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
Name | Type | Required | Max | Description |
---|---|---|---|---|
context | string | Yes | 500 | The context to generate data from |
language | string | Yes | - | The language to generate the data in. Supported languages: auto, en, es, fr, de, zh, ja, ko, pt, it, ru, ar, hi |
keys | array | Yes | - | Array of key objects to include in each generated data object. Maximum 10 keys. |
keys[].key | string | Yes | 25 | The key name to use in the generated objects. Maximum 25 characters. |
keys[].description | string | No | 50 | Optional description that helps guide the content generation for this key. Maximum 50 characters. |
limit | number | No | 50 | Number of data objects to generate. Default is 1 |
Response
Name | Type | Description |
---|---|---|
data | object | The data of the data generation |
data.items | array | Array of generated data objects with the specified keys |
data.count | number | The number of data objects generated |
metadata | object | Metadata about the data generation process |
metadata.cost | number | The cost of the data generation request (calculated as $0.0005 per generated item) |
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 | DATA_GENERATION_ERROR | Ex: could not generate data | 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. |