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

# Time-bucketed usage per metered feature over a range



## OpenAPI

````yaml /api-reference/openapi.json get /v1/billing/usage
openapi: 3.1.0
info:
  title: Feather API
  description: >-
    Unified customer experience platform API. Manages identity, conversations,
    memory, agents, procedures, policies, model routing, knowledge bases,
    integrations, and runtime execution.
  version: 1.87.0
servers:
  - url: https://api-sandbox.featherhq.com
    description: Sandbox
  - url: http://localhost:8000
    description: Local dev
security: []
paths:
  /v1/billing/usage:
    get:
      tags:
        - billing
      summary: Time-bucketed usage per metered feature over a range
      operationId: getBillingUsage
      parameters:
        - name: granularity
          in: query
          required: false
          schema:
            type: string
            pattern: ^(hour|day|month)$
            default: day
            title: Granularity
        - name: range
          in: query
          required: false
          schema:
            type: string
            pattern: ^(24h|7d|30d|90d|last_cycle|1bc|3bc)$
            default: 30d
            title: Range
        - name: feature_id
          in: query
          required: false
          schema:
            anyOf:
              - type: array
                items:
                  type: string
                  minLength: 1
              - type: 'null'
            title: Feature Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BillingUsageResponse'
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: Authentication required
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    BillingUsageResponse:
      properties:
        enabled:
          type: boolean
          title: Enabled
        customer_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Customer Id
        granularity:
          type: string
          title: Granularity
        range:
          type: string
          title: Range
        feature_ids:
          items:
            type: string
          type: array
          title: Feature Ids
        series:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Series
        totals:
          additionalProperties: true
          type: object
          title: Totals
      type: object
      required:
        - enabled
        - granularity
        - range
      title: BillingUsageResponse
      description: |-
        Time-bucketed usage per metered feature over a range.

        ``enabled=false`` mirrors the matrix kill-switch behavior. ``series`` is
        Autumn's per-bin list (each ``{period, values: {feature_id: n}}``);
        ``totals`` is the per-feature ``{count, sum}`` over the whole range.
        ``period`` is an epoch timestamp in Autumn's native unit — the frontend
        renders it as-is.
    ErrorResponse:
      properties:
        error:
          type: string
          title: Error
        message:
          type: string
          title: Message
        retryable:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Retryable
        retry_after:
          anyOf:
            - type: integer
            - type: 'null'
          title: Retry After
      type: object
      required:
        - error
        - message
      title: ErrorResponse
      description: Standard error response returned by all API error handlers.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: x-api-key

````