Skip to main content

Chat API

Ask questions about your knowledge base using an AI agent with optional filtering to focus the search context.

POST /api/v1/chat

Authentication: Project API Key from https://platform.useskald.com Request (using Project API Key):
{
    "query": "What were the main points discussed in the Q1 meeting?",
    "stream": false,
    "filters": [
        {
            "field": "source",
            "operator": "eq",
            "value": "meeting-notes",
            "filter_type": "native_field"
        },
        {
            "field": "tags",
            "operator": "in",
            "value": ["q1", "meeting"],
            "filter_type": "native_field"
        }
    ]
}
Request (using Token Authentication):
{
    "query": "What were the main points discussed in the Q1 meeting?",
    "project_id": "project-uuid",
    "stream": false,
    "filters": [
        {
            "field": "category",
            "operator": "eq",
            "value": "meeting",
            "filter_type": "custom_metadata"
        }
    ]
}
Parameters:
  • query (string, required): The question to ask
  • project_id (UUID, optional): Only required when using Token Authentication
  • stream (boolean, optional): Enable streaming responses (default: false)
  • filters (array of filter objects, optional): Filters to narrow the search context. See Filters for detailed documentation.
Filter Support: Filters are applied during the initial retrieval of relevant context, allowing you to:
  • Filter by a “workspace” or “team” ID from your side
  • Focus the chat on specific sources (e.g., only Notion docs)
  • Query only memos with certain tags
  • Exclude certain categories of content
See Filters for complete documentation on filter structure, operators, and examples. Response (Non-streaming):
{
    "ok": true,
    "response": "The main points discussed in the Q1 meeting were:\n1. Revenue targets [[1]]\n2. Hiring plans [[2]]\n3. Product roadmap [[1]][[3]]",
    "intermediate_steps": []
}
Response (Streaming): When stream: true, returns Server-Sent Events:
Content-Type: text/event-stream

: ping

data: {"type": "token", "content": "The"}

data: {"type": "token", "content": " main"}

data: {"type": "done"}

Error Responses

Missing query (400):
{
    "error": "Query is required"
}
Invalid filters (400):
{
    "error": "Filters must be a list"
}
Invalid filter structure (400):
{
    "error": "Invalid filter: <specific error message>"
}
Agent error (500):
{
    "error": "Agent error: <error details>"
}
Citation Format: Responses include inline citations in the format [[N]] where N is the result number from the retrieved context.
I