Skip to content

Count Vectors

POST/v5/vector-stores/{vector_store_name}/count

Count documents in a vector store, optionally filtered by metadata.

Use Cases:

  • Monitor vector store size and growth over time
  • Preview the number of documents matching a filter before deletion
  • Validate data ingestion by comparing expected versus actual document counts
  • Analyze document distribution across metadata categories

Filtering: Apply the same metadata filter syntax as delete and list operations. Only indexed fields can be used for filtering. An empty filter counts all documents in the store.

Path ParametersExpand Collapse
vector_store_name: string

The name of the vector store

Body ParametersJSONExpand Collapse
filter: optional map[unknown]

Metadata filter expression

ReturnsExpand Collapse
count: number

Number of documents matching the criteria

Count Vectors

curl https://api.egp.scale.com/v5/vector-stores/$VECTOR_STORE_NAME/count \
    -X POST \
    -H "x-api-key: $SGP_API_KEY"
{
  "count": 0
}
Returns Examples
{
  "count": 0
}