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

# Get Miner Stats

> Returns aggregate miner classification counts for a farm: total, by_type (healthy / abnormal / sleep / stale; online = healthy + abnormal + sleep), abnormal subtypes with co-occurrence (by_abnormal_type[type].count + also_has), and mining-mode / model distributions.
Use this to answer "how many miners are abnormal / of each anomaly type / sleeping" without paging the full list.
To list the miners behind any count, call List Miners with the predicate below. Each predicate reproduces the matching count exactly. Every bucket except `stale` is scoped online via status_exclude=stale:
- healthy: status_exclude=stale & has_anomaly=false & mining_modes_not_in=sleep
- abnormal: status_exclude=stale & has_anomaly=true
- sleep: status_exclude=stale & has_anomaly=false & mining_modes_in=sleep
- stale: status=stale
- abnormal subtype <type> (each key of by_abnormal_type: fan, power, temperature, hashboard, network, firmware, unknown, control_board, pool, low_hashrate): status_exclude=stale & anomaly_filters=<type>



## OpenAPI

````yaml /api-reference/openapi.json get /private-api/v1/{workspace_id}/farms/{farm_id}/miners/stats
openapi: 3.1.0
info:
  title: Nonce Private API
  description: |-
    Nonce Private API documentation - Internal endpoints for system integration

    Generated by NestJS Swagger Module with nestjs-zod
    Scope: Private API endpoints only (/private-api/*)
    Do not edit this file manually - regenerate with: pnpm run docs:openapi
  version: 1.0.0
  contact: {}
servers:
  - url: https://api.nonce.app
    description: Production server
security: []
tags: []
paths:
  /private-api/v1/{workspace_id}/farms/{farm_id}/miners/stats:
    get:
      tags:
        - Private API
        - Farm
      summary: Get Miner Stats
      description: >-
        Returns aggregate miner classification counts for a farm: total, by_type
        (healthy / abnormal / sleep / stale; online = healthy + abnormal +
        sleep), abnormal subtypes with co-occurrence
        (by_abnormal_type[type].count + also_has), and mining-mode / model
        distributions.

        Use this to answer "how many miners are abnormal / of each anomaly type
        / sleeping" without paging the full list.

        To list the miners behind any count, call List Miners with the predicate
        below. Each predicate reproduces the matching count exactly. Every
        bucket except `stale` is scoped online via status_exclude=stale:

        - healthy: status_exclude=stale & has_anomaly=false &
        mining_modes_not_in=sleep

        - abnormal: status_exclude=stale & has_anomaly=true

        - sleep: status_exclude=stale & has_anomaly=false &
        mining_modes_in=sleep

        - stale: status=stale

        - abnormal subtype <type> (each key of by_abnormal_type: fan, power,
        temperature, hashboard, network, firmware, unknown, control_board, pool,
        low_hashrate): status_exclude=stale & anomaly_filters=<type>
      operationId: GetMinerStats
      parameters:
        - name: workspace_id
          required: true
          in: path
          schema:
            type: string
        - name: farm_id
          required: true
          in: path
          schema:
            type: string
      responses:
        '200':
          description: Successfully retrieved miner stats
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                    description: Indicates if the request was successful
                  data:
                    type: object
                    properties:
                      theo:
                        type:
                          - number
                          - 'null'
                      total:
                        type: number
                      by_type:
                        type: object
                        properties:
                          healthy:
                            type: number
                          abnormal:
                            type: number
                          sleep:
                            type: number
                          stale:
                            type: number
                        required:
                          - healthy
                          - abnormal
                          - sleep
                          - stale
                      by_abnormal_type:
                        type: object
                        properties:
                          hashboard:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          temperature:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          fan:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          network:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          pool:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          power:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          control_board:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          firmware:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          low_hashrate:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                          unknown:
                            type: object
                            properties:
                              count:
                                type: number
                              also_has:
                                type: object
                                additionalProperties:
                                  type: number
                            required:
                              - count
                              - also_has
                        required:
                          - hashboard
                          - temperature
                          - fan
                          - network
                          - pool
                          - power
                          - control_board
                          - firmware
                          - low_hashrate
                          - unknown
                      mining_mode:
                        type: array
                        items:
                          type: object
                          properties:
                            mode:
                              type: string
                            count:
                              type: number
                          required:
                            - mode
                            - count
                      miner_model:
                        type: array
                        items:
                          type: object
                          properties:
                            model:
                              type:
                                - string
                                - 'null'
                            count:
                              type: number
                          required:
                            - model
                            - count
                    required:
                      - theo
                      - total
                      - by_type
                      - by_abnormal_type
                      - mining_mode
                      - miner_model
                  error:
                    type: 'null'
                    example: null
                    description: Error object (null on success)
                required:
                  - success
                  - data
                  - error
        '400':
          description: Bad Request - Invalid parameters
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 400
                  message:
                    type: string
                    description: Error message
                    example: Invalid request parameters
                  error:
                    type: string
                    description: Error type
                    example: Bad Request
                required:
                  - statusCode
                  - message
                  - error
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 401
                  message:
                    type: string
                    description: Error message
                    example: Invalid or missing API key
                  error:
                    type: string
                    description: Error type
                    example: Unauthorized
                required:
                  - statusCode
                  - message
                  - error
        '403':
          description: Forbidden - Valid API key but insufficient permissions
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 403
                  message:
                    type: string
                    description: Error message
                    example: Access denied to workspace
                  error:
                    type: string
                    description: Error type
                    example: Forbidden
                required:
                  - statusCode
                  - message
                  - error
        '404':
          description: Not Found - Resource does not exist
          content:
            application/json:
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                    description: HTTP status code
                    example: 404
                  message:
                    type: string
                    description: Error message
                    example: Resource not found
                  error:
                    type: string
                    description: Error type
                    example: Not Found
                required:
                  - statusCode
                  - message
                  - error
      security:
        - clerk-api-key: []
components:
  securitySchemes:
    clerk-api-key:
      scheme: bearer
      bearerFormat: API Key
      type: http
      description: Clerk Machine API Key for authentication

````