# Chat with the knowledge base

> Answers the last message of a conversation from the organization's knowledge, optionally limited to some topics or decisions.

```json
{
  "/ai/chat": {
    "post": {
      "tags": [
        "AI"
      ],
      "summary": "Chat with the knowledge base",
      "operationId": "createAiChat",
      "description": "Answers the last message of a conversation from the organization's knowledge, optionally limited to some topics or decisions.",
      "security": [
        {
          "bearerAuth": []
        }
      ],
      "responses": {
        "201": {
          "description": "Created successfully"
        },
        "400": {
          "description": "Invalid request",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Error"
              }
            }
          }
        },
        "401": {
          "description": "Unauthorized",
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Error"
              }
            }
          },
          "headers": {
            "WWW-Authenticate": {
              "$ref": "#/components/headers/WWWAuthenticate"
            }
          }
        },
        "429": {
          "$ref": "#/components/responses/TooManyRequests"
        }
      }
    }
  }
}
```
