getUsageSamplesWithHttpInfo method

Future<Response> getUsageSamplesWithHttpInfo({
  1. String? account,
  2. String? provider,
  3. String? range,
  4. String? window,
})

Is the PER-PROVIDER view: one connected account's own consumption of its own plan — "my plan is 47% through its 6h window, resets at 14:20".

Is the PER-PROVIDER view: one connected account's own consumption of its own plan — "my plan is 47% through its 6h window, resets at 14:20". current is the newest instance of each lane (the headline); windows is the history behind it. Both come from ONE deduped read, so they can never disagree. The rows are the caller's OWN linked accounts, scoped to the validated principal and its subject — never another user's, and never another org's.

Note: This method returns the HTTP Response.

Parameters:

  • String account: Account narrows to ONE linked account of that provider. Empty covers every account the caller has linked there.

  • String provider: Provider is the upstream to read, e.g. anthropic. Required.

  • String range: Range is the window to read: a count and a unit — 1h, 24h, 90d, any

  • String window: Window narrows to ONE window class: 6h, day, week or month. Empty covers every class.

Implementation

Future<Response> getUsageSamplesWithHttpInfo({ String? account, String? provider, String? range, String? window, }) async {
  // ignore: prefer_const_declarations
  final path = r'/v1/usage/samples';

  // ignore: prefer_final_locals
  Object? postBody;

  final queryParams = <QueryParam>[];
  final headerParams = <String, String>{};
  final formParams = <String, String>{};

  if (account != null) {
    queryParams.addAll(_queryParams('', 'account', account));
  }
  if (provider != null) {
    queryParams.addAll(_queryParams('', 'provider', provider));
  }
  if (range != null) {
    queryParams.addAll(_queryParams('', 'range', range));
  }
  if (window != null) {
    queryParams.addAll(_queryParams('', 'window', window));
  }

  const contentTypes = <String>[];


  return apiClient.invokeAPI(
    path,
    'GET',
    queryParams,
    postBody,
    headerParams,
    formParams,
    contentTypes.isEmpty ? null : contentTypes.first,
  );
}