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

# Get usage statistics

> Returns usage statistics for the supplied date range. The `mcp_usage_count` field counts successful MCP usage records and is filtered by `start_date` and `end_date`, while `database_size_bytes`, `storage_size_bytes`, and `user_count` reflect the current system state. Both `start_date` and `end_date` are required.




## OpenAPI

````yaml https://raw.githubusercontent.com/InsForge/InsForge/main/openapi/usage.yaml get /api/usage/stats
openapi: 3.0.3
info:
  title: Insforge Usage API
  version: 1.0.0
  description: MCP usage tracking and usage statistics for the backend usage module.
servers: []
security: []
tags:
  - name: Usage
    description: Record MCP tool usage and fetch usage summaries.
paths:
  /api/usage/stats:
    get:
      tags:
        - Usage
      summary: Get usage statistics
      description: >
        Returns usage statistics for the supplied date range. The
        `mcp_usage_count` field counts successful MCP usage records and is
        filtered by `start_date` and `end_date`, while `database_size_bytes`,
        `storage_size_bytes`, and `user_count` reflect the current system state.
        Both `start_date` and `end_date` are required.
      parameters:
        - name: start_date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: Start date, inclusive.
          example: '2026-07-01'
        - name: end_date
          in: query
          required: true
          schema:
            type: string
            format: date
          description: End date, exclusive.
          example: '2026-08-01'
      responses:
        '200':
          description: Usage statistics
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UsageStats'
              example:
                mcp_usage_count: 128
                database_size_bytes: 2147483648
                storage_size_bytes: 1073741824
                user_count: 42
        '400':
          description: Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INVALID_INPUT
                message: start_date and end_date are required
                statusCode: 400
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: AUTH_INVALID_CREDENTIALS
                message: No authorization token provided
                statusCode: 401
        '403':
          description: >-
            Forbidden - the cloud backend token is valid but not authorized for
            the configured project
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: AUTH_UNAUTHORIZED
                message: Project ID mismatch
                statusCode: 403
        '500':
          description: Failed to get usage stats
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                error: INTERNAL_ERROR
                message: Failed to get usage stats
                statusCode: 500
      security:
        - cloudBackendAuth: []
components:
  schemas:
    UsageStats:
      type: object
      required:
        - mcp_usage_count
        - database_size_bytes
        - storage_size_bytes
        - user_count
      properties:
        mcp_usage_count:
          type: integer
        database_size_bytes:
          type: integer
        storage_size_bytes:
          type: integer
        user_count:
          type: integer
    ErrorResponse:
      type: object
      required:
        - error
        - message
        - statusCode
      properties:
        error:
          type: string
        message:
          type: string
        statusCode:
          type: integer
        nextActions:
          type: string
  securitySchemes:
    cloudBackendAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer token issued by InsForge Cloud and verified by the backend cloud
        token verifier.

````