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

# Get Agent Stats

> Get statistics for an agent.



## OpenAPI

````yaml /api-reference/openapi-developer.json get /api/v1/proxy/agent/{agent_id}/stats
openapi: 3.1.0
info:
  title: PromptGuard Developer API
  description: >-
    Public API for developers to integrate PromptGuard security into their
    applications
  version: 1.0.0
servers:
  - url: https://api.promptguard.dev
    description: Production API
  - url: https://staging-api.promptguard.dev
    description: Staging API
  - url: http://localhost:8080
    description: Local Development
security:
  - ApiKeyAuth: []
paths:
  /api/v1/proxy/agent/{agent_id}/stats:
    get:
      tags:
        - agent
      summary: Get Agent Stats
      description: Get statistics for an agent.
      operationId: get_agent_stats_api_v1_proxy_agent__agent_id__stats_get
      parameters:
        - name: agent_id
          in: path
          required: true
          schema:
            type: string
            title: Agent Id
        - name: x-api-key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AgentStats'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    AgentStats:
      properties:
        agent_id:
          type: string
          title: Agent Id
        total_tool_calls:
          type: integer
          title: Total Tool Calls
        blocked_calls:
          type: integer
          title: Blocked Calls
        avg_risk_score:
          type: number
          title: Avg Risk Score
        active_sessions:
          type: integer
          title: Active Sessions
        anomalies_detected:
          type: integer
          title: Anomalies Detected
      type: object
      required:
        - agent_id
        - total_tool_calls
        - blocked_calls
        - avg_risk_score
        - active_sessions
        - anomalies_detected
      title: AgentStats
      description: Statistics for an agent
    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:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: >-
        PromptGuard API key for developer endpoints. Keys start with pg_live_
        and are created in the dashboard.

````