v1

latestOpenAPI 3.0.3BSL2026-07-17133415718.8 KB
Chunk

Count chunks above threshold

This route can be used to determine the number of chunk results that match a search query including score threshold and filters. It may be high latency for large limits. There is a dataset configuration imposed restriction on the maximum limit value (default 10,000) which is used to prevent DDOS attacks. Auth'ed user or api key must have an admin or owner role for the specified dataset's organization.

post/api/chunk/count

Headers

TR-Datasetstring uuid required

The dataset id or tracking_id to use for the request. We assume you intend to use an id if the value is a valid uuid.

Request body

limitinteger nullable

Set limit to restrict the maximum number of chunks to count. This is useful for when you want to reduce the latency of the count operation. By default the limit will be the number of chunks in the dataset.

score_thresholdnumber float nullable

Set score_threshold to a float to filter out chunks with a score below the threshold. This threshold applies before weight and bias modifications. If not specified, this defaults to 0.0.

search_type'fulltext' | 'semantic' | 'bm25' required
use_quote_negated_termsboolean nullable

If true, quoted and - prefixed words will be parsed from the queries and used as required and negated words respectively. Default is false.

Example request

{
  "query": "Some search query",
  "score_threshold": 0.5,
  "search_type": "semantic"
}

Response

Number of chunks satisfying the query

countinteger required