Skip to main content
POST

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

DRF serializer mixin providing content_type and attribute fields.

Compose into any request serializer via multiple inheritance::

query
string
required

Natural-language question. Maximum 1500 characters.

Maximum string length: 1500
content_type
string[]

Filter by content type path. Multiple values are OR. Exact-or-subtree matching by default (e.g. legal matches legal, legal:contract). Wildcards: *contract* (contains), legal:contract* (prefix).

attribute
string[]

Filter by attribute value. Repeated attribute entries are ANDed; values inside one entry are ORed with | (pipe is the recommended OR delimiter — comma also works but can be ambiguous with multi-key values). Example: attribute=fiscal_year:2024|2025&attribute=status:active → (fiscal_year 2024 OR 2025) AND (status active). Formats: name (has any value), name:value (exact), name:>value / name:>=value (gt/gte), name:<value / name:<=value (lt/lte), name:prefix* (starts with, case-insensitive), name:*text* (contains, case-insensitive), name:a|b (OR). Smart dates: filing_date:2023 (year), filing_date:2023-06 (month). Type-aware: booleans (true/false), multi-select (membership check). Scoped: content_type(legal:compliance).regulation:AML.

max_results
integer
default:10

Maximum number of chunks to retrieve for context. Range: 1–50.

Required range: 1 <= x <= 50
workspace_id
integer[]

Restrict search to these workspace IDs. Cannot combine with file_id.

tag_id
integer[]

Restrict to documents carrying any of these tag IDs (OR). Cannot combine with file_id.

file_id
integer[]

Restrict to specific file IDs. Cannot combine with workspace_id or tag_id.

relevance_scoring
enum<string>
default:scoring_and_filtering

Controls the relevance scoring step used during retrieval. "none": Skip scoring — lowest latency, relevance score is null in each result. "scoring_only": Score every candidate but return them all. Omit for the default (score and filter).

  • none - none
  • scoring_only - scoring_only
  • scoring_and_filtering - scoring_and_filtering
Available options:
none,
scoring_only,
scoring_and_filtering
stream
boolean
default:false

When true, response is streamed as Server-Sent Events.

model
string
default:mistral-large-latest

LLM used for answer generation. Standard values:

  • mistral-large-latest: Mistral Large 2 — flagship general-purpose model. Best answer quality (default).
  • alfred-ft5: Alfred FT5 — LightOn fine-tuned model, lighter and faster for straightforward questions. Custom model technical names (e.g. custom-{company_id}-{uuid}) are also accepted.

Response

Synchronous mode (stream=false): complete answer with sources.

Streaming mode (stream=true): Server-Sent Events with event: sources, event: token, and event: done (or event: error).

results
object[]
required

Retrieved chunks used as context, ordered by relevance score descending.

answer
string
required

LLM-generated answer grounded in the retrieved results.