Skip to content
View as Markdown

tinker.types.BillingUsageEvent

Generated from tinker 0.30.4 at commit 1e5777e. Source links point at that snapshot.

class tinker.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
  • estimated_cost_usd (float | None) – Estimated gross USD usage cost before credits and commits, not invoice amount due. A completed UTC day is priced only after its full-day usage quantities reconcile with usage line items from the finalized invoice export, or the latest draft when no finalized invoice is available. The current incomplete UTC day instead uses the published Tinker rate-card snapshot; that estimate is not invoice-reconciled and can change when the day completes. For token events, this equals effective_rate_usd_per_million_tokens * token_count / 1_000_000. For storage events, this equals effective_rate_usd_per_gigabyte_month * gigabyte_hours / 720. None for checkpoint operations, when a completed day has not reconciled, or when the current rate card has no applicable token or storage rate.
  • effective_rate_usd_per_million_tokens (float | None) – Effective gross USD rate per million tokens used to calculate estimated_cost_usd, before credits and commits. This is not an amount due. None for non-token events or whenever token cost cannot be attributed.
  • effective_rate_usd_per_gigabyte_month (float | None) – Effective gross USD rate per storage GB-month used to calculate estimated_cost_usd, before credits and commits. One GB-month is 720 GB-hours for this calculation. None for non-storage events or whenever storage cost cannot be attributed.
  • event_info (BillingEventInfo) – What kind of usage this is and its quantity; dispatch on event_info.type

Referenced by