POST
/
v1
/
vectors
/
num_vectors
Get the number of vectors stored in an encrypted index.

Authentication

Required - API key via X-API-Key header:
X-API-Key: cyborg_your_api_key_here
You can get an API key from the CyborgDB Admin Dashboard. For more info, follow this guide.

Request Body

{
  "index_name": "my_index",
  "index_key": "64_character_hex_string_representing_32_bytes"
}

Response

{
  "status": "success",
  "message": "1500 vectors in index 'my_index'"
}

Exceptions

  • 401: Authentication failed (invalid API key)
  • 404: Index not found
  • 422: Invalid request parameters
  • 500: Internal server error

Example Usage

# Get vector count
count=$(curl -s -X POST "http://localhost:8000/v1/vectors/num_vectors" \
     -H "X-API-Key: cyborg_your_api_key_here" \
     -H "Content-Type: application/json" \
     -d '{
       "index_name": "my_index",
       "index_key": "your_64_character_hex_key_here"
     }' | jq -r '.message')

echo "Index contains $count vectors"