# tinker.types.BillingUsageEvent *Generated from tinker 0.30.4 at commit [`1e5777e`](https://github.com/thinking-machines-lab/tinker/tree/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d). Source links point at that snapshot.* ## *class* [**tinker.types.BillingUsageEvent**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L83)(*[BaseModel](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/_models.py#L88)*) 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**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L88) (*datetime*) – Inclusive start of the UTC hour bucket - [**bucket_end**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L91) (*datetime*) – Exclusive end of the UTC hour bucket - [**base_model**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L94) (*str | None*) – Base model the usage was billed against (None when unknown, e.g. storage from before base-model stamping) - [**user_id**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L98) (*str | None*) – Organization-user urn of the user that created the session the usage is attributed to - [**user_name**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L102) (*str | None*) – Display name of `user_id`, as self-reported during onboarding - [**session_id**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L105) (*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**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L112) (*str | None*) – Project this usage belongs to, resolved from the current project associated with the session identified by `session_id` - [**estimated_cost_usd**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L116) (*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**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L130) (*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**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L136) (*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**](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L142) (*[BillingEventInfo](https://github.com/thinking-machines-lab/tinker/blob/1e5777ef1e0bb2bae6d9b8d63a6144eec405377d/src/tinker/types/billing_usage_response.py#L71)*) – What kind of usage this is and its quantity; dispatch on `event_info.type` ## Referenced by - [RestClient.get_billing_usage](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/restclient/#get_billing_usage) - [tinker.types.BillingUsageResponse](https://tinker-docs.thinkingmachines.ai/tinker/api-reference/types/billingusageresponse/index.md)