GenGuardX API
Chat API
Send a message to the GenGuardX website assistant and receive its response. The machine-readable API description is available as OpenAPI 3.1.
Request
POST https://genguardx.ai/api/chat with a JSON body and a Referer header.
{
"user_message": "How does GenGuardX evaluate AI agents?",
"session_id": "optional-session-id",
"user_id": "optional-visitor-id",
"history": [],
"context": {}
} user_message is required. Session, visitor, conversation history, and context fields are optional.
Request fields
user_message(string, required): the visitor's question. It must contain at least one character.session_id(string, optional): identifies the conversation. Send the value returned by the previous response to continue the same conversation. Defaults tosession_001.user_id(string, optional): identifies the visitor. Defaults tovisitor_001.history(array, optional): earlier turns of the conversation, each an object with aroleand acontentstring.context(object, optional): extra key-value pairs passed to the assistant. Values are converted to strings. Asource_page_urlkey records the page the question came from; without it, the Referer header is used.
Response
{
"response": "...",
"session_id": "...",
"user_id": "...",
"turn_count": "1"
} Response fields
response(string): the assistant's answer.session_idanduser_id(strings): the identifiers for this conversation and visitor. Reuse them on the next request.turn_count(string): how many turns the conversation has had so far.
Errors
- 422: the request failed validation, for example an empty or missing
user_message, a malformedhistoryentry, or a missing Referer header. - 500: the assistant could not answer. The body reads
Chat request failed. Please try again later.Retry after a short wait.
What is stored
Each turn is stored with its question, answer, timestamp, response time and source page, so the GenGuardX team can review how the assistant performs. Do not send personal or confidential information you would not want kept. See the privacy policy and AI policy for how this data is handled.