@lumoauth/api-client 1.3.0 → 1.4.0

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 (64) hide show
  1. package/.openapi-generator/FILES +10 -0
  2. package/README.md +9 -2
  3. package/api/admin-agents-api.ts +130 -0
  4. package/api/agents-api.ts +118 -0
  5. package/dist/api/admin-agents-api.d.ts +73 -0
  6. package/dist/api/admin-agents-api.js +82 -0
  7. package/dist/api/agents-api.d.ts +65 -0
  8. package/dist/api/agents-api.js +77 -0
  9. package/dist/esm/api/admin-agents-api.d.ts +73 -0
  10. package/dist/esm/api/admin-agents-api.js +82 -0
  11. package/dist/esm/api/agents-api.d.ts +65 -0
  12. package/dist/esm/api/agents-api.js +77 -0
  13. package/dist/esm/models/abac-attribute-definition.d.ts +1 -1
  14. package/dist/esm/models/abac-resource-attribute.d.ts +1 -1
  15. package/dist/esm/models/admin-agents-report-usage-request.d.ts +30 -0
  16. package/dist/esm/models/admin-agents-report-usage-request.js +14 -0
  17. package/dist/esm/models/admin-agents-report-usage-response-data-recorded.d.ts +30 -0
  18. package/dist/esm/models/admin-agents-report-usage-response-data-recorded.js +14 -0
  19. package/dist/esm/models/admin-agents-report-usage-response-data.d.ts +33 -0
  20. package/dist/esm/models/admin-agents-report-usage-response-data.js +14 -0
  21. package/dist/esm/models/admin-agents-report-usage-response.d.ts +25 -0
  22. package/dist/esm/models/admin-agents-report-usage-response.js +14 -0
  23. package/dist/esm/models/index.d.ts +5 -0
  24. package/dist/esm/models/index.js +5 -0
  25. package/dist/esm/models/report-agent-usage-response.d.ts +33 -0
  26. package/dist/esm/models/report-agent-usage-response.js +14 -0
  27. package/dist/esm/models/set-user-attribute-response-data.d.ts +1 -1
  28. package/dist/esm/models/userinfo-response.d.ts +8 -0
  29. package/dist/models/abac-attribute-definition.d.ts +1 -1
  30. package/dist/models/abac-resource-attribute.d.ts +1 -1
  31. package/dist/models/admin-agents-report-usage-request.d.ts +30 -0
  32. package/dist/models/admin-agents-report-usage-request.js +15 -0
  33. package/dist/models/admin-agents-report-usage-response-data-recorded.d.ts +30 -0
  34. package/dist/models/admin-agents-report-usage-response-data-recorded.js +15 -0
  35. package/dist/models/admin-agents-report-usage-response-data.d.ts +33 -0
  36. package/dist/models/admin-agents-report-usage-response-data.js +15 -0
  37. package/dist/models/admin-agents-report-usage-response.d.ts +25 -0
  38. package/dist/models/admin-agents-report-usage-response.js +15 -0
  39. package/dist/models/index.d.ts +5 -0
  40. package/dist/models/index.js +5 -0
  41. package/dist/models/report-agent-usage-response.d.ts +33 -0
  42. package/dist/models/report-agent-usage-response.js +15 -0
  43. package/dist/models/set-user-attribute-response-data.d.ts +1 -1
  44. package/dist/models/userinfo-response.d.ts +8 -0
  45. package/docs/AdminAgentsApi.md +63 -0
  46. package/docs/AdminAgentsReportUsageRequest.md +22 -0
  47. package/docs/AdminAgentsReportUsageResponse.md +20 -0
  48. package/docs/AdminAgentsReportUsageResponseData.md +22 -0
  49. package/docs/AdminAgentsReportUsageResponseDataRecorded.md +22 -0
  50. package/docs/AgentsApi.md +59 -0
  51. package/docs/OIDCApi.md +2 -2
  52. package/docs/ReportAgentUsageResponse.md +22 -0
  53. package/docs/UserinfoResponse.md +2 -0
  54. package/models/abac-attribute-definition.ts +1 -1
  55. package/models/abac-resource-attribute.ts +1 -1
  56. package/models/admin-agents-report-usage-request.ts +36 -0
  57. package/models/admin-agents-report-usage-response-data-recorded.ts +36 -0
  58. package/models/admin-agents-report-usage-response-data.ts +39 -0
  59. package/models/admin-agents-report-usage-response.ts +33 -0
  60. package/models/index.ts +5 -0
  61. package/models/report-agent-usage-response.ts +39 -0
  62. package/models/set-user-attribute-response-data.ts +1 -1
  63. package/models/userinfo-response.ts +6 -0
  64. package/package.json +1 -1
@@ -64,6 +64,10 @@ docs/AdminAgentsGenerateTokenResponseData.md
64
64
  docs/AdminAgentsGetResponse.md
