Serverless AI Bot Executor
AI powered bot executor service that generates responses to user messages with conversation history and context support.
Endpoint
Generate conversational bot responses
POSThttps://api.xtartapp.com/bot/executor
*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 |
---|---|---|---|---|
ask | string | Yes | 500 | The user input message |
behavior | string | No | - | Custom behavior instruction for the bot (defaults to 'You are a helpful AI assistant.') |
history | array of objects | No | 15 | Previous conversation history between user and bot |
history[].role | string | Yes | - | The role of the message sender (user or bot) |
history[].content | string | Yes | 500 | The message content |
context | array of strings | No | 25 | Additional context information that helps the bot generate better responses |
context[] | string | Yes | 500 | Additional context information for response generation |
language | string | No | - | The language code for the bot response |
Response
Name | Type | Description |
---|---|---|
data | object | The bot response data |
data.response | string | The bot response text |
data.confidence | number | Optional confidence score for the response (0-1) |
data.language | string | The language code of the response |
metadata | object | Metadata about the execution process |
metadata.cost | number | The cost of the execution request |
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 | BOT_EXECUTOR_ERROR | Ex: could not generate response | parsing error |
400 | HARM_CONTENT | Ex.: The content is harmful and cannot be processed. |
400 | INSUFFICIENT_BALANCE | The user has insufficient balance |
400 | INPUT_TOO_LONG | The input text exceeds the maximum length |
401 | UNAUTHORIZED | Ex.: The token is invalid. |
429 | TOO_MANY_REQUESTS | Ex.: The request limit has been reached. |