Database endpoints
Store a vector
Stores one dense vector, with optional metadata, in a vector collection.
POST /v1/tenants/{tenant}/vector/{table}/put
- Prepare the numeric vectorMatch its component count to the collection dimension.
- Assign an ID and metadataKeep a link to the source item.
- Store it in the collectionUse matching metric and index settings.
Before you start
Use your database bearer token.
Use a collection with the intended dimension and distance metric. The example uses three-dimensional vectors and cosine distance; use real embeddings for meaningful search.
Path parameters
| Field | Type | Required |
|---|---|---|
tenant | string | Required |
table | string | Required |
Headers
| Field | Type | Required | Description |
|---|---|---|---|
x-oc-db-user | string | Optional | Acting database user (role, grant and row-policy checks). Send with x-oc-db-key. |
x-oc-db-key | string | Optional | API key of the x-oc-db-user user. |
Request body
application/json
Limits and accepted values
- metric: cosine | dot | l2 | manhattan (alias l1), defaulting to the collection's declared distance, else cosine;
- quantization: none | scalar | binary;
- index: hnsw (default) | ivf | ivf_pq (IVF needs installed centroids).
- `embedding` must have `dim` components.
- Success is 201 with an empty body.
| Field | Type | Required |
|---|---|---|
dim | integer | Required |
embedder | string | Optional |
embedding | number[] | Required |
Fields in embedding
| Field | Type | Required |
|---|---|---|
embedding | number | Optional |
| Field | Type | Required |
|---|---|---|
id | string | Required |
index | string | Optional |
metadata | object | Optional |
metric | string | Optional |
quantization | string | Optional |
Read the result
Success is 201 with an empty body. The vector must contain exactly dim numeric components; indexing an embedding is separate from generating one from text.
Response statuses
HTTP status reference
| Status | What to do |
|---|---|
| 201 | Created |
| 400 | Correct the request before retrying. |
| 401 | Check the credential and Authorization header. |
| 402 | Check feature access or available credits. |
| 403 | Check tenant access, roles and permissions. |
| 409 | Resolve the conflict before retrying. |
| 413 | Split or reduce the request body. |
| 415 | Send the required Content-Type. |
| 422 | Correct the values or unsupported combination. |
| 429 | Honor Retry-After when present; back off. |
| 500 | Check the outcome before retrying a write. |
| 503 | Honor Retry-After when present; check write outcomes. |