API
Using the Adapt API for Chat
Chat Interaction Endpoint
Overview
The Chat Interaction endpoint is designed to handle natural language queries and return the Adapt bot's responses. This provides developers with the tools to integrate the Adapt Chat into other services.
HTTP Request
POST https://api.adaptbot.io/chat
Headers
To authenticate the request, include the following headers:
botid: A unique identifier for your bot.botsecret: A secret key for authentication purposes.
Request Body
Send a JSON object with the user's query as shown below:
{
"message": "Your query here"
}Example Request
Here is an example of how to structure your POST request:
Example Response
Upon a successful request, the API will return a JSON object containing the status, the bot's response, the number of tokens used in generating the response, and the model used.
Response Schema
status: Indicates whether the request was successful.response: An object containing the following fields:message: The bot's reply to the user's query.tokens: The number of tokens used to generate the response.model: The model version used for generating the response.
Last updated