Skip to main content
PREMIUM ADD-ON ✨Governance is available upon request only. Please contact us to get access to this premium feature.
Attributed usage is read per subscription, one level of the tree at a time. The default time range is the current billing period.
Open a subscription and click Attribution.

By hierarchy

Set Group rows by to Hierarchical. Click a row to expand the level below it.To see a flat key inside the tree, pick it in List by and choose the level in Under. Here, each user expands into the API keys they used:
The Attribution tab: department R&D, team Engineering, user alice expanded into two API keys and a No API Key row

Hierarchical, with API keys listed under each user

By a flat key

Set Group rows by to Flat and pick the key in List by. You get one row per value across the whole subscription, without the tree:
The Attribution tab grouped by API key, with one row per key and a No API Key row

Flat, by API key

Controls

The Attribution tab with the Tokens charge split into Opus, Sonnet, Haiku and Default columns

One charge split by its filters

Amounts and charge models

Amounts are available for the standard charge model. Other charge models return units only. A standard charge is linear: every unit costs the same, so each team’s share of the amount is its share of the units. Graduated, volume, package and percentage charges aren’t linear. The price of a unit depends on the total usage of the subscription, so there is no single correct way to split the amount between teams or users. For example, with a graduated price of $1 for the first 1,000 units and $0.50 above, two teams that each send 1,000 units cost $1,500 together. Neither team is the one that crossed the tier, so neither owns the cheaper units.

Time range

A query covers up to 31 days. By default, it reads the current billing period. Attributed usage is computed on demand from your events, and the cap keeps every query fast. For a quarterly or yearly billing period, the default view reads the last 31 days of the period. To cover a longer period, run one query per month and add the results.

Limitations

  • Supports billable metrics with a COUNT or SUM aggregation that aren’t recurring.
  • Amounts are a breakdown of usage, before coupons, credits, minimums and taxes. They can differ from the invoice.
  • One level per request, up to 3 flat entities in filters, one split charge per request.
  • Up to 100,000 values per entity for each customer. Past that, new values aren’t tracked and grouping by the entity without a parent filter returns too_many_values. Use entities for stable things like users, teams or models, never for a request or transaction ID.
  • A large query can fail with too_many_groups or query_timeout. Narrow the time range or add filters.

Core concepts

Entities, attribution keys and roll-ups.

Send attributed events

Tag events with entity values.