@athenaintel/sdk 4.3.2249 → 4.3.2251

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/agents/resources/general/client/Client.d.ts +1 -1
  3. package/dist/cjs/api/resources/agents/resources/general/client/Client.js +1 -1
  4. package/dist/cjs/api/resources/workspaces/client/Client.d.ts +18 -0
  5. package/dist/cjs/api/resources/workspaces/client/Client.js +86 -0
  6. package/dist/cjs/api/resources/workspaces/client/requests/GetUsageWorkspacesRequest.d.ts +12 -0
  7. package/dist/cjs/api/resources/workspaces/client/requests/GetUsageWorkspacesRequest.js +3 -0
  8. package/dist/cjs/api/resources/workspaces/client/requests/index.d.ts +1 -0
  9. package/dist/cjs/api/types/WorkspaceUsageComputerOut.d.ts +22 -0
  10. package/dist/cjs/api/types/WorkspaceUsageComputerOut.js +3 -0
  11. package/dist/cjs/api/types/WorkspaceUsageDayOut.d.ts +14 -0
  12. package/dist/cjs/api/types/WorkspaceUsageDayOut.js +3 -0
  13. package/dist/cjs/api/types/WorkspaceUsageResponseOut.d.ts +36 -0
  14. package/dist/cjs/api/types/WorkspaceUsageResponseOut.js +3 -0
  15. package/dist/cjs/api/types/WorkspaceUsageTokensOut.d.ts +17 -0
  16. package/dist/cjs/api/types/WorkspaceUsageTokensOut.js +3 -0
  17. package/dist/cjs/api/types/WorkspaceUsageUserOut.d.ts +22 -0
  18. package/dist/cjs/api/types/WorkspaceUsageUserOut.js +3 -0
  19. package/dist/cjs/api/types/index.d.ts +5 -0
  20. package/dist/cjs/api/types/index.js +5 -0
  21. package/dist/cjs/version.d.ts +1 -1
  22. package/dist/cjs/version.js +1 -1
  23. package/dist/esm/BaseClient.mjs +2 -2
  24. package/dist/esm/api/resources/agents/resources/general/client/Client.d.mts +1 -1
  25. package/dist/esm/api/resources/agents/resources/general/client/Client.mjs +1 -1
  26. package/dist/esm/api/resources/workspaces/client/Client.d.mts +18 -0
  27. package/dist/esm/api/resources/workspaces/client/Client.mjs +86 -0
  28. package/dist/esm/api/resources/workspaces/client/requests/GetUsageWorkspacesRequest.d.mts +12 -0
  29. package/dist/esm/api/resources/workspaces/client/requests/GetUsageWorkspacesRequest.mjs +2 -0
  30. package/dist/esm/api/resources/workspaces/client/requests/index.d.mts +1 -0
  31. package/dist/esm/api/types/WorkspaceUsageComputerOut.d.mts +22 -0
  32. package/dist/esm/api/types/WorkspaceUsageComputerOut.mjs +2 -0
  33. package/dist/esm/api/types/WorkspaceUsageDayOut.d.mts +14 -0
  34. package/dist/esm/api/types/WorkspaceUsageDayOut.mjs +2 -0
  35. package/dist/esm/api/types/WorkspaceUsageResponseOut.d.mts +36 -0
  36. package/dist/esm/api/types/WorkspaceUsageResponseOut.mjs +2 -0
  37. package/dist/esm/api/types/WorkspaceUsageTokensOut.d.mts +17 -0
  38. package/dist/esm/api/types/WorkspaceUsageTokensOut.mjs +2 -0
  39. package/dist/esm/api/types/WorkspaceUsageUserOut.d.mts +22 -0
  40. package/dist/esm/api/types/WorkspaceUsageUserOut.mjs +2 -0
  41. package/dist/esm/api/types/index.d.mts +5 -0
  42. package/dist/esm/api/types/index.mjs +5 -0
  43. package/dist/esm/version.d.mts +1 -1
  44. package/dist/esm/version.mjs +1 -1
  45. package/package.json +1 -1
  46. package/reference.md +67 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@athenaintel/sdk",
