/* * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT. */ import { usageCosts } from "../funcs/usageCosts.js"; import { usageSandbox } from "../funcs/usageSandbox.js"; import { ClientSDK, RequestOptions } from "../lib/sdks.js"; import * as components from "../models/components/index.js"; import * as operations from "../models/operations/index.js"; import { unwrapAsync } from "../types/fp.js"; export class Usage extends ClientSDK { /** * Get Sandbox Usage * * @remarks * Aggregate sandbox usage (session lifecycle, execution, and workspace operations) over a time range, bucketed and optionally grouped. Buckets are calendar-aligned in UTC: `start_time` is snapped down and `end_time` snapped up to the nearest bucket-width boundary, so the first and last buckets may extend slightly beyond the requested range. Org-scoped: callers see their own usage, org admins their team's; cluster admins may pass `all_orgs` or `org_ids`. Cost and spend reporting lives in the budgeting API (`/api/v1/budgeting/usage/costs`). */ async sandbox( request: operations.GetSandboxUsageRequest, options?: RequestOptions, ): Promise { return unwrapAsync(usageSandbox( this, request, options, )); } /** * Aggregate cost by dimension * * @remarks * Sums stored per-entry cost over [start_time, end_time), grouped by any of service, task_type, model, api_key_id, team_id, user_id, external_user_id, org_id. Point-in-time correct for chargeback/showback. */ async costs( request: operations.GetCostsRequest, options?: RequestOptions, ): Promise { return unwrapAsync(usageCosts( this, request, options, )); } }