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

# List billable metrics

> Returns a paginated list of billable metrics. Supports filtering by event name, aggregation method, aggregation field, and tag IDs. Results can be sorted by name.



## OpenAPI

````yaml /api-reference/specs/2026-04-01.json get /metrics
openapi: 3.1.0
info:
  description: >-
    Alguna is the AI-native quote-to-revenue platform for B2B companies: CPQ,
    subscription and usage-based billing, invoicing, payment collection, and
    revenue recognition in one system of record. The API operates on one
    versioned agreement per customer: quotes, subscriptions and their versions,
    usage, invoices, payments, and revenue schedules read from it. Official
    SDKs: TypeScript (@alguna/sdk), Python (alguna), Go
    (github.com/alguna-io/alguna-go), Rust (alguna), and the alguna CLI
    (@alguna/cli).
  title: Alguna Public API
  version: '2026-04-01'
servers:
  - url: https://api.alguna.io
    x-fern-server-name: Production
security:
  - bearerAuth: []
tags:
  - name: Billing Events and Metrics
  - name: Checkout Sessions
  - name: Credit Notes
  - name: Credits
  - name: Customer Portal Sessions
  - name: Customers
  - name: Feedback
  - name: Insights
  - name: Integrations
  - name: Invoices
  - name: Merchants
  - name: Payments
  - name: Plans
  - name: Product Bundles
  - name: Products
  - name: Quotes
  - name: Refunds
  - name: Revenue Schedules
  - name: Subscription Changes
  - name: Subscription Versions
  - name: Subscriptions
  - name: Tags
  - name: Tax
  - name: Users
  - name: Wallet Grants
  - name: Wallets
paths:
  /metrics:
    get:
      tags:
        - Billing Events and Metrics
      summary: List billable metrics
      description: >-
        Returns a paginated list of billable metrics. Supports filtering by
        event name, aggregation method, aggregation field, and tag IDs. Results
        can be sorted by name.
      operationId: list-metrics
      parameters:
        - in: header
          name: Alguna-Version
          required: true
          schema:
            enum:
              - '2026-04-01'
            type: string
        - explode: false
          in: query
          name: aggregation_field
          schema:
            description: Filter by aggregation field (comma-separated to match any)
            example: amount
            items:
              type: string
            type: array
        - explode: false
          in: query
          name: aggregation_method
          schema:
            description: Filter by aggregation method (comma-separated to match any)
            example: sum
            items:
              enum:
                - count
                - count_unique
                - average
                - min
                - max
                - sum
              type: string
            type: array
        - explode: false
          in: query
          name: event_name
          schema:
            description: Filter by event name (comma-separated to match any)
            example: api_call
            items:
              type: string
            type: array
        - in: query
          name: limit
          schema:
            description: Number of items to return per page
            example: 20
            format: int32
            maximum: 100
            type: integer
        - in: query
          name: offset
          schema:
            default: 0
            description: Number of items to skip
            example: 0
            format: int32
            type: integer
        - in: query
          name: sort
          schema:
            description: Sort field and direction in format field:order
            example: name:asc
            type: string
        - explode: false
          in: query
          name: tag_ids
          schema:
            description: Filter by tag IDs (comma-separated to match any)
            example: tag_abc123
            items:
              type: string
            type: array
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MetricListResponse'
          description: Success
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                oneOf:
                  - $ref: '#/components/schemas/ErrorResponse'
                  - $ref: '#/components/schemas/GatewayErrorResponse'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Forbidden — the organization does not have access to this feature
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Not Found
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unprocessable Entity
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal Server Error
        '502':
          description: >-
            Bad Gateway — sent by the infrastructure in front of the API; the
            body is not JSON. Safe to retry.
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Service Unavailable — a dependency is temporarily unavailable. Retry
            with backoff.
        '504':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Gateway Timeout — the request did not finish in time. Retry with
            backoff; use an idempotency key for writes.
