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

NameTypeRequiredMaxDescription
askstringYes500The user input message
behaviorstringNo-Custom behavior instruction for the bot (defaults to 'You are a helpful AI assistant.')
historyarray of objectsNo15Previous conversation history between user and bot
history[].rolestringYes-The role of the message sender (user or bot)
history[].contentstringYes500The message content
contextarray of stringsNo25Additional context information that helps the bot generate better responses
context[]stringYes500Additional context information for response generation
languagestringNo-The language code for the bot response

Response

NameTypeDescription
dataobjectThe bot response data
data.responsestringThe bot response text
data.confidencenumberOptional confidence score for the response (0-1)
data.languagestringThe language code of the response
metadataobjectMetadata about the execution process
metadata.costnumberThe cost of the execution request

Errors

{
   "error": "string", 
   "code": "string"
}
HTTP StatusError CodeMessage
400INVALID_PAYLOADOccurs when the payload is invalid.
400INVALID_REQUESTEx.: The request is invalid.
400BOT_EXECUTOR_ERROREx: could not generate response | parsing error
400HARM_CONTENTEx.: The content is harmful and cannot be processed.
400INSUFFICIENT_BALANCEThe user has insufficient balance
400INPUT_TOO_LONGThe input text exceeds the maximum length
401UNAUTHORIZEDEx.: The token is invalid.
429TOO_MANY_REQUESTSEx.: The request limit has been reached.