> ## Documentation Index
> Fetch the complete documentation index at: https://dodopayments-mintlify-external-integration-datafast-autosen.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Meters

> Transform raw usage events into billable quantities with aggregation and filtering.

<Info>
  Meters convert raw events into billable quantities. They filter events and apply aggregation functions (Count, Sum, Max, Last) to calculate usage per customer.
</Info>

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/63GAHtrPqrd20Oxa/images/usage-based/UBB-2.png?fit=max&auto=format&n=63GAHtrPqrd20Oxa&q=85&s=4513f2363dbb962a885a79dfa898e3c9" alt="Meter creation interface showing event name, aggregation type, and filtering options" width="2324" height="1600" data-path="images/usage-based/UBB-2.png" />
</Frame>

## API Resources

<AccordionGroup>
  <Accordion title="View Meter API References">
    <CardGroup cols={2}>
      <Card title="Create Meter" icon="plus" href="/api-reference/meters/create-meter">
        Create meters programmatically via API.
      </Card>

      <Card title="List Meters" icon="list" href="/api-reference/meters/get-meters">
        Retrieve all meters in your account.
      </Card>

      <Card title="Get Meter" icon="eye" href="/api-reference/meters/retrieve-meter">
        Fetch details for a specific meter by ID.
      </Card>

      <Card title="Archive Meter" icon="arrow-rotate-right" href="/api-reference/meters/archive-meter">
        Archive a meter to stop tracking usage.
      </Card>

      <Card title="Unarchive Meter" icon="arrow-rotate-left" href="/api-reference/meters/unarchive-meter">
        Restore an archived meter to resume tracking.
      </Card>
    </CardGroup>
  </Accordion>
</AccordionGroup>

## Creating a Meter

<Steps>
  <Step title="Basic Information">
    <ParamField path="Meter Name" type="string" required>
      Descriptive name (e.g., "API Requests", "Token Usage")
    </ParamField>

    <ParamField path="Event Name" type="string" required>
      Exact event name to match (case-sensitive). Examples: `api.call`, `image.generated`
    </ParamField>
  </Step>

  <Step title="Aggregation">
    <ParamField path="Aggregation Type" type="string" required>
      Choose how events are aggregated:

      * **Count**: Total number of events (API calls, uploads)
      * **Sum**: Add numeric values (tokens, bytes)
      * **Max**: Highest value in period (peak users)
      * **Last**: Most recent value
    </ParamField>

    <ParamField path="Over Property" type="string">
      Metadata key to aggregate (required for all types except Count). Examples: `tokens`, `bytes`, `duration_ms`
    </ParamField>

    <ParamField path="Measurement Unit" type="string" required>
      Unit label for invoices. Examples: `calls`, `tokens`, `GB`, `hours`
    </ParamField>
  </Step>

  <Step title="Filtering (Optional)">
    <Frame>
      <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/63GAHtrPqrd20Oxa/images/usage-based/UBB-3.png?fit=max&auto=format&n=63GAHtrPqrd20Oxa&q=85&s=23035b5576c6ad40ab98f3727b58aaca" alt="Event filtering" width="1558" height="942" data-path="images/usage-based/UBB-3.png" />
    </Frame>

    Add conditions to filter which events are counted:

    * **AND logic**: All conditions must match
    * **OR logic**: Any condition can match

    **Comparators**: equals, not equals, greater than, less than, contains

    Enable filtering, choose logic, add conditions with property key, comparator, and value.
  </Step>

  <Step title="Create">
    Review configuration and click **Create Meter**.
  </Step>
</Steps>

## Viewing Analytics

<Frame>
  <img src="https://mintcdn.com/dodopayments-mintlify-external-integration-datafast-autosen/63GAHtrPqrd20Oxa/images/usage-based/UBB-1.png?fit=max&auto=format&n=63GAHtrPqrd20Oxa&q=85&s=dfed637d25f6cb92f40743e1642e207b" alt="Meter analytics" width="1536" height="1252" data-path="images/usage-based/UBB-1.png" />
</Frame>

Your meter dashboard shows:

* **Overview**: Total usage and usage chart
* **Events**: Individual events received
* **Customers**: Per-customer usage and charges

## Troubleshooting

<AccordionGroup>
  <Accordion title="Events not appearing">
    * Event name must match exactly (case-sensitive)
    * Check meter filters aren't excluding events
    * Verify customer IDs exist
    * Temporarily disable filters to test
  </Accordion>

  <Accordion title="Aggregation not working">
    * Verify Over Property matches metadata key exactly
    * Use numbers, not strings: `tokens: 150` not `"150"`
    * Include required properties in all events
  </Accordion>

  <Accordion title="Filters not working">
    * Match case exactly
    * Use correct operators for data type
    * Ensure events include filtered properties
  </Accordion>

  <Accordion title="Wrong usage totals">
    * Check Events tab to count actual events received
    * Verify aggregation type (Count vs Sum)
    * Ensure values are numeric for Sum/Max
  </Accordion>
</AccordionGroup>

## Next Steps

<CardGroup cols={2}>
  <Card title="Send Events" icon="bolt" href="/features/usage-based-billing/event-ingestion">
    Start sending usage events from your application to your meters.
  </Card>

  <Card title="View Blueprints" icon="copy" href="/features/usage-based-billing/ingestion-blueprints">
    Use ready-made meter configurations for common use cases.
  </Card>
</CardGroup>
