Skip to main content
POST
Query Vectors (Binary)
Search for nearest neighbors in the encrypted index using binary-encoded query vectors for more efficient transfer of large batch queries.

Authentication

Required - API key via X-API-Key header:
Any valid credential is accepted — the root key or a per-user cdbk_ token. When RBAC is not enabled (CYBORGDB_SERVICE_ROOT_KEY unset), no header is required.

Request Body

Hybrid queries accept fewer filters than pure vector queries. Filtering on a full_text or filterable: false field, or using $regex/$contains on a non-pattern field, works in a pure query but is rejected with 400 when text is set. See the query endpoint for details.
All leg combinations from the standard query endpoint work here too, including the three-way form (query_vectors + text + filters) — see Combining search legs.

Response

The response format is the same as the standard query endpoint. When text is set, each result carries a score (fused BM25 + vector relevance, higher = more relevant) instead of distance:

Exceptions

Invalid values (e.g. vector dimension mismatch with the index), or a filter disallowed on a hybrid (text) query
Authentication failed (invalid API key) or wrong index_key on SDK-supplied indexes — see error model
Index not found
Request body failed validation (missing/mistyped fields)
Internal server error

Example Usage

The binary format is more efficient than the standard JSON query for large batch queries, as it avoids the overhead of encoding each float as a JSON number. The SDK clients automatically use this format when query vectors are passed as typed arrays (e.g., np.ndarray in Python, Float32Array in JS/TS).