hosting
POST /v1/vector/indexes/{indexId}/query
Find the nearest vectors.
Autenticação
Envie uma chave de API como um token de portador. A chave deve ter a permissão vector.manage; uma chave sem ela é recusada com 403, e não 404.
Este endpoint não requer um ID de organização. Sua chave já identifica a organização à qual pertence, e a resposta é delimitada a ela.
Experimente
Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.
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[]> }'Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API
Detalhes
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.
Parâmetros
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
indexId (path) | string | Sim | The index's id. |
Corpo da requisição
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
values | number[] | Sim | The query vector — exactly `dimension` values. |
top_k | integer | Não | — |
filter | object | Não | Restrict 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… |
Resposta
| Nome | Tipo | Obrigatório | O que é |
|---|---|---|---|
matches | object[] | Sim | — |
Erros que este endpoint pode retornar
401 · 403 · 404 · 422 · 429