46
- "X-Fern-SDK-Version": "4.3.2249",
47
- "User-Agent": "@athenaintel/sdk/4.3.2249",
46
+ "X-Fern-SDK-Version": "4.3.2251",
47
+ "User-Agent": "@athenaintel/sdk/4.3.2251",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
@@ -36,7 +36,7 @@ export declare class GeneralClient {
36
36
  invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
37
37
  private __invoke;
38
38
  /**
39
- * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
39
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it or while it is archived (restore it to continue it).
40
40
  *
41
41
  * @param {AthenaIntelligence.GeneralAgentRequest} request
42
42
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -141,7 +141,7 @@ class GeneralClient {
141
141
  });
142
142
  }
143
143
  /**
144
- * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
144
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it or while it is archived (restore it to continue it).
145
145
  *
146
146
  * @param {AthenaIntelligence.GeneralAgentRequest} request
147
147
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -140,4 +140,22 @@ export declare class WorkspacesClient {
140
140
  */
141
141
  updateToolRegistry(request: AthenaIntelligence.UpdateWorkspaceToolRegistryRequestIn, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.WorkspaceToolRegistryResponseOut>;
142
142
  private __updateToolRegistry;
143
+ /**
144
+ * Aggregate LLM token usage (and cost) for one workspace over the last `days` days: workspace totals plus per-member, per-day and per-Computer breakdowns. Token counters are summed from each session's usage ledger; dry-run (test) sessions are reported separately and excluded from the totals. Requires workspace owner or manager (or Athena admin) permissions — the same gate as the in-app Usage page.
145
+ *
146
+ * @param {AthenaIntelligence.GetUsageWorkspacesRequest} request
147
+ * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration.
148
+ *
149
+ * @throws {@link AthenaIntelligence.ForbiddenError}
150
+ * @throws {@link AthenaIntelligence.NotFoundError}
151
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
152
+ *
153
+ * @example
154
+ * await client.workspaces.getUsage({
155
+ * workspace_id: "workspace_id",
156
+ * days: 30
157
+ * })
158
+ */
159
+ getUsage(request: AthenaIntelligence.GetUsageWorkspacesRequest, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.WorkspaceUsageResponseOut>;
160
+ private __getUsage;
143
161
  }
@@ -654,5 +654,91 @@ class WorkspacesClient {
654
654
  }
655
655
  });
656
656
  }
