Client
Create Index
POST
Create Index
Create a new encrypted index.
When RBAC is not enabled (
KMS-backed:
With auto-embedding:
Float16 storage for reduced footprint:
With per-field metadata policy:
There is a single index type. Configuration parameters (
dimension, metric, embedding_model, storage_precision) are top-level fields; the index_config object and the IVFFlat/IVFPQ/IVFSQ distinction from earlier versions no longer apply.Authentication
Required - admin (root) API key viaX-API-Key header. Per-user (cdbk_) keys are rejected with 403 — a per-user credential operates on data, not index lifecycle:
CYBORGDB_SERVICE_ROOT_KEY unset), no header is required.
Request Body
Key Management Modes
Exactly one ofindex_key / kms_name must be supplied:
- SDK-supplied KEK (set
index_key, omitkms_name) — the service records the index withprovider: none. The same key must be re-supplied on every subsequent request (load, query, upsert, etc.). - KMS-backed (set
kms_name, omitindex_key) — the service generates the KEK, wraps it under the named registry slot, and persists the envelope. Subsequent requests omitindex_keyentirely; the service resolves it from the index’s stored key envelope.
none provider is not addressable by name — omit kms_name to use the SDK-supplied path.)
Metadata Schema
metadata_schema sets the per-field indexing policy. Metadata itself stays schemaless — this controls how each field is indexed, not what may be stored. Three knobs per field:
filterable(defaulttrue) — index the field so filters on it resolve from the index (pre-filter, and the only path/v1/vectors/query_metadatauses).falsestill stores the field but forces the dense post-filter path when/v1/vectors/queryfilters reference it — cheaper writes, slower filtered queries.pattern(defaultfalse) — additionally build the field’s regex dictionary, needed for index-resolved$regex/$contains. Requiresfilterable: true.full_text(defaultfalse) — route the field through the BM25 analyzer for full-text search instead of exact-match indexing. Impliesfilterable: falseand is incompatible withpattern: true.
/v1/vectors/query the schema is a performance hint: filters that miss the index fall back to a post-filter over the decrypted metadata, same rows either way. On /v1/vectors/query_metadata it is enforced — $regex / $contains on a non-pattern field, or any filter on a filterable: false field, is rejected with 400.
The recorded policy is echoed back on POST /v1/indexes/describe under metadata_schema (empty object when the index uses the default posture).
Response
Exceptions
400 Bad Request
400 Bad Request
Index name already exists. Also raised for missing/conflicting key parameters (both
index_key and kms_name supplied, or neither), and for BM25 parameter violations: bm25_k1 / bm25_b supplied for an index with no full_text field, bm25_k1 < 0, bm25_b outside [0, 1], or a text_fields entry naming a field the schema sets full_text=false403 Forbidden
403 Forbidden
Authenticated with a per-user (
cdbk_) key — this operation requires the admin (root) API key422 Unprocessable Entity
422 Unprocessable Entity
Invalid request parameters — including
metadata_schema with pattern=true but filterable=false, full_text=true combined with pattern=true or an explicit filterable=true, an empty field name, or an empty text_fields entry500 Internal Server Error
500 Internal Server Error
Internal server error
502 Bad Gateway
502 Bad Gateway
KMS error (e.g. wrap operation failed)
Example Usage
Basic (SDK-supplied key):When
embedding_model is specified, dimension is optional — the server infers it from the model. The index will automatically generate embeddings for text content during upsert operations.