> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gp.scale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Vectors

> 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.



## OpenAPI

````yaml https://api.dev-sgp.scale.com/openapi-versions/v5/openapi.json post /v5/vector-stores/{vector_store_name}/count
openapi: 3.1.0
info:
  title: EGP API V5
  description: >-
    This is the parent API for all EGP APIs. If you are looking for the EGP API,
    please go to https://api.egp.scale.com/docs.
  contact:
    name: Scale Generative AI Platform
    url: https://scale.com/genai-platform
  version: 0.1.0
servers:
  - url: https://api.egp.scale.com
security: []
paths:
  /v5/vector-stores/{vector_store_name}/count:
    post:
      tags:
        - Vector Stores
      summary: Count Vectors
      description: >-
        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.
      operationId: POST-V5-/v5/vector-stores/vector_store_name/count
      parameters:
        - name: vector_store_name
          in: path
          required: true
          schema:
            type: string
            description: The name of the vector store
            title: Vector Store Name
          description: The name of the vector store
        - name: x-selected-account-id
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Account ID Header
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CountVectorsRequest'
              default: {}
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountVectorsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    CountVectorsRequest:
      properties:
        filter:
          title: Filter
          description: Metadata filter expression
          additionalProperties: true
          type: object
      type: object
      title: CountVectorsRequest
      description: Request to count documents.
    CountVectorsResponse:
      properties:
        count:
          type: integer
          title: Count
          description: Number of documents matching the criteria
      type: object
      required:
        - count
      title: CountVectorsResponse
      description: Response for count operation.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          title: Error Type
          type: string
        input:
          title: Input
        ctx:
          type: object
          title: Context
          additionalProperties: true
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````