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

# Query usage rollups (API key)

> Returns per-customer, per-metric usage rollups for the organisation scoped to the API key, with optional filters.



## OpenAPI

````yaml /api-reference/public-openapi.yaml get /v1/usage
openapi: 3.0.3
info:
  contact: {}
  description: Usage-based billing and metering API for Monigo.
  title: Monigo Public API
  version: '1.0'
servers:
  - url: https://api.monigo.co
security: []
paths:
  /v1/usage:
    get:
      tags:
        - usage
      summary: Query usage rollups (API key)
      description: >-
        Returns per-customer, per-metric usage rollups for the organisation
        scoped to the API key, with optional filters.
      parameters:
        - name: customer_id
          in: query
          description: Filter by customer ID
          schema:
            type: string
        - name: metric_id
          in: query
          description: Filter by metric ID (UUID)
          schema:
            type: string
        - name: from
          in: query
          description: >-
            Period start lower bound (RFC3339). Defaults to start of current
            billing period.
          schema:
            type: string
        - name: to
          in: query
          description: >-
            Period start upper bound, exclusive (RFC3339). Defaults to end of
            current billing period.
          schema:
            type: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/services.UsageQueryResult'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                additionalProperties:
                  type: string
                type: object
      security:
        - ApiKeyAuth: []
components:
  schemas:
    services.UsageQueryResult:
      properties:
        count:
          type: integer
        rollups:
          items:
            $ref: '#/components/schemas/services.UsageRollupResult'
          type: array
      type: object
    services.UsageRollupResult:
      properties:
        aggregation:
          type: string
        created_at:
          type: string
        customer_id:
          type: string
        event_count:
          type: integer
        id:
          type: string
        is_test:
          type: boolean
        last_event_at:
          type: string
        metric_id:
          type: string
        org_id:
          type: string
        period_end:
          type: string
        period_start:
          type: string
        updated_at:
          type: string
        value:
          type: number
      type: object
  securitySchemes:
    ApiKeyAuth:
      description: >-
        API key with Bearer prefix (for programmatic/server-to-server access),
        format: Bearer {api_key}
      in: header
      name: Authorization
      type: apiKey

````