BVector
API Reference
BVector exposes a JSON REST API over HTTP. All endpoints require a Bearer token in the Authorization header.
Base URL
http://<your-instance>:18080/api/v1
Endpoints
GET
/indexesPOST
/indexesGET
/indexes/:nameDELETE
/indexes/:namePOST
/indexes/:name/vectorsGET
/indexes/:name/vectors/:idDELETE
/indexes/:name/vectors/:idPOST
/indexes/:name/queryGET
/healthCreate index
POST /api/v1/indexes
Authorization: Bearer <api-key>
Content-Type: application/json
{
"name": "my-index",
"dimension": 1536,
"metric": "cosine"
}
// 201 Created
{
"id": "idx_01HXYZ",
"name": "my-index",
"dimension": 1536,
"metric": "cosine",
"createdAt": "2024-01-15T10:30:00Z"
}Upsert vectors
POST /api/v1/indexes/my-index/vectors
Authorization: Bearer <api-key>
Content-Type: application/json
{
"vectors": [
{
"id": "doc-001",
"values": [0.12, -0.45, 0.89, ...],
"metadata": {
"source": "wikipedia",
"title": "Machine Learning"
}
}
]
}
// 200 OK
{ "upserted": 1 }Query nearest neighbors
POST /api/v1/indexes/my-index/query
Authorization: Bearer <api-key>
Content-Type: application/json
{
"vector": [0.12, -0.45, 0.89, ...],
"topK": 5,
"includeMetadata": true,
"filter": { "source": "wikipedia" }
}
// 200 OK
{
"matches": [
{
"id": "doc-001",
"score": 0.9823,
"metadata": { "source": "wikipedia", "title": "Machine Learning" }
}
]
}