client.get_usage_stats() method.
Cost & Usage
get_usage_stats
Fetches time-series usage and cost data for a given plan type and time range.
get_usage_stats() returns a single dict, not a bare list of items:
total_cost (top-level) for the overall total, and each item’s event_name + total_cost for the breakdown by deployment (or by accelerator type with group_by="accelerator" — see below, including a plan_type="reserved"-specific breakdown that only shows up in that grouping).
UsageStatsParams
List parameters accept one or more values (for example
["a", "b"]). Passing a filter that is not valid for the selected plan_type raises a ValidationError.- You can find
workspace-idunder Settings > Workspaces. Select your workspace and copy the workspace ID.

- Go to Deployments and select a deployment to find the
deployment-idanddeployment-slug.

Plan Types
Examples
Dedicated Deployment usage (plan_type="private")
plan_type="shared"): hourly buckets for the last 48 hours, pin results to one workspace_id
deployment_ids (use deployment_slugs instead when you have slugs, not UUIDs)
model_names
plan_type="training"): weekly buckets for the last 90 days, narrow to training_job_names
plan_type="compilation"): daily cost for specific model_repo_names
statuses=["DEPLOYED"])
plan_type="reserved"): daily cost plus the pooled reservation commitment breakdown
group_by="accelerator" (or omitting group_by, with no deployment filter) gets you the full commitment breakdown automatically — no flag to set:
total_cost reflects what your org is actually billed under the reservation. If your org moved from a private plan to a reserved plan, items includes usage from before that migration too, so you get one continuous view instead of a gap at the migration date. computed_overage_amount is usage billed above what you’ve committed to for that window; computed_true_up_amount is committed capacity you paid for but didn’t use that window.
group_by="deployment" never returns the commitment breakdown — overage/true-up cost is pooled across your whole account and can’t be attributed to a single deployment, so a pooled, account-wide figure sitting next to a per-deployment cost list would be misleading. Use group_by="accelerator" (or omit group_by) whenever you want the breakdown.deployment_ids/deployment_slugs can’t be combined with an explicit group_by="accelerator" — the SDK rejects it locally (ValidationError), and the backend rejects it too (400), since a pooled/accelerator-grouped query never resolves per-deployment sources at all. An omitted group_by alongside a deployment filter is fine — for plan_type="reserved" it auto-corrects to group_by="deployment" instead of defaulting to the pooled shape.group_by="deployment" gets you a flat per-deployment metered cost list instead — it never includes the commitment breakdown:
group_by can be omitted for a deployment-filtered reserved query too — deployment_ids/deployment_slugs auto-correct an omitted group_by to the per-deployment shape (no reservation_commitment either way):
group_by="accelerator" pools items per GPU/CPU type instead of per deployment. Only valid for plan_type in private/reserved. Each pooled item gains a sources key (a list of every deployment source string folded into it) in place of the single source value the per-deployment grouping has; source itself is None on these pooled items.
Each point in a pooled item also carries computed_commitment_utilized_amount, computed_overage_amount, and computed_true_up_amount:
computed_commitment_utilized_amount— cost covered by capacity you’ve already committed to.computed_overage_amount— cost billed at on-demand rates because usage went above your committed quantity that window.computed_true_up_amount— committed capacity you paid for but didn’t use that window.
group_by just changes how items is organized — it’s available for both plan_type="private" and plan_type="reserved", with the same two values ("deployment" or "accelerator") either way. The reservation breakdown described above only ever comes with plan_type="reserved" — a plan_type="private" request, even with group_by="accelerator", never includes reservation_commitment. For plan_type="reserved", the breakdown always covers your whole account, and only appears with group_by="accelerator" (or group_by omitted).Error Handling
The SDK raisesSimplismartError for API errors. Pydantic validates plan_type and window_size before the request is sent, so invalid values are caught locally.