OriginChainDB
Database endpoints

Create a vector index

Create a vector index for dense vectors, sparse vectors or text, with an empty default namespace.

POST /v1/tenants/{tenant}/vector-indexes

Define a vector index before loading recordsCreating the index starts an empty default namespace.
  1. Choose the representationsDefine dense vectors, sparse vectors or searchable text.
  2. Create the indexSet its name and supported configuration.
  3. Save the index IDAdd records through the record endpoints next.

Before you start

Use your database bearer token.

Connection setup

Choose a unique index name and the dimensions or text configuration your data needs. The example creates demo-search for three-dimensional vectors.

Path parameters

FieldTypeRequired
tenantstringRequired

Headers

FieldTypeRequiredDescription
x-oc-db-userstringOptionalActing database user (role, grant and row-policy checks). Send with x-oc-db-key.
x-oc-db-keystringOptionalAPI key of the x-oc-db-user user.

Request body

application/json

Limits and accepted values
  • name is 1-45 bytes of [a-z0-9-].
  • At least one of dimension, sparse: true or text_fields is required;
  • dimension 1-8192 needs metric (cosine, dot, l2, manhattan).
  • deletion_protection: enabled|disabled (default disabled);
  • identifier_profile: unicode|ascii (default unicode);
  • tags: string map, at most 20.
  • embedding is refused with 501 and metadata_publish with 400 (generated-embedding indexes are not available yet).
  • Unknown fields are refused with 400 unknown_request_field.
FieldTypeRequired
deletion_protectionstringOptional
dimensionintegerOptional
embeddingobjectOptional
identifier_profilestringOptional
metadata_publishstringOptional
metricstringOptional
namestringRequired
sparsebooleanOptional
tagsobjectOptional
text_fieldsobject[]Optional
Fields in text_fields
FieldTypeRequired
analyzerstringRequired
namestringRequired
FieldTypeRequired
visibility_fieldsstring[]Optional
Fields in visibility_fields
FieldTypeRequired
visibility_fieldsstringOptional

Read the result

Save index_id; the search route uses it. The response records the fixed dimensions and metric, and the index starts with an empty default namespace. Creating an index does not insert vectors.

Response statuses

HTTP status reference
StatusWhat to do
201Created
400Correct the request before retrying.
401Check the credential and Authorization header.
402Check feature access or available credits.
403Check tenant access, roles and permissions.
409Resolve the conflict before retrying.
413Split or reduce the request body.
415Send the required Content-Type.
422Correct the values or unsupported combination.
429Honor Retry-After when present; back off.
500Check the outcome before retrying a write.
501Check deployment support for this operation.
503Honor Retry-After when present; check write outcomes.
© 2026 Silicoyn Technologies Pvt Ltd