BrainUs LogoBrainUs AI
Developer API

Query Knowledge Base

Send a query to retrieve AI-generated answers from your knowledge base with citations

POST
/api/v1/dev/query

Authorization

ApiKeyAuth
X-API-Key<token>

API key for authentication. Get yours from the Developer Dashboard.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://api.brainus.lk/api/v1/dev/query" \  -H "Content-Type: application/json" \  -d '{    "query": "What is photosynthesis?",    "store_id": "default"  }'
{
  "answer": "Photosynthesis is the process by which plants convert light energy into chemical energy...",
  "has_citations": true,
  "citations": [
    {
      "document_id": "string",
      "chunk_id": "string",
      "text": "string",
      "score": 0,
      "metadata": {}
    }
  ]
}
Empty
Empty