components:
  schemas:
    MetricListResponse:
      properties:
        data:
          description: List of metrics
          items:
            $ref: '#/components/schemas/MetricResponse'
          type: array
        pagination:
          allOf:
            - $ref: '#/components/schemas/PaginationMeta'
          description: Pagination metadata
      required:
        - data
        - pagination
      type: object
    ErrorResponse:
      description: The body of every error the API returns.
      properties:
        code:
          description: >-
            Machine-readable error code, such as `not_found` or
            `invoice_already_issued`. New codes may be added at any time, so
            handle a code you do not know by its HTTP status.
          type: string
        detail:
          description: Explanation of what went wrong
          type: string
        request_id:
          description: >-
            Identifies the request, as the `X-Request-Id` response header does.
            Quote it when contacting support.
          type: string
        status:
          description: HTTP status code of the response
          format: int64
          type: integer
        title:
          description: >-
            HTTP status text. Sent only by version, idempotency and
            credit-refusal errors.
          type: string
        type:
          description: Always `about:blank`. Sent only by version and idempotency errors.
          type: string
      required:
        - status
        - detail
      type: object
    GatewayErrorResponse:
      description: >-
        Returned by the API gateway when a request carries no valid API key,
        before the API handles it.
      properties:
        code:
          description: Machine-readable error code, e.g. `unauthenticated`
          type: string
        details:
          nullable: true
          type: object
        message:
          description: Explanation of what went wrong
          type: string
      required:
        - code
        - message
      type: object
    MetricResponse:
      properties:
        aggregation:
          allOf:
            - $ref: '#/components/schemas/AggregationResponse'
          description: How events are aggregated into a metric value
        created_at:
          description: Timestamp when the metric was created
          example: '2026-04-01T10:00:00Z'
          format: date-time
          type: string
        description:
          description: Description of the metric
          example: Counts API calls per customer
          nullable: true
          type: string
        event_name:
          description: Event name that triggers this metric
          example: api_call
          type: string
        filter_groups:
          description: Filter groups applied to events before aggregation
          items:
            $ref: '#/components/schemas/FilterGroupResponse'
          type: array
        id:
          description: Unique identifier for the metric
          example: mtr_01H1VECT
          type: string
        name:
          description: Name of the metric
          example: API Calls
          type: string
        tag_ids:
          description: Tag identifiers associated with this metric
          items:
            type: string
          type: array
        updated_at:
          description: Timestamp when the metric was last updated
          example: '2026-04-01T12:30:00Z'
          format: date-time
          type: string
      required:
        - aggregation
        - created_at
        - event_name
        - id
        - name
        - updated_at
      type: object
    PaginationMeta:
      properties:
        per_page:
          description: Number of items returned per page
          example: 20
          format: int64
          type: integer
        total_pages:
          description: Total number of pages available
          example: 5
          format: int64
          type: integer
      required:
        - per_page
        - total_pages
      type: object
    AggregationResponse:
      properties:
        field:
          description: Event property field to aggregate. Not required for count method
          example: amount
          type: string
        method:
          allOf:
            - $ref: '#/components/schemas/AggregationMethod'
          description: Aggregation method
          example: sum
      required:
        - field
        - method
      type: object
    FilterGroupResponse:
      properties:
        filters:
          description: Array of filters in this group
          items:
            $ref: '#/components/schemas/FilterResponse'
          type: array
        operator:
          allOf:
            - $ref: '#/components/schemas/FilterGroupOperator'
          description: Logical operator combining filters in this group
          example: and
      required:
        - filters
        - operator
      type: object
    AggregationMethod:
      enum:
        - count
        - count_unique
        - average
        - min
        - max
        - sum
      type: string
    FilterResponse:
      properties:
        field:
          description: Event property field name
          example: region
          type: string
        operator:
          description: Filter comparison operator
          example: equal
          type: string
        value:
          description: Value to match against
          example: us-east-1
          type: string
      required:
        - field
        - operator
        - value
      type: object
    FilterGroupOperator:
      enum:
        - and
        - or
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: API Key
      description: API key authentication. Pass your API key as a Bearer token.
      scheme: bearer
      type: http
      x-fern-bearer:
        env: ALGUNA_API_KEY
        name: apiKey

````

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