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

# Get traffic stats

> Traffic and policy stats with a plain-text summary. Results are computed from the most recent 5,000 events in the period.

**Required permission:** `observe:read`




## OpenAPI

````yaml /api-reference/openapi.yaml get /api/v1/observe/stats
openapi: 3.1.0
info:
  title: Igris Management API
  version: '1'
  description: >-
    REST API for managing Igris connections, policies, sessions, audit events
    and alerts.
servers:
  - url: https://api.igrisecurity.com
security:
  - bearerAuth: []
tags:
  - name: Connections
  - name: Policies
  - name: Sessions
  - name: Audit Events
  - name: Incidents
  - name: Webhooks
  - name: API Keys
  - name: Members
  - name: LLM Providers
  - name: LLM Cost
  - name: Observe
paths:
  /api/v1/observe/stats:
    get:
      tags:
        - Observe
      summary: Get traffic stats
      description: >
        Traffic and policy stats with a plain-text summary. Results are computed
        from the most recent 5,000 events in the period.


        **Required permission:** `observe:read`
      operationId: getObserveStats
      parameters:
        - $ref: '#/components/parameters/PeriodParam'
      responses:
        '200':
          description: The stats.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      stats:
                        $ref: '#/components/schemas/ObserveStats'
                      summary:
                        type: string
                      period:
                        type: string
                      dateRange:
                        $ref: '#/components/schemas/DateRange'
              example:
                data:
                  stats:
                    llmCalls: 0
                    mcpToolCalls: 0
                    piiRedactions: 0
                    injectionsBlocked: 0
                    anomalies: 0
                    policyDenials: 0
                    totalCostCents: 0
                    totalTokensIn: 0
                    totalTokensOut: 0
                    byProvider: {}
                    byModel: {}
                    highestSeverity: null
                  summary: No AI activity recorded during the past 24 hours.
                  period: day
                  dateRange:
                    start: '2026-01-07'
                    end: '2026-01-08'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '403':
          $ref: '#/components/responses/Forbidden'
components:
  parameters:
    PeriodParam:
      name: period
      in: query
      schema:
        $ref: '#/components/schemas/Period'
  schemas:
    ObserveStats:
      type: object
      properties:
        llmCalls:
          type: integer
        mcpToolCalls:
          type: integer
        piiRedactions:
          type: integer
        injectionsBlocked:
          type: integer
        anomalies:
          type: integer
        policyDenials:
          type: integer
        totalCostCents:
          type: number
        totalTokensIn:
          type: integer
        totalTokensOut:
          type: integer
        byProvider:
          type: object
          additionalProperties:
            type: integer
          description: Event count per provider.
        byModel:
          type: object
          additionalProperties:
            type: integer
          description: Event count per model.
        highestSeverity:
          type:
            - string
            - 'null'
    DateRange:
      type: object
      properties:
        start:
          type: string
          format: date
        end:
          type: string
          format: date
    Period:
      type: string
      enum:
        - day
        - week
        - month
      default: week
      description: >-
        `day` is 24 hours, `week` 7 days, `month` 30 days. Any other value is
        treated as `week`.
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: string
    ForbiddenError:
      type: object
      properties:
        error:
          type: string
          example: Forbidden
        required:
          type: string
          description: The permission the caller lacks.
          example: policies:write
  responses:
    Unauthorized:
      description: No valid session or API key, or the key's creator is no longer a member.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
          example:
            error: Unauthorized
    Forbidden:
      description: The caller lacks the required permission.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ForbiddenError'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: ig_...
      description: >-
        An Igris API key. It acts with the current role and permission overrides
        of the member who created it.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.