65
65
  docs/AdminAgentsGetScopesResponse.md
66
66
  docs/AdminAgentsListResponse.md
67
+ docs/AdminAgentsReportUsageRequest.md
68
+ docs/AdminAgentsReportUsageResponse.md
69
+ docs/AdminAgentsReportUsageResponseData.md
70
+ docs/AdminAgentsReportUsageResponseDataRecorded.md
67
71
  docs/AdminAgentsRevokeKeyResponse.md
68
72
  docs/AdminAgentsRotateCredentialsResponse.md
69
73
  docs/AdminAgentsSetScopesRequest.md
@@ -405,6 +409,7 @@ docs/RegisteredClientMetadata.md
405
409
  docs/RemoveUserGroupResponse.md
406
410
  docs/RemoveUserPermissionResponse.md
407
411
  docs/RemoveUserRoleResponse.md
412
+ docs/ReportAgentUsageResponse.md
408
413
  docs/RequestPermissionRequest.md
409
414
  docs/RequestPermissionResponse.md
410
415
  docs/RevokeAgentTokenRequest.md
@@ -491,6 +496,10 @@ models/admin-agents-generate-token-response.ts
491
496
  models/admin-agents-get-response.ts
492
497
  models/admin-agents-get-scopes-response.ts
493
498
  models/admin-agents-list-response.ts
499
+ models/admin-agents-report-usage-request.ts
500
+ models/admin-agents-report-usage-response-data-recorded.ts
501
+ models/admin-agents-report-usage-response-data.ts
502
+ models/admin-agents-report-usage-response.ts
494
503
  models/admin-agents-revoke-key-response.ts
495
504
  models/admin-agents-rotate-credentials-response.ts
496
505
  models/admin-agents-set-scopes-request.ts
@@ -810,6 +819,7 @@ models/registered-client-metadata.ts
810
819
  models/remove-user-group-response.ts
811
820
  models/remove-user-permission-response.ts
812
821
  models/remove-user-role-response.ts
822
+ models/report-agent-usage-response.ts
813
823
  models/request-permission-request.ts
814
824
  models/request-permission-response.ts
815
825
  models/revoke-agent-token-request.ts
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  > `github.com/lumoauth/lumo-auth-go`), prefer it.
8
8
  > Do not edit by hand: changes are overwritten on the next regeneration.
9
9
 
10
- ## @lumoauth/api-client@1.3.0
10
+ ## @lumoauth/api-client@1.4.0
11
11
 