657
+ /**
658
+ * Aggregate LLM token usage (and cost) for one workspace over the last `days` days: workspace totals plus per-member, per-day and per-Computer breakdowns. Token counters are summed from each session's usage ledger; dry-run (test) sessions are reported separately and excluded from the totals. Requires workspace owner or manager (or Athena admin) permissions — the same gate as the in-app Usage page.
659
+ *
660
+ * @param {AthenaIntelligence.GetUsageWorkspacesRequest} request
661
+ * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration.
662
+ *
663
+ * @throws {@link AthenaIntelligence.ForbiddenError}
664
+ * @throws {@link AthenaIntelligence.NotFoundError}
665
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
666
+ *
667
+ * @example
668
+ * await client.workspaces.getUsage({
669
+ * workspace_id: "workspace_id",
670
+ * days: 30
671
+ * })
672
+ */
673
+ getUsage(request, requestOptions) {
674
+ return core.HttpResponsePromise.fromPromise(this.__getUsage(request, requestOptions));
675
+ }
676
+ __getUsage(request, requestOptions) {
677
+ return __awaiter(this, void 0, void 0, function* () {
678
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
679
+ const { workspace_id: workspaceId, days } = request;
680
+ const _queryParams = {};
681
+ if (days != null) {
682
+ _queryParams.days = days.toString();
683
+ }
684
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
685
+ const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
686
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
687
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
688
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
689
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/workspaces/${core.url.encodePathParam(workspaceId)}/usage`),
690
+ method: "GET",
691
+ headers: _headers,
692
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
693
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
694
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
695
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
696
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
697
+ logging: this._options.logging,
698
+ });
699
+ if (_response.ok) {
700
+ return {
701
+ data: _response.body,
702
+ rawResponse: _response.rawResponse,
703
+ };
704
+ }
705
+ if (_response.error.reason === "status-code") {
706
+ switch (_response.error.statusCode) {
707
+ case 403:
708
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
709
+ case 404:
710
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
711
+ case 422:
712
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
713
+ default:
714
+ throw new errors.AthenaIntelligenceError({
715
+ statusCode: _response.error.statusCode,
716
+ body: _response.error.body,
717
+ rawResponse: _response.rawResponse,
718
+ });
719
+ }
720
+ }
721
+ switch (_response.error.reason) {
722
+ case "non-json":
723
+ throw new errors.AthenaIntelligenceError({
724
+ statusCode: _response.error.statusCode,
725
+ body: _response.error.rawBody,
726
+ rawResponse: _response.rawResponse,
727
+ });
728
+ case "body-is-null":
729
+ throw new errors.AthenaIntelligenceError({
730
+ statusCode: _response.error.statusCode,
731
+ rawResponse: _response.rawResponse,
732
+ });
733
+ case "timeout":
734
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/workspaces/{workspace_id}/usage.");
735
+ case "unknown":
736
+ throw new errors.AthenaIntelligenceError({
737
+ message: _response.error.errorMessage,
738
+ rawResponse: _response.rawResponse,
739
+ });
740
+ }
741
+ });
742
+ }
657
743
  }
658
744
  exports.WorkspacesClient = WorkspacesClient;
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * workspace_id: "workspace_id",
5
+ * days: 30
6
+ * }
7
+ */
8
+ export interface GetUsageWorkspacesRequest {
9
+ workspace_id: string;
10
+ /** Reporting window in days, ending now (1-365) */
11
+ days?: number;
12
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1,6 +1,7 @@
1
1
  export type { CreatePresenceTokenWorkspacesRequest } from "./CreatePresenceTokenWorkspacesRequest.js";
2
2
  export type { GetConfigurationWorkspacesRequest } from "./GetConfigurationWorkspacesRequest.js";
3
3
  export type { GetToolRegistryWorkspacesRequest } from "./GetToolRegistryWorkspacesRequest.js";
4
+ export type { GetUsageWorkspacesRequest } from "./GetUsageWorkspacesRequest.js";
4
5
  export type { PresenceResolveRequestIn } from "./PresenceResolveRequestIn.js";
5
6
  export type { SearchMembersWorkspacesRequest } from "./SearchMembersWorkspacesRequest.js";
6
7
  export type { UpdateWorkspaceConfigurationRequestIn } from "./UpdateWorkspaceConfigurationRequestIn.js";
@@ -0,0 +1,22 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Usage attributed to one Computer asset over the window.
4
+ */
5
+ export interface WorkspaceUsageComputerOut {
6
+ /** The Computer asset ID */
7
+ computer_asset_id: string;
8
+ /** Whether the Computer is archived */
9
+ is_archived: boolean;
10
+ /** When the most recent usage session was created */
11
+ last_session_at?: string | null;
12
+ /** Number of successful model calls */
13
+ request_count: number;
14
+ /** Number of usage sessions */
15
+ session_count: number;
16
+ /** The Computer's title */
17
+ title?: string | null;
18
+ /** Token counters behind this Computer's usage */
19
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
20
+ /** Total LLM cost in USD */
21
+ total_cost_usd: number;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,14 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Usage of the workspace on one UTC day.
4
+ */
5
+ export interface WorkspaceUsageDayOut {
6
+ /** Date in YYYY-MM-DD format (UTC) */
7
+ date: string;
8
+ /** Number of sessions created on the day */
9
+ session_count: number;
10
+ /** Token counters for the day */
11
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
12
+ /** Total LLM cost in USD for the day */
13
+ total_cost_usd: number;
14
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,36 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Aggregated LLM token and cost usage for one workspace.
4
+ */
5
+ export interface WorkspaceUsageResponseOut {
6
+ /** Users with at least one session */
7
+ active_users: number;
8
+ /** Portion of total_cost_usd produced by Computers */
9
+ computer_cost_usd: number;
10
+ /** Number of Computer usage sessions */
11
+ computer_sessions: number;
12
+ /** Portion of tokens produced by Computers' LLM usage (already included in tokens, never additive) */
13
+ computer_tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
14
+ /** Per-day breakdown, oldest first */
15
+ daily: AthenaIntelligence.WorkspaceUsageDayOut[];
16
+ /** Length of the reporting window in days */
17
+ days: number;
18
+ /** Cost of dry-run (test) sessions */
19
+ dry_run_cost_usd: number;
20
+ /** Number of dry-run (test) sessions */
21
+ dry_run_sessions: number;
22
+ /** Token counters from dry-run (test) sessions, excluded from tokens */
23
+ dry_run_tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
24
+ /** Per-Computer breakdown, highest cost first */
25
+ per_computer: AthenaIntelligence.WorkspaceUsageComputerOut[];
26
+ /** Per-member breakdown, highest cost first */
27
+ per_user: AthenaIntelligence.WorkspaceUsageUserOut[];
28
+ /** Token counters across the workspace's sessions in the window, excluding dry-run (test) sessions */
29
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
30
+ /** Total LLM cost in USD */
31
+ total_cost_usd: number;
32
+ /** Number of sessions in the window */
33
+ total_sessions: number;
34
+ /** The workspace ID */
35
+ workspace_id: string;
36
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Token counters summed from the sessions' LLM usage ledgers.
3
+ */
4
+ export interface WorkspaceUsageTokensOut {
5
+ /** Input tokens written to the provider's prompt cache */
6
+ cache_creation_input_tokens: number;
7
+ /** Input tokens served from the provider's prompt cache */
8
+ cache_read_input_tokens: number;
9
+ /** Input (prompt) tokens, including cached reads */
10
+ input_tokens: number;
11
+ /** Output (completion) tokens, including reasoning tokens */
12
+ output_tokens: number;
13
+ /** Output tokens spent on reasoning */
14
+ reasoning_output_tokens: number;
15
+ /** Total tokens (input + output) */
16
+ total_tokens: number;
17
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,22 @@
1
+ import type * as AthenaIntelligence from "../index.js";
2
+ /**
3
+ * Usage of one workspace member over the window.
4
+ */
5
+ export interface WorkspaceUsageUserOut {
6
+ /** The user's email */
7
+ email: string;
8
+ /** First name */
9
+ first_name?: string | null;
10
+ /** Last name */
11
+ last_name?: string | null;
12
+ /** When the user's most recent session was created */
13
+ last_session_at?: string | null;
14
+ /** Number of sessions */
15
+ session_count: number;
16
+ /** Token counters across the user's sessions */
17
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
18
+ /** Total LLM cost in USD */
19
+ total_cost_usd: number;
20
+ /** The user ID */
21
+ user_id: string;
22
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ // This file was auto-generated by Fern from our API Definition.
3
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -168,4 +168,9 @@ export * from "./WorkspaceMemberSearchResponseOut.js";
168
168
  export * from "./WorkspaceShareAccess.js";
169
169
  export * from "./WorkspaceToolRegistryResponseOut.js";
170
170
  export * from "./WorkspaceToolRegistryToolOut.js";
171
+ export * from "./WorkspaceUsageComputerOut.js";
172
+ export * from "./WorkspaceUsageDayOut.js";
173
+ export * from "./WorkspaceUsageResponseOut.js";
174
+ export * from "./WorkspaceUsageTokensOut.js";
175
+ export * from "./WorkspaceUsageUserOut.js";
171
176
  export * from "./WrapStrategy.js";
@@ -184,4 +184,9 @@ __exportStar(require("./WorkspaceMemberSearchResponseOut.js"), exports);
184
184
  __exportStar(require("./WorkspaceShareAccess.js"), exports);
185
185
  __exportStar(require("./WorkspaceToolRegistryResponseOut.js"), exports);
186
186
  __exportStar(require("./WorkspaceToolRegistryToolOut.js"), exports);
187
+ __exportStar(require("./WorkspaceUsageComputerOut.js"), exports);
188
+ __exportStar(require("./WorkspaceUsageDayOut.js"), exports);
189
+ __exportStar(require("./WorkspaceUsageResponseOut.js"), exports);
190
+ __exportStar(require("./WorkspaceUsageTokensOut.js"), exports);
191
+ __exportStar(require("./WorkspaceUsageUserOut.js"), exports);
187
192
  __exportStar(require("./WrapStrategy.js"), exports);
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2249";
1
+ export declare const SDK_VERSION = "4.3.2251";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "4.3.2249";
4
+ exports.SDK_VERSION = "4.3.2251";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@athenaintel/sdk",
9
- "X-Fern-SDK-Version": "4.3.2249",
10
- "User-Agent": "@athenaintel/sdk/4.3.2249",
9
+ "X-Fern-SDK-Version": "4.3.2251",
10
+ "User-Agent": "@athenaintel/sdk/4.3.2251",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  "X-Athena-Session-Credential": options === null || options === void 0 ? void 0 : options.sessionCredential,
@@ -36,7 +36,7 @@ export declare class GeneralClient {
36
36
  invoke(request: AthenaIntelligence.GeneralAgentRequest, requestOptions?: GeneralClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.GeneralAgentResponse>;
37
37
  private __invoke;
38
38
  /**
39
- * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
39
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it or while it is archived (restore it to continue it).
40
40
  *
41
41
  * @param {AthenaIntelligence.GeneralAgentRequest} request
42
42
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -105,7 +105,7 @@ export class GeneralClient {
105
105
  });
106
106
  }
107
107
  /**
108
- * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
108
+ * Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it or while it is archived (restore it to continue it).
109
109
  *
110
110
  * @param {AthenaIntelligence.GeneralAgentRequest} request
111
111
  * @param {GeneralClient.RequestOptions} requestOptions - Request-specific configuration.
@@ -140,4 +140,22 @@ export declare class WorkspacesClient {
140
140
  */
141
141
  updateToolRegistry(request: AthenaIntelligence.UpdateWorkspaceToolRegistryRequestIn, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.WorkspaceToolRegistryResponseOut>;
142
142
  private __updateToolRegistry;
143
+ /**
144
+ * Aggregate LLM token usage (and cost) for one workspace over the last `days` days: workspace totals plus per-member, per-day and per-Computer breakdowns. Token counters are summed from each session's usage ledger; dry-run (test) sessions are reported separately and excluded from the totals. Requires workspace owner or manager (or Athena admin) permissions — the same gate as the in-app Usage page.
145
+ *
146
+ * @param {AthenaIntelligence.GetUsageWorkspacesRequest} request
147
+ * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration.
148
+ *
149
+ * @throws {@link AthenaIntelligence.ForbiddenError}
150
+ * @throws {@link AthenaIntelligence.NotFoundError}
151
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
152
+ *
153
+ * @example
154
+ * await client.workspaces.getUsage({
155
+ * workspace_id: "workspace_id",
156
+ * days: 30
157
+ * })
158
+ */
159
+ getUsage(request: AthenaIntelligence.GetUsageWorkspacesRequest, requestOptions?: WorkspacesClient.RequestOptions): core.HttpResponsePromise<AthenaIntelligence.WorkspaceUsageResponseOut>;
160
+ private __getUsage;
143
161
  }
@@ -618,4 +618,90 @@ export class WorkspacesClient {
618
618
  }
619
619
  });
620
620
  }
621
+ /**
622
+ * Aggregate LLM token usage (and cost) for one workspace over the last `days` days: workspace totals plus per-member, per-day and per-Computer breakdowns. Token counters are summed from each session's usage ledger; dry-run (test) sessions are reported separately and excluded from the totals. Requires workspace owner or manager (or Athena admin) permissions — the same gate as the in-app Usage page.
623
+ *
624
+ * @param {AthenaIntelligence.GetUsageWorkspacesRequest} request
625
+ * @param {WorkspacesClient.RequestOptions} requestOptions - Request-specific configuration.
626
+ *
627
+ * @throws {@link AthenaIntelligence.ForbiddenError}
628
+ * @throws {@link AthenaIntelligence.NotFoundError}
629
+ * @throws {@link AthenaIntelligence.UnprocessableEntityError}
630
+ *
631
+ * @example
632
+ * await client.workspaces.getUsage({
633
+ * workspace_id: "workspace_id",
634
+ * days: 30
635
+ * })
636
+ */
637
+ getUsage(request, requestOptions) {
638
+ return core.HttpResponsePromise.fromPromise(this.__getUsage(request, requestOptions));
639
+ }
640
+ __getUsage(request, requestOptions) {
641
+ return __awaiter(this, void 0, void 0, function* () {
642
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
643
+ const { workspace_id: workspaceId, days } = request;
644
+ const _queryParams = {};
645
+ if (days != null) {
646
+ _queryParams.days = days.toString();
647
+ }
648
+ const _authRequest = yield this._options.authProvider.getAuthRequest();
649
+ const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
650
+ "X-Athena-Session-Credential": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.sessionCredential) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.sessionCredential,
651
+ }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers);
652
+ const _response = yield ((_d = this._options.fetcher) !== null && _d !== void 0 ? _d : core.fetcher)({
653
+ url: core.url.join((_f = (_e = (yield core.Supplier.get(this._options.baseUrl))) !== null && _e !== void 0 ? _e : (yield core.Supplier.get(this._options.environment))) !== null && _f !== void 0 ? _f : environments.AthenaIntelligenceEnvironment.Production, `api/v0/workspaces/${core.url.encodePathParam(workspaceId)}/usage`),
654
+ method: "GET",
655
+ headers: _headers,
656
+ queryParameters: Object.assign(Object.assign({}, _queryParams), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams),
657
+ timeoutMs: ((_j = (_g = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _g !== void 0 ? _g : (_h = this._options) === null || _h === void 0 ? void 0 : _h.timeoutInSeconds) !== null && _j !== void 0 ? _j : 60) * 1000,
658
+ maxRetries: (_k = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _k !== void 0 ? _k : (_l = this._options) === null || _l === void 0 ? void 0 : _l.maxRetries,
659
+ abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
660
+ fetchFn: (_m = this._options) === null || _m === void 0 ? void 0 : _m.fetch,
661
+ logging: this._options.logging,
662
+ });
663
+ if (_response.ok) {
664
+ return {
665
+ data: _response.body,
666
+ rawResponse: _response.rawResponse,
667
+ };
668
+ }
669
+ if (_response.error.reason === "status-code") {
670
+ switch (_response.error.statusCode) {
671
+ case 403:
672
+ throw new AthenaIntelligence.ForbiddenError(_response.error.body, _response.rawResponse);
673
+ case 404:
674
+ throw new AthenaIntelligence.NotFoundError(_response.error.body, _response.rawResponse);
675
+ case 422:
676
+ throw new AthenaIntelligence.UnprocessableEntityError(_response.error.body, _response.rawResponse);
677
+ default:
678
+ throw new errors.AthenaIntelligenceError({
679
+ statusCode: _response.error.statusCode,
680
+ body: _response.error.body,
681
+ rawResponse: _response.rawResponse,
682
+ });
683
+ }
684
+ }
685
+ switch (_response.error.reason) {
686
+ case "non-json":
687
+ throw new errors.AthenaIntelligenceError({
688
+ statusCode: _response.error.statusCode,
689
+ body: _response.error.rawBody,
690
+ rawResponse: _response.rawResponse,
691
+ });
692
+ case "body-is-null":
693
+ throw new errors.AthenaIntelligenceError({
694
+ statusCode: _response.error.statusCode,
695
+ rawResponse: _response.rawResponse,
696
+ });
697
+ case "timeout":
698
+ throw new errors.AthenaIntelligenceTimeoutError("Timeout exceeded when calling GET /api/v0/workspaces/{workspace_id}/usage.");
699
+ case "unknown":
700
+ throw new errors.AthenaIntelligenceError({
701
+ message: _response.error.errorMessage,
702
+ rawResponse: _response.rawResponse,
703
+ });
704
+ }
705
+ });
706
+ }
621
707
  }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @example
3
+ * {
4
+ * workspace_id: "workspace_id",
5
+ * days: 30
6
+ * }
7
+ */
8
+ export interface GetUsageWorkspacesRequest {
9
+ workspace_id: string;
10
+ /** Reporting window in days, ending now (1-365) */
11
+ days?: number;
12
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -1,6 +1,7 @@
1
1
  export type { CreatePresenceTokenWorkspacesRequest } from "./CreatePresenceTokenWorkspacesRequest.mjs";
2
2
  export type { GetConfigurationWorkspacesRequest } from "./GetConfigurationWorkspacesRequest.mjs";
3
3
  export type { GetToolRegistryWorkspacesRequest } from "./GetToolRegistryWorkspacesRequest.mjs";
4
+ export type { GetUsageWorkspacesRequest } from "./GetUsageWorkspacesRequest.mjs";
4
5
  export type { PresenceResolveRequestIn } from "./PresenceResolveRequestIn.mjs";
5
6
  export type { SearchMembersWorkspacesRequest } from "./SearchMembersWorkspacesRequest.mjs";
6
7
  export type { UpdateWorkspaceConfigurationRequestIn } from "./UpdateWorkspaceConfigurationRequestIn.mjs";
@@ -0,0 +1,22 @@
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
+ /**
3
+ * Usage attributed to one Computer asset over the window.
4
+ */
5
+ export interface WorkspaceUsageComputerOut {
6
+ /** The Computer asset ID */
7
+ computer_asset_id: string;
8
+ /** Whether the Computer is archived */
9
+ is_archived: boolean;
10
+ /** When the most recent usage session was created */
11
+ last_session_at?: string | null;
12
+ /** Number of successful model calls */
13
+ request_count: number;
14
+ /** Number of usage sessions */
15
+ session_count: number;
16
+ /** The Computer's title */
17
+ title?: string | null;
18
+ /** Token counters behind this Computer's usage */
19
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
20
+ /** Total LLM cost in USD */
21
+ total_cost_usd: number;
22
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,14 @@
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
+ /**
3
+ * Usage of the workspace on one UTC day.
4
+ */
5
+ export interface WorkspaceUsageDayOut {
6
+ /** Date in YYYY-MM-DD format (UTC) */
7
+ date: string;
8
+ /** Number of sessions created on the day */
9
+ session_count: number;
10
+ /** Token counters for the day */
11
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
12
+ /** Total LLM cost in USD for the day */
13
+ total_cost_usd: number;
14
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,36 @@
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
+ /**
3
+ * Aggregated LLM token and cost usage for one workspace.
4
+ */
5
+ export interface WorkspaceUsageResponseOut {
6
+ /** Users with at least one session */
7
+ active_users: number;
8
+ /** Portion of total_cost_usd produced by Computers */
9
+ computer_cost_usd: number;
10
+ /** Number of Computer usage sessions */
11
+ computer_sessions: number;
12
+ /** Portion of tokens produced by Computers' LLM usage (already included in tokens, never additive) */
13
+ computer_tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
14
+ /** Per-day breakdown, oldest first */
15
+ daily: AthenaIntelligence.WorkspaceUsageDayOut[];
16
+ /** Length of the reporting window in days */
17
+ days: number;
18
+ /** Cost of dry-run (test) sessions */
19
+ dry_run_cost_usd: number;
20
+ /** Number of dry-run (test) sessions */
21
+ dry_run_sessions: number;
22
+ /** Token counters from dry-run (test) sessions, excluded from tokens */
23
+ dry_run_tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
24
+ /** Per-Computer breakdown, highest cost first */
25
+ per_computer: AthenaIntelligence.WorkspaceUsageComputerOut[];
26
+ /** Per-member breakdown, highest cost first */
27
+ per_user: AthenaIntelligence.WorkspaceUsageUserOut[];
28
+ /** Token counters across the workspace's sessions in the window, excluding dry-run (test) sessions */
29
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
30
+ /** Total LLM cost in USD */
31
+ total_cost_usd: number;
32
+ /** Number of sessions in the window */
33
+ total_sessions: number;
34
+ /** The workspace ID */
35
+ workspace_id: string;
36
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Token counters summed from the sessions' LLM usage ledgers.
3
+ */
4
+ export interface WorkspaceUsageTokensOut {
5
+ /** Input tokens written to the provider's prompt cache */
6
+ cache_creation_input_tokens: number;
7
+ /** Input tokens served from the provider's prompt cache */
8
+ cache_read_input_tokens: number;
9
+ /** Input (prompt) tokens, including cached reads */
10
+ input_tokens: number;
11
+ /** Output (completion) tokens, including reasoning tokens */
12
+ output_tokens: number;
13
+ /** Output tokens spent on reasoning */
14
+ reasoning_output_tokens: number;
15
+ /** Total tokens (input + output) */
16
+ total_tokens: number;
17
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -0,0 +1,22 @@
1
+ import type * as AthenaIntelligence from "../index.mjs";
2
+ /**
3
+ * Usage of one workspace member over the window.
4
+ */
5
+ export interface WorkspaceUsageUserOut {
6
+ /** The user's email */
7
+ email: string;
8
+ /** First name */
9
+ first_name?: string | null;
10
+ /** Last name */
11
+ last_name?: string | null;
12
+ /** When the user's most recent session was created */
13
+ last_session_at?: string | null;
14
+ /** Number of sessions */
15
+ session_count: number;
16
+ /** Token counters across the user's sessions */
17
+ tokens: AthenaIntelligence.WorkspaceUsageTokensOut;
18
+ /** Total LLM cost in USD */
19
+ total_cost_usd: number;
20
+ /** The user ID */
21
+ user_id: string;
22
+ }
@@ -0,0 +1,2 @@
1
+ // This file was auto-generated by Fern from our API Definition.
2
+ export {};
@@ -168,4 +168,9 @@ export * from "./WorkspaceMemberSearchResponseOut.mjs";
168
168
  export * from "./WorkspaceShareAccess.mjs";
169
169
  export * from "./WorkspaceToolRegistryResponseOut.mjs";
170
170
  export * from "./WorkspaceToolRegistryToolOut.mjs";
171
+ export * from "./WorkspaceUsageComputerOut.mjs";
172
+ export * from "./WorkspaceUsageDayOut.mjs";
173
+ export * from "./WorkspaceUsageResponseOut.mjs";
174
+ export * from "./WorkspaceUsageTokensOut.mjs";
175
+ export * from "./WorkspaceUsageUserOut.mjs";
171
176
  export * from "./WrapStrategy.mjs";
@@ -168,4 +168,9 @@ export * from "./WorkspaceMemberSearchResponseOut.mjs";
168
168
  export * from "./WorkspaceShareAccess.mjs";
169
169
  export * from "./WorkspaceToolRegistryResponseOut.mjs";
170
170
  export * from "./WorkspaceToolRegistryToolOut.mjs";
171
+ export * from "./WorkspaceUsageComputerOut.mjs";
172
+ export * from "./WorkspaceUsageDayOut.mjs";
173
+ export * from "./WorkspaceUsageResponseOut.mjs";
174
+ export * from "./WorkspaceUsageTokensOut.mjs";
175
+ export * from "./WorkspaceUsageUserOut.mjs";
171
176
  export * from "./WrapStrategy.mjs";
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "4.3.2249";
1
+ export declare const SDK_VERSION = "4.3.2251";
@@ -1 +1 @@
1
- export const SDK_VERSION = "4.3.2249";
1
+ export const SDK_VERSION = "4.3.2251";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@athenaintel/sdk",
3
- "version": "4.3.2249",
3
+ "version": "4.3.2251",
4
4
  "private": false,
5
5
  "repository": "github:Athena-Intel/athena-typescript",
6
6
  "type": "commonjs",
package/reference.md CHANGED
@@ -5847,6 +5847,72 @@ await client.workspaces.updateToolRegistry({
5847
5847
  </dl>
5848
5848
 
5849
5849
 
5850
+ </dd>
5851
+ </dl>
5852
+ </details>
5853
+
5854
+ <details><summary><code>client.workspaces.<a href="/src/api/resources/workspaces/client/Client.ts">getUsage</a>({ ...params }) -> AthenaIntelligence.WorkspaceUsageResponseOut</code></summary>
5855
+ <dl>
5856
+ <dd>
5857
+
5858
+ #### 📝 Description
5859
+
5860
+ <dl>
5861
+ <dd>
5862
+
5863
+ <dl>
5864
+ <dd>
5865
+
5866
+ Aggregate LLM token usage (and cost) for one workspace over the last `days` days: workspace totals plus per-member, per-day and per-Computer breakdowns. Token counters are summed from each session's usage ledger; dry-run (test) sessions are reported separately and excluded from the totals. Requires workspace owner or manager (or Athena admin) permissions — the same gate as the in-app Usage page.
5867
+ </dd>
5868
+ </dl>
5869
+ </dd>
5870
+ </dl>
5871
+
5872
+ #### 🔌 Usage
5873
+
5874
+ <dl>
5875
+ <dd>
5876
+
5877
+ <dl>
5878
+ <dd>
5879
+
5880
+ ```typescript
5881
+ await client.workspaces.getUsage({
5882
+ workspace_id: "workspace_id",
5883
+ days: 30
5884
+ });
5885
+
5886
+ ```
5887
+ </dd>
5888
+ </dl>
5889
+ </dd>
5890
+ </dl>
5891
+
5892
+ #### ⚙️ Parameters
5893
+
5894
+ <dl>
5895
+ <dd>
5896
+
5897
+ <dl>
5898
+ <dd>
5899
+
5900
+ **request:** `AthenaIntelligence.GetUsageWorkspacesRequest`
5901
+
5902
+ </dd>
5903
+ </dl>
5904
+
5905
+ <dl>
5906
+ <dd>
5907
+
5908
+ **requestOptions:** `WorkspacesClient.RequestOptions`
5909
+
5910
+ </dd>
5911
+ </dl>
5912
+ </dd>
5913
+ </dl>
5914
+
5915
+
5850
5916
  </dd>
5851
5917
  </dl>
5852
5918
  </details>
@@ -5938,7 +6004,7 @@ await client.agents.general.invoke({
5938
6004
  <dl>
5939
6005
  <dd>
5940
6006
 
5941
- Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it.
6007
+ Start a general-agent run and return immediately with a `thread_id`. Use this instead of `/agents/general/invoke` for any call that may take more than a few seconds (tool use, multi-step work), so the HTTP connection is never held open past client or proxy timeouts. Poll `GET /threads/{thread_id}/status` until `status` is `completed` or `failed`; pass `include_messages=true` to read the agent's reply. Supply the `thread_id` of a general-agent thread you can access to continue it; 404/403 when it is unknown/not yours, 409 while a run is still in progress on it or while it is archived (restore it to continue it).
5942
6008
  </dd>
5943
6009
  </dl>
5944
6010
  </dd>