Chat API Request and Response

Our Chat API allows a user to have a conversation with your AskAI via a simple API call. The messages array should contain the conversation between the user and the AskAI (assistant). You can send the entire conversation within the API request. Each message object has a role (user or assistant) and content. In the example below you can see a short conversation between a user and an AskAI. The message from the user has the role: user and all replies from the AskAI have the role: assistant.

If your AskAI doesn't know the answer, the API will also return an additional field to confirm an answer wasn't found as well as 3 suggested questions the user can retry (these have a very high likelihood of being answered correctly):

"unknown_answer": "yes",

"suggestedQuestions": ["Example question", ...]

The query field has a 750 character limit. If this is exceeded, you will see an error: {"error":"This question is too long. Please ensure questions are less than 750 characters."}

Last updated