12
12
  This generator creates TypeScript/JavaScript client that utilizes [axios](https://github.com/axios/axios). The generated Node module can be used in the following environments:
13
13
 
@@ -45,7 +45,7 @@ navigate to the folder of your consuming project and run one of the following co
45
45
  _published:_
46
46
 
47
47
  ```
48
- npm install @lumoauth/api-client@1.3.0 --save
48
+ npm install @lumoauth/api-client@1.4.0 --save
49
49
  ```
50
50
 
51
51
  _unPublished (not recommended):_
@@ -100,6 +100,7 @@ Class | Method | HTTP request | Description
100
100
  *AdminAgentsApi* | [**adminAgentsGet**](docs/AdminAgentsApi.md#adminagentsget) | **GET** /orgs/{orgId}/api/v1/admin/agents/{agentId} | Get a single agent by ID or agentId
101
101
  *AdminAgentsApi* | [**adminAgentsGetScopes**](docs/AdminAgentsApi.md#adminagentsgetscopes) | **GET** /orgs/{orgId}/api/v1/admin/agents/{agentId}/scopes | Get agent scopes/capabilities
102
102
  *AdminAgentsApi* | [**adminAgentsList**](docs/AdminAgentsApi.md#adminagentslist) | **GET** /orgs/{orgId}/api/v1/admin/agents | List all agents in the tenant
103
+ *AdminAgentsApi* | [**adminAgentsReportUsage**](docs/AdminAgentsApi.md#adminagentsreportusage) | **POST** /orgs/{orgId}/api/v1/admin/agents/{agentId}/usage | Report model tokens and cost for an agent
103
104
  *AdminAgentsApi* | [**adminAgentsRevokeKey**](docs/AdminAgentsApi.md#adminagentsrevokekey) | **POST** /orgs/{orgId}/api/v1/admin/agents/{agentId}/revoke-key | Revoke agent API key (nullify it so it can no longer authenticate)
104
105
  *AdminAgentsApi* | [**adminAgentsRotateCredentials**](docs/AdminAgentsApi.md#adminagentsrotatecredentials) | **POST** /orgs/{orgId}/api/v1/admin/agents/{agentId}/rotate-credentials | Rotate agent credentials
105
106
  *AdminAgentsApi* | [**adminAgentsSetScopes**](docs/AdminAgentsApi.md#adminagentssetscopes) | **PUT** /orgs/{orgId}/api/v1/admin/agents/{agentId}/scopes | Update agent scopes/capabilities
@@ -313,6 +314,7 @@ Class | Method | HTTP request | Description
313
314
  *AgentsApi* | [**getApprovalStatus**](docs/AgentsApi.md#getapprovalstatus) | **GET** /orgs/{orgId}/api/v1/agents/me/approvals/{token}/status |
314
315
  *AgentsApi* | [**getCurrentAgent**](docs/AgentsApi.md#getcurrentagent) | **GET** /orgs/{orgId}/api/v1/agents/me | Get details about the currently authenticated agent
315
316
  *AgentsApi* | [**registerAgent**](docs/AgentsApi.md#registeragent) | **POST** /orgs/{orgId}/api/v1/agents/register | Register (or re-register) an agent
317
+ *AgentsApi* | [**reportAgentUsage**](docs/AgentsApi.md#reportagentusage) | **POST** /orgs/{orgId}/api/v1/agents/me/usage | Report the model tokens and cost that the agent used
316
318
  *AgentsApi* | [**verifyAgentCard**](docs/AgentsApi.md#verifyagentcard) | **POST** /orgs/{orgId}/api/v1/agents/agent-card/verify | Verify a signed A2A agent card
317
319
  *AuthorizationApi* | [**checkAbac**](docs/AuthorizationApi.md#checkabac) | **POST** /orgs/{orgId}/api/v1/abac/check | Evaluate an ABAC policy decision for the caller
318
320
  *AuthorizationApi* | [**checkAbacBulk**](docs/AuthorizationApi.md#checkabacbulk) | **POST** /orgs/{orgId}/api/v1/abac/check-bulk | Evaluate up to 100 ABAC checks for the caller in one call
@@ -425,6 +427,10 @@ Class | Method | HTTP request | Description
425
427
  - [AdminAgentsGetResponse](docs/AdminAgentsGetResponse.md)
426
428
  - [AdminAgentsGetScopesResponse](docs/AdminAgentsGetScopesResponse.md)
427
429
  - [AdminAgentsListResponse](docs/AdminAgentsListResponse.md)
430
+ - [AdminAgentsReportUsageRequest](docs/AdminAgentsReportUsageRequest.md)
431
+ - [AdminAgentsReportUsageResponse](docs/AdminAgentsReportUsageResponse.md)
432
+ - [AdminAgentsReportUsageResponseData](docs/AdminAgentsReportUsageResponseData.md)
433
+ - [AdminAgentsReportUsageResponseDataRecorded](docs/AdminAgentsReportUsageResponseDataRecorded.md)
428
434
  - [AdminAgentsRevokeKeyResponse](docs/AdminAgentsRevokeKeyResponse.md)
429
435
  - [AdminAgentsRotateCredentialsResponse](docs/AdminAgentsRotateCredentialsResponse.md)
430
436
  - [AdminAgentsSetScopesRequest](docs/AdminAgentsSetScopesRequest.md)
@@ -743,6 +749,7 @@ Class | Method | HTTP request | Description
743
749
  - [RemoveUserGroupResponse](docs/RemoveUserGroupResponse.md)
744
750
  - [RemoveUserPermissionResponse](docs/RemoveUserPermissionResponse.md)
745
751
  - [RemoveUserRoleResponse](docs/RemoveUserRoleResponse.md)
752
+ - [ReportAgentUsageResponse](docs/ReportAgentUsageResponse.md)
746
753
  - [RequestPermissionRequest](docs/RequestPermissionRequest.md)
747
754
  - [RequestPermissionResponse](docs/RequestPermissionResponse.md)
748
755
  - [RevokeAgentTokenRequest](docs/RevokeAgentTokenRequest.md)
@@ -48,6 +48,10 @@ import type { AdminAgentsGetScopesResponse } from '../models';
48
48
  // @ts-ignore
49
49
  import type { AdminAgentsListResponse } from '../models';
50
50
  // @ts-ignore
51
+ import type { AdminAgentsReportUsageRequest } from '../models';
52
+ // @ts-ignore
53
+ import type { AdminAgentsReportUsageResponse } from '../models';
54
+ // @ts-ignore
51
55
  import type { AdminAgentsRevokeKeyResponse } from '../models';
52
56
  // @ts-ignore
53
57
  import type { AdminAgentsRotateCredentialsResponse } from '../models';
@@ -562,6 +566,57 @@ export const AdminAgentsApiAxiosParamCreator = function (configuration?: Configu
562
566
  options: localVarRequestOptions,
563
567
  };
564
568
  },
569
+ /**
570
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
571
+ * @summary Report model tokens and cost for an agent
572
+ * @param {string} orgId
573
+ * @param {string} agentId
574
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
575
+ * @param {*} [options] Override http request option.
576
+ * @throws {RequiredError}
577
+ */
578
+ adminAgentsReportUsage: async (orgId: string, agentId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
579
+ // verify required parameter 'orgId' is not null or undefined
580
+ assertParamExists('adminAgentsReportUsage', 'orgId', orgId)
581
+ // verify required parameter 'agentId' is not null or undefined
582
+ assertParamExists('adminAgentsReportUsage', 'agentId', agentId)
583
+ // verify required parameter 'adminAgentsReportUsageRequest' is not null or undefined
584
+ assertParamExists('adminAgentsReportUsage', 'adminAgentsReportUsageRequest', adminAgentsReportUsageRequest)
585
+ const localVarPath = `/orgs/{orgId}/api/v1/admin/agents/{agentId}/usage`
586
+ .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId)))
587
+ .replace(`{${"agentId"}}`, encodeURIComponent(String(agentId)));
588
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
589
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
590
+ let baseOptions;
591
+ if (configuration) {
592
+ baseOptions = configuration.baseOptions;
593
+ }
594
+
595
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
596
+ const localVarHeaderParameter = {} as any;
597
+ const localVarQueryParameter = {} as any;
598
+
599
+ // authentication ApiKeyAuth required
600
+ await setApiKeyToObject(localVarHeaderParameter, "X-API-Key", configuration)
601
+
602
+ // authentication BearerAuth required
603
+ // http bearer authentication required
604
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
605
+
606
+
607
+
608
+ localVarHeaderParameter['Content-Type'] = 'application/json';
609
+
610
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
611
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
612
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
613
+ localVarRequestOptions.data = serializeDataIfNeeded(adminAgentsReportUsageRequest, localVarRequestOptions, configuration)
614
+
615
+ return {
616
+ url: toPathString(localVarUrlObj),
617
+ options: localVarRequestOptions,
618
+ };
619
+ },
565
620
  /**
566
621
  *
567
622
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -969,6 +1024,21 @@ export const AdminAgentsApiFp = function(configuration?: Configuration) {
969
1024
  const localVarOperationServerBasePath = operationServerMap['AdminAgentsApi.adminAgentsList']?.[localVarOperationServerIndex]?.url;
970
1025
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
971
1026
  },
1027
+ /**
1028
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
1029
+ * @summary Report model tokens and cost for an agent
1030
+ * @param {string} orgId
1031
+ * @param {string} agentId
1032
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
1033
+ * @param {*} [options] Override http request option.
1034
+ * @throws {RequiredError}
1035
+ */
1036
+ async adminAgentsReportUsage(orgId: string, agentId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminAgentsReportUsageResponse>> {
1037
+ const localVarAxiosArgs = await localVarAxiosParamCreator.adminAgentsReportUsage(orgId, agentId, adminAgentsReportUsageRequest, options);
1038
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
1039
+ const localVarOperationServerBasePath = operationServerMap['AdminAgentsApi.adminAgentsReportUsage']?.[localVarOperationServerIndex]?.url;
1040
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
1041
+ },
972
1042
  /**
973
1043
  *
974
1044
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -1162,6 +1232,16 @@ export const AdminAgentsApiFactory = function (configuration?: Configuration, ba
1162
1232
  adminAgentsList(requestParameters: AdminAgentsApiAdminAgentsListRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsListResponse> {
1163
1233
  return localVarFp.adminAgentsList(requestParameters.orgId, options).then((request) => request(axios, basePath));
1164
1234
  },
1235
+ /**
1236
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
1237
+ * @summary Report model tokens and cost for an agent
1238
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
1239
+ * @param {*} [options] Override http request option.
1240
+ * @throws {RequiredError}
1241
+ */
1242
+ adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsReportUsageResponse> {
1243
+ return localVarFp.adminAgentsReportUsage(requestParameters.orgId, requestParameters.agentId, requestParameters.adminAgentsReportUsageRequest, options).then((request) => request(axios, basePath));
1244
+ },
1165
1245
  /**
1166
1246
  *
1167
1247
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -1331,6 +1411,16 @@ export interface AdminAgentsApiInterface {
1331
1411
  */
1332
1412
  adminAgentsList(requestParameters: AdminAgentsApiAdminAgentsListRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsListResponse>;
1333
1413
 
1414
+ /**
1415
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
1416
+ * @summary Report model tokens and cost for an agent
1417
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
1418
+ * @param {*} [options] Override http request option.
1419
+ * @throws {RequiredError}
1420
+ * @memberof AdminAgentsApiInterface
1421
+ */
1422
+ adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsReportUsageResponse>;
1423
+
1334
1424
  /**
1335
1425
  *
1336
1426
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -1614,6 +1704,34 @@ export interface AdminAgentsApiAdminAgentsListRequest {
1614
1704
  readonly orgId: string
1615
1705
  }
1616
1706
 
1707
+ /**
1708
+ * Request parameters for adminAgentsReportUsage operation in AdminAgentsApi.
1709
+ * @export
1710
+ * @interface AdminAgentsApiAdminAgentsReportUsageRequest
1711
+ */
1712
+ export interface AdminAgentsApiAdminAgentsReportUsageRequest {
1713
+ /**
1714
+ *
1715
+ * @type {string}
1716
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
1717
+ */
1718
+ readonly orgId: string
1719
+
1720
+ /**
1721
+ *
1722
+ * @type {string}
1723
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
1724
+ */
1725
+ readonly agentId: string
1726
+
1727
+ /**
1728
+ *
1729
+ * @type {AdminAgentsReportUsageRequest}
1730
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
1731
+ */
1732
+ readonly adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest
1733
+ }
1734
+
1617
1735
  /**
1618
1736
  * Request parameters for adminAgentsRevokeKey operation in AdminAgentsApi.
1619
1737
  * @export
@@ -1879,6 +1997,18 @@ export class AdminAgentsApi extends BaseAPI implements AdminAgentsApiInterface {
1879
1997
  return AdminAgentsApiFp(this.configuration).adminAgentsList(requestParameters.orgId, options).then((request) => request(this.axios, this.basePath));
1880
1998
  }
1881
1999
 
2000
+ /**
2001
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
2002
+ * @summary Report model tokens and cost for an agent
2003
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
2004
+ * @param {*} [options] Override http request option.
2005
+ * @throws {RequiredError}
2006
+ * @memberof AdminAgentsApi
2007
+ */
2008
+ public adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig) {
2009
+ return AdminAgentsApiFp(this.configuration).adminAgentsReportUsage(requestParameters.orgId, requestParameters.agentId, requestParameters.adminAgentsReportUsageRequest, options).then((request) => request(this.axios, this.basePath));
2010
+ }
2011
+
1882
2012
  /**
1883
2013
  *
1884
2014
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
package/api/agents-api.ts CHANGED
@@ -22,6 +22,8 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj
22
22
  // @ts-ignore
23
23
  import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
24
24
  // @ts-ignore
25
+ import type { AdminAgentsReportUsageRequest } from '../models';
26
+ // @ts-ignore
25
27
  import type { AskRequest } from '../models';
26
28
  // @ts-ignore
27
29
  import type { AskResponse } from '../models';
@@ -46,6 +48,8 @@ import type { GetCurrentAgentResponse } from '../models';
46
48
  // @ts-ignore
47
49
  import type { RegisterAgentResponse } from '../models';
48
50
  // @ts-ignore
51
+ import type { ReportAgentUsageResponse } from '../models';
52
+ // @ts-ignore
49
53
  import type { SignedAgentCard } from '../models';
50
54
  // @ts-ignore
51
55
  import type { VerifyAgentCardResponse } from '../models';
@@ -410,6 +414,53 @@ export const AgentsApiAxiosParamCreator = function (configuration?: Configuratio
410
414
  options: localVarRequestOptions,
411
415
  };
412
416
  },
417
+ /**
418
+ * Adds the reported tokens and cost to the agent\'s budget windows (current UTC hour, day and month). LumoAuth does not see model calls, so token and cost limits apply only to usage that is reported here or through the Admin API. The report adds no API call and is accepted even when the budget is spent. Agent credentials only; portal test tokens are refused. Rate limited per agent.
419
+ * @summary Report the model tokens and cost that the agent used
420
+ * @param {string} orgId
421
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
422
+ * @param {*} [options] Override http request option.
423
+ * @throws {RequiredError}
424
+ */
425
+ reportAgentUsage: async (orgId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
426
+ // verify required parameter 'orgId' is not null or undefined
427
+ assertParamExists('reportAgentUsage', 'orgId', orgId)
428
+ // verify required parameter 'adminAgentsReportUsageRequest' is not null or undefined
429
+ assertParamExists('reportAgentUsage', 'adminAgentsReportUsageRequest', adminAgentsReportUsageRequest)
430
+ const localVarPath = `/orgs/{orgId}/api/v1/agents/me/usage`
431
+ .replace(`{${"orgId"}}`, encodeURIComponent(String(orgId)));
432
+ // use dummy base URL string because the URL constructor only accepts absolute URLs.
433
+ const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
434
+ let baseOptions;
435
+ if (configuration) {
436
+ baseOptions = configuration.baseOptions;
437
+ }
438
+
439
+ const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options};
440
+ const localVarHeaderParameter = {} as any;
441
+ const localVarQueryParameter = {} as any;
442
+
443
+ // authentication ApiKeyAuth required
444
+ await setApiKeyToObject(localVarHeaderParameter, "X-API-Key", configuration)
445
+
446
+ // authentication BearerAuth required
447
+ // http bearer authentication required
448
+ await setBearerAuthToObject(localVarHeaderParameter, configuration)
449
+
450
+
451
+
452
+ localVarHeaderParameter['Content-Type'] = 'application/json';
453
+
454
+ setSearchParams(localVarUrlObj, localVarQueryParameter);
455
+ let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
456
+ localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
457
+ localVarRequestOptions.data = serializeDataIfNeeded(adminAgentsReportUsageRequest, localVarRequestOptions, configuration)
458
+
459
+ return {
460
+ url: toPathString(localVarUrlObj),
461
+ options: localVarRequestOptions,
462
+ };
463
+ },
413
464
  /**
414
465
  * Authenticated (user, agent or API key of this organization). The body is the signed card itself, or {\"card\": {...}, \"jwks_uri\": \"https://...\"} to verify against an external issuer\'s key set (SSRF-guarded); by default the organization\'s own JWKS is used.
415
466
  * @summary Verify a signed A2A agent card
@@ -576,6 +627,20 @@ export const AgentsApiFp = function(configuration?: Configuration) {
576
627
  const localVarOperationServerBasePath = operationServerMap['AgentsApi.registerAgent']?.[localVarOperationServerIndex]?.url;
577
628
  return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
578
629
  },
630
+ /**
631
+ * Adds the reported tokens and cost to the agent\'s budget windows (current UTC hour, day and month). LumoAuth does not see model calls, so token and cost limits apply only to usage that is reported here or through the Admin API. The report adds no API call and is accepted even when the budget is spent. Agent credentials only; portal test tokens are refused. Rate limited per agent.
632
+ * @summary Report the model tokens and cost that the agent used
633
+ * @param {string} orgId
634
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
635
+ * @param {*} [options] Override http request option.
636
+ * @throws {RequiredError}
637
+ */
638
+ async reportAgentUsage(orgId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ReportAgentUsageResponse>> {
639
+ const localVarAxiosArgs = await localVarAxiosParamCreator.reportAgentUsage(orgId, adminAgentsReportUsageRequest, options);
640
+ const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
641
+ const localVarOperationServerBasePath = operationServerMap['AgentsApi.reportAgentUsage']?.[localVarOperationServerIndex]?.url;
642
+ return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
643
+ },
579
644
  /**
580
645
  * Authenticated (user, agent or API key of this organization). The body is the signed card itself, or {\"card\": {...}, \"jwks_uri\": \"https://...\"} to verify against an external issuer\'s key set (SSRF-guarded); by default the organization\'s own JWKS is used.
581
646
  * @summary Verify a signed A2A agent card
@@ -678,6 +743,16 @@ export const AgentsApiFactory = function (configuration?: Configuration, basePat
678
743
  registerAgent(requestParameters: AgentsApiRegisterAgentRequest, options?: RawAxiosRequestConfig): AxiosPromise<RegisterAgentResponse> {
679
744
  return localVarFp.registerAgent(requestParameters.orgId, options).then((request) => request(axios, basePath));
680
745
  },
746
+ /**
747
+ * Adds the reported tokens and cost to the agent\'s budget windows (current UTC hour, day and month). LumoAuth does not see model calls, so token and cost limits apply only to usage that is reported here or through the Admin API. The report adds no API call and is accepted even when the budget is spent. Agent credentials only; portal test tokens are refused. Rate limited per agent.
748
+ * @summary Report the model tokens and cost that the agent used
749
+ * @param {AgentsApiReportAgentUsageRequest} requestParameters Request parameters.
750
+ * @param {*} [options] Override http request option.
751
+ * @throws {RequiredError}
752
+ */
753
+ reportAgentUsage(requestParameters: AgentsApiReportAgentUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReportAgentUsageResponse> {
754
+ return localVarFp.reportAgentUsage(requestParameters.orgId, requestParameters.adminAgentsReportUsageRequest, options).then((request) => request(axios, basePath));
755
+ },
681
756
  /**
682
757
  * Authenticated (user, agent or API key of this organization). The body is the signed card itself, or {\"card\": {...}, \"jwks_uri\": \"https://...\"} to verify against an external issuer\'s key set (SSRF-guarded); by default the organization\'s own JWKS is used.
683
758
  * @summary Verify a signed A2A agent card
@@ -775,6 +850,16 @@ export interface AgentsApiInterface {
775
850
  */
776
851
  registerAgent(requestParameters: AgentsApiRegisterAgentRequest, options?: RawAxiosRequestConfig): AxiosPromise<RegisterAgentResponse>;
777
852
 
853
+ /**
854
+ * Adds the reported tokens and cost to the agent\'s budget windows (current UTC hour, day and month). LumoAuth does not see model calls, so token and cost limits apply only to usage that is reported here or through the Admin API. The report adds no API call and is accepted even when the budget is spent. Agent credentials only; portal test tokens are refused. Rate limited per agent.
855
+ * @summary Report the model tokens and cost that the agent used
856
+ * @param {AgentsApiReportAgentUsageRequest} requestParameters Request parameters.
857
+ * @param {*} [options] Override http request option.
858
+ * @throws {RequiredError}
859
+ * @memberof AgentsApiInterface
860
+ */
861
+ reportAgentUsage(requestParameters: AgentsApiReportAgentUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<ReportAgentUsageResponse>;
862
+
778
863
  /**
779
864
  * Authenticated (user, agent or API key of this organization). The body is the signed card itself, or {\"card\": {...}, \"jwks_uri\": \"https://...\"} to verify against an external issuer\'s key set (SSRF-guarded); by default the organization\'s own JWKS is used.
780
865
  * @summary Verify a signed A2A agent card
@@ -948,6 +1033,27 @@ export interface AgentsApiRegisterAgentRequest {
948
1033
  readonly orgId: string
949
1034
  }
950
1035
 
1036
+ /**
1037
+ * Request parameters for reportAgentUsage operation in AgentsApi.
1038
+ * @export
1039
+ * @interface AgentsApiReportAgentUsageRequest
1040
+ */
1041
+ export interface AgentsApiReportAgentUsageRequest {
1042
+ /**
1043
+ *
1044
+ * @type {string}
1045
+ * @memberof AgentsApiReportAgentUsage
1046
+ */
1047
+ readonly orgId: string
1048
+
1049
+ /**
1050
+ *
1051
+ * @type {AdminAgentsReportUsageRequest}
1052
+ * @memberof AgentsApiReportAgentUsage
1053
+ */
1054
+ readonly adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest
1055
+ }
1056
+
951
1057
  /**
952
1058
  * Request parameters for verifyAgentCard operation in AgentsApi.
953
1059
  * @export
@@ -1070,6 +1176,18 @@ export class AgentsApi extends BaseAPI implements AgentsApiInterface {
1070
1176
  return AgentsApiFp(this.configuration).registerAgent(requestParameters.orgId, options).then((request) => request(this.axios, this.basePath));
1071
1177
  }
1072
1178
 
1179
+ /**
1180
+ * Adds the reported tokens and cost to the agent\'s budget windows (current UTC hour, day and month). LumoAuth does not see model calls, so token and cost limits apply only to usage that is reported here or through the Admin API. The report adds no API call and is accepted even when the budget is spent. Agent credentials only; portal test tokens are refused. Rate limited per agent.
1181
+ * @summary Report the model tokens and cost that the agent used
1182
+ * @param {AgentsApiReportAgentUsageRequest} requestParameters Request parameters.
1183
+ * @param {*} [options] Override http request option.
1184
+ * @throws {RequiredError}
1185
+ * @memberof AgentsApi
1186
+ */
1187
+ public reportAgentUsage(requestParameters: AgentsApiReportAgentUsageRequest, options?: RawAxiosRequestConfig) {
1188
+ return AgentsApiFp(this.configuration).reportAgentUsage(requestParameters.orgId, requestParameters.adminAgentsReportUsageRequest, options).then((request) => request(this.axios, this.basePath));
1189
+ }
1190
+
1073
1191
  /**
1074
1192
  * Authenticated (user, agent or API key of this organization). The body is the signed card itself, or {\"card\": {...}, \"jwks_uri\": \"https://...\"} to verify against an external issuer\'s key set (SSRF-guarded); by default the organization\'s own JWKS is used.
1075
1193
  * @summary Verify a signed A2A agent card
@@ -25,6 +25,8 @@ import type { AdminAgentsGenerateTokenResponse } from '../models';
25
25
  import type { AdminAgentsGetResponse } from '../models';
26
26
  import type { AdminAgentsGetScopesResponse } from '../models';
27
27
  import type { AdminAgentsListResponse } from '../models';
28
+ import type { AdminAgentsReportUsageRequest } from '../models';
29
+ import type { AdminAgentsReportUsageResponse } from '../models';
28
30
  import type { AdminAgentsRevokeKeyResponse } from '../models';
29
31
  import type { AdminAgentsRotateCredentialsResponse } from '../models';
30
32
  import type { AdminAgentsSetScopesRequest } from '../models';
@@ -135,6 +137,16 @@ export declare const AdminAgentsApiAxiosParamCreator: (configuration?: Configura
135
137
  * @throws {RequiredError}
136
138
  */
137
139
  adminAgentsList: (orgId: string, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
140
+ /**
141
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
142
+ * @summary Report model tokens and cost for an agent
143
+ * @param {string} orgId
144
+ * @param {string} agentId
145
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
146
+ * @param {*} [options] Override http request option.
147
+ * @throws {RequiredError}
148
+ */
149
+ adminAgentsReportUsage: (orgId: string, agentId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig) => Promise<RequestArgs>;
138
150
  /**
139
151
  *
140
152
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -288,6 +300,16 @@ export declare const AdminAgentsApiFp: (configuration?: Configuration) => {
288
300
  * @throws {RequiredError}
289
301
  */
290
302
  adminAgentsList(orgId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminAgentsListResponse>>;
303
+ /**
304
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
305
+ * @summary Report model tokens and cost for an agent
306
+ * @param {string} orgId
307
+ * @param {string} agentId
308
+ * @param {AdminAgentsReportUsageRequest} adminAgentsReportUsageRequest
309
+ * @param {*} [options] Override http request option.
310
+ * @throws {RequiredError}
311
+ */
312
+ adminAgentsReportUsage(orgId: string, agentId: string, adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminAgentsReportUsageResponse>>;
291
313
  /**
292
314
  *
293
315
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -430,6 +452,14 @@ export declare const AdminAgentsApiFactory: (configuration?: Configuration, base
430
452
  * @throws {RequiredError}
431
453
  */
432
454
  adminAgentsList(requestParameters: AdminAgentsApiAdminAgentsListRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsListResponse>;
455
+ /**
456
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
457
+ * @summary Report model tokens and cost for an agent
458
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
459
+ * @param {*} [options] Override http request option.
460
+ * @throws {RequiredError}
461
+ */
462
+ adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsReportUsageResponse>;
433
463
  /**
434
464
  *
435
465
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -576,6 +606,15 @@ export interface AdminAgentsApiInterface {
576
606
  * @memberof AdminAgentsApiInterface
577
607
  */
578
608
  adminAgentsList(requestParameters: AdminAgentsApiAdminAgentsListRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsListResponse>;
609
+ /**
610
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
611
+ * @summary Report model tokens and cost for an agent
612
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
613
+ * @param {*} [options] Override http request option.
614
+ * @throws {RequiredError}
615
+ * @memberof AdminAgentsApiInterface
616
+ */
617
+ adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): AxiosPromise<AdminAgentsReportUsageResponse>;
579
618
  /**
580
619
  *
581
620
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)
@@ -831,6 +870,31 @@ export interface AdminAgentsApiAdminAgentsListRequest {
831
870
  */
832
871
  readonly orgId: string;
833
872
  }
873
+ /**
874
+ * Request parameters for adminAgentsReportUsage operation in AdminAgentsApi.
875
+ * @export
876
+ * @interface AdminAgentsApiAdminAgentsReportUsageRequest
877
+ */
878
+ export interface AdminAgentsApiAdminAgentsReportUsageRequest {
879
+ /**
880
+ *
881
+ * @type {string}
882
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
883
+ */
884
+ readonly orgId: string;
885
+ /**
886
+ *
887
+ * @type {string}
888
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
889
+ */
890
+ readonly agentId: string;
891
+ /**
892
+ *
893
+ * @type {AdminAgentsReportUsageRequest}
894
+ * @memberof AdminAgentsApiAdminAgentsReportUsage
895
+ */
896
+ readonly adminAgentsReportUsageRequest: AdminAgentsReportUsageRequest;
897
+ }
834
898
  /**
835
899
  * Request parameters for adminAgentsRevokeKey operation in AdminAgentsApi.
836
900
  * @export
@@ -1050,6 +1114,15 @@ export declare class AdminAgentsApi extends BaseAPI implements AdminAgentsApiInt
1050
1114
  * @memberof AdminAgentsApi
1051
1115
  */
1052
1116
  adminAgentsList(requestParameters: AdminAgentsApiAdminAgentsListRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AdminAgentsListResponse, any, {}>>;
1117
+ /**
1118
+ * For a trusted component of your organization, such as an AI gateway\'s spend callback or an orchestrator, that sees the agent\'s model calls. Adds the tokens and cost to the agent\'s budget windows (current UTC hour, day and month), exactly like POST /agents/me/usage from the agent itself. The report adds no API call and is accepted even when the budget is spent.
1119
+ * @summary Report model tokens and cost for an agent
1120
+ * @param {AdminAgentsApiAdminAgentsReportUsageRequest} requestParameters Request parameters.
1121
+ * @param {*} [options] Override http request option.
1122
+ * @throws {RequiredError}
1123
+ * @memberof AdminAgentsApi
1124
+ */
1125
+ adminAgentsReportUsage(requestParameters: AdminAgentsApiAdminAgentsReportUsageRequest, options?: RawAxiosRequestConfig): Promise<import("axios").AxiosResponse<AdminAgentsReportUsageResponse, any, {}>>;
1053
1126
  /**
1054
1127
  *
1055
1128
  * @summary Revoke agent API key (nullify it so it can no longer authenticate)