hosting

POST /v1/vector/indexes/{indexId}/query

Find the nearest vectors.

Tutti gli endpoint hosting

Autenticazione

Invia una chiave API come token di tipo bearer. La chiave deve disporre dell'autorizzazione vector.manage; una chiave sprovvista di tale autorizzazione viene rifiutata con 403 anziché 404.

Questo endpoint non richiede alcun ID organizzazione. La tua chiave identifica già l'organizzazione a cui appartiene e la risposta è limitata ad essa.

Provalo

Sostituisci qualsiasi elemento tra parentesi angolari con i tuoi valori e il segnaposto key con una chiave dalla tua dashboard.

curl -X POST https://api.zinndigital.com/v1/vector/indexes/{indexId}/query \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "values": <number[]> }'

Hai effettuato l'accesso? La console API nella tua dashboard inserisce il tuo ID organizzazione reale e la tua chiave personale, ed esegue la richiesta sull'API live in modo da poter vedere la risposta effettiva. Apri questo endpoint nella console API

Dettagli

Returns the `top_k` nearest vectors, nearest first, optionally restricted to those whose metadata contains `filter`. `distance` is in the index's own metric, so smaller is always nearer whichever metric you chose. ⛔ A query **spends the plan's monthly query allowance**, which is why it requires `vector.manage` rather than `vector.view` — a read that costs money is not a read.

Parametri

NomeTipoObbligatorioChe cos'è
indexId (path)stringThe index's id.

Corpo della richiesta

NomeTipoObbligatorioChe cos'è
valuesnumber[]The query vector — exactly `dimension` values.
top_kintegerNo
filterobjectNoRestrict the search to vectors whose metadata contains these keys and values. Containment, not equality of the whole object, so a filter naming one key matches a vector carrying…

Risposta

NomeTipoObbligatorioChe cos'è
matchesobject[]

Errori che questo endpoint può restituire

401 · 403 · 404 · 422 · 429