> ## 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 Project Stats

> Get statistics for a specific project with optional filtering

Retrieve statistics for a specific project. This endpoint provides counts for users and API keys within the specified project.

### Headers

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

### Path Parameters

<ParamField path="project_id" type="string" required>
  Project unique identifier (UUID format)
</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>

### Response

<ResponseField name="users" type="object" required>
  User statistics for the project

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

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

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

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

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

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

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

<ResponseExample>
  ```json 200 theme={null}
  {
    "users": {
      "total": 45,
      "active": 38
    },
    "api_keys": {
      "total": 3,
      "active": 2
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml GET /api/v1/projects/{project_id}/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/{project_id}/stats:
    get:
      tags:
        - Project Management
      summary: Get Project Stats
      description: Get statistics for a specific project with optional filtering
      operationId: get_project_stats_api_v1_projects__project_id__stats_get
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - 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
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProjectStatsResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - OAuth2PasswordBearer: []
components:
  schemas:
    ProjectStatsResponse:
      properties:
        users:
          $ref: '#/components/schemas/CountStats'
        api_keys:
          $ref: '#/components/schemas/CountStats'
      type: object
      required:
        - users
        - api_keys
      title: ProjectStatsResponse
      description: Statistics for a specific project
    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

````