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

# Get Global Stats

> Get global statistics for all developer's projects with optional filtering

Retrieve global statistics across all projects belonging to the authenticated developer. This endpoint provides aggregate counts for projects, users, and API keys.

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Query Parameters

<ParamField query="search" type="string">
  Optional search term to filter statistics
</ParamField>

<ParamField query="is_active" type="boolean">
  Filter by active status
</ParamField>

<ParamField query="project_id" type="string">
  Filter statistics for a specific project (UUID format)
</ParamField>

### Response

<ResponseField name="projects" type="object" required>
  Project statistics

  <Expandable title="Count Stats">
    <ResponseField name="total" type="integer" required>
      Total number of projects
    </ResponseField>

    <ResponseField name="active" type="integer" required>
      Number of active projects
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="users" type="object" required>
  User statistics across all projects

  <Expandable title="Count Stats">
    <ResponseField name="total" type="integer" required>
      Total number of end users
    </ResponseField>

    <ResponseField name="active" type="integer" required>
      Number of active end users
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="api_keys" type="object" required>
  API key statistics

  <Expandable title="Count Stats">
    <ResponseField name="total" type="integer" required>
      Total number of API keys
    </ResponseField>

    <ResponseField name="active" type="integer" required>
      Number of active API keys
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X GET "https://api.devkit4ai.com/api/v1/projects/stats" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```bash cURL with filters theme={null}
  curl -X GET "https://api.devkit4ai.com/api/v1/projects/stats?is_active=true" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "projects": {
      "total": 5,
      "active": 4
    },
    "users": {
      "total": 150,
      "active": 120
    },
    "api_keys": {
      "total": 10,
      "active": 8
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /api/v1/projects/stats
openapi: 3.1.0
info:
  title: Dev Kit for AI API
  description: 'API for Dev Kit for AI: Developer Toolkit for AI-Powered Web Applications'
  version: 1.6.1
servers:
  - url: https://api.devkit4ai.com
    description: Dev Kit for AI Production Server
  - url: https://api.vibecoding.ad
    description: Vibe Coding Production Server
security: []
paths:
  /api/v1/projects/stats:
    get:
      tags:
        - Project Management
      summary: Get Global Stats
      description: >-
        Get global statistics for all developer's projects with optional
        filtering
      operationId: get_global_stats_api_v1_projects_stats_get
      parameters:
        - name: search
          in: query
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Search
        - name: is_active
          in: query
          required: false
          schema:
            anyOf:
              - type: boolean
              - type: 'null'
            title: Is Active
        - name: project_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Project Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GlobalStatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    GlobalStatsResponse:
      properties:
        projects:
          $ref: '#/components/schemas/CountStats'
        users:
          $ref: '#/components/schemas/CountStats'
        api_keys:
          $ref: '#/components/schemas/CountStats'
      type: object
      required:
        - projects
        - users
        - api_keys
      title: GlobalStatsResponse
      description: Global statistics for all developer's projects
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CountStats:
      properties:
        total:
          type: integer
          title: Total
        active:
          type: integer
          title: Active
      type: object
      required:
        - total
        - active
      title: CountStats
      description: Nested count statistics
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    OAuth2PasswordBearer:
      type: oauth2
      flows:
        password:
          scopes: {}
          tokenUrl: auth/login

````