Skip to content

6.2.2.12 FeatureUsage

6.2.2.12.1 Purpose

How much of a metered feature an Organization has used in a period, for example MooChat tokens this month. The AI gateway updates it on every model call and checks it against the limits of the Organization's entitlement in the same statement, so a limit can never be overrun by two concurrent calls.

6.2.2.12.2 Questions it answers

  • How much of its MooChat allowance has this Organization used this month?
  • Which Organizations are near their limit, and which plans are too small?
  • What did a feature cost us per Organization, for pricing and attribution?

6.2.2.12.3 Fields

Field Type Cardinality Description
id string (uuid) 1..1 Key.
organization Organization 0..1
feature string 1..1 The entitlement's feature, e.g. moochat.chat.
period string 1..1 e.g. 2026-10, in the Organization's timezone.
requests integer 1..1 Default: 0.
input_tokens integer 1..1 Default: 0.
output_tokens integer 1..1 Default: 0.
cost_micros integer 1..1 Default: 0.
Provider cost in millionths of a euro, for attribution; the limit is on tokens, not on money.
moonitoring_user MoonitoringUser 0..1 Staff use of an agent or tool is metered per Moonitoring user; exactly one of organization and moonitoring_user is set.
created_at datetime 1..1
updated_at datetime 1..1

6.2.2.12.4 Relationships

References

6.2.2.12.5 Rules & constraints

  • How much of a metered feature an Organization used in a period; the AI gateway writes it for every model call.
  • One row per (organization, feature, period); the gateway reserves input tokens before a call and settles output tokens after it, in one statement, so a limit is checked and updated atomically. A retry reuses its request id and is not counted twice. The per-call detail (user, model, tokens, cost, latency, never the prompt) is a ledger outside this model.
  • (organization, moonitoring_user, feature, period) is unique.