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

# Get consumption statistics for current month

> Get aggregated statistics for Emnify consumption data.

    Returns:
    - Total consumption (GB)
    - Average consumption per device (MB)
    - Number of devices exceeding limit (>100%)
    - Top 5 clients at risk (>80% of limit)
    - Month-over-month change (%)

    **Notes:**
    - Statistics calculated from current month data only
    - Only includes valid consumption records (excludes not_found entries)



## OpenAPI

````yaml /generated/specs/diagnostics.json get /api/v1/consumption/statistics
openapi: 3.0.0
info:
  title: Raul API - Diagnostico
  description: Health, consumo, conectividad, SIMs, webhooks fallidos y estados tecnicos.
  version: 2.0.0
  contact: {}
servers:
  - url: https://api.raul.ugps.io
    description: Production
security: []
tags: []
paths:
  /api/v1/consumption/statistics:
    get:
      tags:
        - Consumption
      summary: Get consumption statistics for current month
      description: |-
        Get aggregated statistics for Emnify consumption data.

            Returns:
            - Total consumption (GB)
            - Average consumption per device (MB)
            - Number of devices exceeding limit (>100%)
            - Top 5 clients at risk (>80% of limit)
            - Month-over-month change (%)

            **Notes:**
            - Statistics calculated from current month data only
            - Only includes valid consumption records (excludes not_found entries)
      operationId: ConsumptionController_getConsumptionStatistics
      parameters: []
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConsumptionStatisticsResponseDto'
        '500':
          description: ''
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/EmnifyErrorDto'
      security:
        - bearerAuth: []
components:
  schemas:
    ConsumptionStatisticsResponseDto:
      type: object
      properties:
        totalConsumption:
          type: number
          description: Consumo total en GB
          example: 125.5
        totalDownloadGb:
          type: number
          description: Total descarga (RX) en GB — datos recibidos por el dispositivo
          example: 20.3
        totalUploadGb:
          type: number
          description: >-
            Total subida (TX) en GB — datos enviados por el dispositivo
            (telemetría GPS)
          example: 105.2
        avgPerDevice:
          type: number
          description: Promedio de consumo por dispositivo en MB
          example: 850.3
        devicesOverLimit:
          type: number
          description: Cantidad de dispositivos que exceden el 100% del límite esperado
          example: 5
        topRiskClients:
          description: Top 5 clientes en riesgo (>80% del límite)
          type: array
          items:
            $ref: '#/components/schemas/TopRiskClientDto'
        monthOverMonth:
          type: number
          description: Porcentaje de cambio vs mes anterior (negativo = reducción)
          example: 12.5
        lastUpdated:
          type: string
          description: Fecha y hora de última actualización (ISO 8601)
          example: '2026-01-15T10:30:00Z'
      required:
        - totalConsumption
        - totalDownloadGb
        - totalUploadGb
        - avgPerDevice
        - devicesOverLimit
        - topRiskClients
        - monthOverMonth
        - lastUpdated
    EmnifyErrorDto:
      type: object
      properties:
        error:
          type: string
        message:
          type: string
        details:
          type: string
      required:
        - error
        - message
    TopRiskClientDto:
      type: object
      properties:
        clientId:
          type: number
          description: ID del cliente
          example: 1
        clientName:
          type: string
          description: Nombre del cliente
          example: Cliente ABC S.A.
        consumption:
          type: number
          description: Consumo actual en MB
          example: 1500.5
        expected:
          type: number
          description: Consumo esperado en MB
          example: 1000
        percentageUsed:
          type: number
          description: Porcentaje usado del límite esperado
          example: 150.05
      required:
        - clientId
        - clientName
        - consumption
        - expected
        - percentageUsed
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: Bearer token authentication

````