跳转至

BillingUsageEvent

class mint.types.BillingUsageEvent ( BaseModel )

One hourly bucket of billing usage: shared attribution dimensions on the envelope, with the usage-kind-specific payload in event_info (a tagged union discriminated on .type ).

Fields:

  • bucket_start ( datetime ) – Inclusive start of the UTC hour bucket
  • bucket_end ( datetime ) – Exclusive end of the UTC hour bucket
  • base_model ( str | None ) – Base model the usage was billed against (None when unknown, e.g. storage from before base-model stamping)
  • user_id ( str | None ) – Organization-user urn of the user that created the session the usage is attributed to
  • user_name ( str | None ) – Display name of user_id , as self-reported during onboarding
  • session_id ( str | None ) – The session the usage is attributed to: for sampling the session that issued the requests, for training the session that created the training run. None for events without a session (storage, usage from before session tagging). Session user_metadata is available in BillingUsageResponse.sessions — keyed by this id.
  • project_id ( str | None ) – Project this usage belongs to, resolved from the current project associated with the session identified by session_id
  • event_info ( BillingEventInfo ) – What kind of usage this is and its quantity; dispatch on event_info.type

Referenced by

  • RestClient.get_billing_usage
  • mint.types.BillingUsageResponse