@meetkai/mka1 0.55.1 → 0.55.2

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 (155) hide show
  1. package/README.md +360 -360
  2. package/bin/mcp-server.js +1522 -1275
  3. package/bin/mcp-server.js.map +17 -14
  4. package/dist/commonjs/funcs/llmModelsGetQuota.d.ts +19 -0
  5. package/dist/commonjs/funcs/llmModelsGetQuota.d.ts.map +1 -0
  6. package/dist/commonjs/funcs/llmModelsGetQuota.js +138 -0
  7. package/dist/commonjs/funcs/llmModelsGetQuota.js.map +1 -0
  8. package/dist/commonjs/lib/config.d.ts +2 -2
  9. package/dist/commonjs/lib/config.js +2 -2
  10. package/dist/commonjs/mcp-server/mcp-server.js +1 -1
  11. package/dist/commonjs/mcp-server/server.d.ts.map +1 -1
  12. package/dist/commonjs/mcp-server/server.js +3 -1
  13. package/dist/commonjs/mcp-server/server.js.map +1 -1
  14. package/dist/commonjs/mcp-server/tools/llmModelsGetQuota.d.ts +8 -0
  15. package/dist/commonjs/mcp-server/tools/llmModelsGetQuota.d.ts.map +1 -0
  16. package/dist/commonjs/mcp-server/tools/llmModelsGetQuota.js +64 -0
  17. package/dist/commonjs/mcp-server/tools/llmModelsGetQuota.js.map +1 -0
  18. package/dist/commonjs/models/components/responsescreaterequest.d.ts +5 -0
  19. package/dist/commonjs/models/components/responsescreaterequest.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/responsescreaterequest.js +4 -0
  21. package/dist/commonjs/models/components/responsescreaterequest.js.map +1 -1
  22. package/dist/commonjs/models/operations/acceptclusterinvite.d.ts +6 -0
  23. package/dist/commonjs/models/operations/acceptclusterinvite.d.ts.map +1 -1
  24. package/dist/commonjs/models/operations/acceptclusterinvite.js +6 -0
  25. package/dist/commonjs/models/operations/acceptclusterinvite.js.map +1 -1
  26. package/dist/commonjs/models/operations/createscopedapikey.d.ts +6 -0
  27. package/dist/commonjs/models/operations/createscopedapikey.d.ts.map +1 -1
  28. package/dist/commonjs/models/operations/createscopedapikey.js +6 -0
  29. package/dist/commonjs/models/operations/createscopedapikey.js.map +1 -1
  30. package/dist/commonjs/models/operations/getmodelquota.d.ts +83 -0
  31. package/dist/commonjs/models/operations/getmodelquota.d.ts.map +1 -0
  32. package/dist/commonjs/models/operations/getmodelquota.js +153 -0
  33. package/dist/commonjs/models/operations/getmodelquota.js.map +1 -0
  34. package/dist/commonjs/models/operations/index.d.ts +1 -0
  35. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  36. package/dist/commonjs/models/operations/index.js +1 -0
  37. package/dist/commonjs/models/operations/index.js.map +1 -1
  38. package/dist/commonjs/models/operations/listscopedapikeys.d.ts +6 -0
  39. package/dist/commonjs/models/operations/listscopedapikeys.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/listscopedapikeys.js +6 -0
  41. package/dist/commonjs/models/operations/listscopedapikeys.js.map +1 -1
  42. package/dist/commonjs/models/operations/listserviceaccountapikeys.d.ts +6 -0
  43. package/dist/commonjs/models/operations/listserviceaccountapikeys.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/listserviceaccountapikeys.js +6 -0
  45. package/dist/commonjs/models/operations/listserviceaccountapikeys.js.map +1 -1
  46. package/dist/commonjs/models/operations/reissueownerkey.d.ts +6 -0
  47. package/dist/commonjs/models/operations/reissueownerkey.d.ts.map +1 -1
  48. package/dist/commonjs/models/operations/reissueownerkey.js +6 -0
  49. package/dist/commonjs/models/operations/reissueownerkey.js.map +1 -1
  50. package/dist/commonjs/models/operations/updatescopedapikey.d.ts +6 -0
  51. package/dist/commonjs/models/operations/updatescopedapikey.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/updatescopedapikey.js +6 -0
  53. package/dist/commonjs/models/operations/updatescopedapikey.js.map +1 -1
  54. package/dist/commonjs/react-query/index.d.ts +1 -0
  55. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  56. package/dist/commonjs/react-query/index.js +1 -0
  57. package/dist/commonjs/react-query/index.js.map +1 -1
  58. package/dist/commonjs/react-query/llmModelsGetQuota.core.d.ts +16 -0
  59. package/dist/commonjs/react-query/llmModelsGetQuota.core.d.ts.map +1 -0
  60. package/dist/commonjs/react-query/llmModelsGetQuota.core.js +38 -0
  61. package/dist/commonjs/react-query/llmModelsGetQuota.core.js.map +1 -0
  62. package/dist/commonjs/react-query/llmModelsGetQuota.d.ts +42 -0
  63. package/dist/commonjs/react-query/llmModelsGetQuota.d.ts.map +1 -0
  64. package/dist/commonjs/react-query/llmModelsGetQuota.js +60 -0
  65. package/dist/commonjs/react-query/llmModelsGetQuota.js.map +1 -0
  66. package/dist/commonjs/sdk/models.d.ts +7 -0
  67. package/dist/commonjs/sdk/models.d.ts.map +1 -1
  68. package/dist/commonjs/sdk/models.js +10 -0
  69. package/dist/commonjs/sdk/models.js.map +1 -1
  70. package/dist/esm/funcs/llmModelsGetQuota.d.ts +19 -0
  71. package/dist/esm/funcs/llmModelsGetQuota.d.ts.map +1 -0
  72. package/dist/esm/funcs/llmModelsGetQuota.js +102 -0
  73. package/dist/esm/funcs/llmModelsGetQuota.js.map +1 -0
  74. package/dist/esm/lib/config.d.ts +2 -2
  75. package/dist/esm/lib/config.js +2 -2
  76. package/dist/esm/mcp-server/mcp-server.js +1 -1
  77. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  78. package/dist/esm/mcp-server/server.js +3 -1
  79. package/dist/esm/mcp-server/server.js.map +1 -1
  80. package/dist/esm/mcp-server/tools/llmModelsGetQuota.d.ts +8 -0
  81. package/dist/esm/mcp-server/tools/llmModelsGetQuota.d.ts.map +1 -0
  82. package/dist/esm/mcp-server/tools/llmModelsGetQuota.js +28 -0
  83. package/dist/esm/mcp-server/tools/llmModelsGetQuota.js.map +1 -0
  84. package/dist/esm/models/components/responsescreaterequest.d.ts +5 -0
  85. package/dist/esm/models/components/responsescreaterequest.d.ts.map +1 -1
  86. package/dist/esm/models/components/responsescreaterequest.js +4 -0
  87. package/dist/esm/models/components/responsescreaterequest.js.map +1 -1
  88. package/dist/esm/models/operations/acceptclusterinvite.d.ts +6 -0
  89. package/dist/esm/models/operations/acceptclusterinvite.d.ts.map +1 -1
  90. package/dist/esm/models/operations/acceptclusterinvite.js +6 -0
  91. package/dist/esm/models/operations/acceptclusterinvite.js.map +1 -1
  92. package/dist/esm/models/operations/createscopedapikey.d.ts +6 -0
  93. package/dist/esm/models/operations/createscopedapikey.d.ts.map +1 -1
  94. package/dist/esm/models/operations/createscopedapikey.js +6 -0
  95. package/dist/esm/models/operations/createscopedapikey.js.map +1 -1
  96. package/dist/esm/models/operations/getmodelquota.d.ts +83 -0
  97. package/dist/esm/models/operations/getmodelquota.d.ts.map +1 -0
  98. package/dist/esm/models/operations/getmodelquota.js +111 -0
  99. package/dist/esm/models/operations/getmodelquota.js.map +1 -0
  100. package/dist/esm/models/operations/index.d.ts +1 -0
  101. package/dist/esm/models/operations/index.d.ts.map +1 -1
  102. package/dist/esm/models/operations/index.js +1 -0
  103. package/dist/esm/models/operations/index.js.map +1 -1
  104. package/dist/esm/models/operations/listscopedapikeys.d.ts +6 -0
  105. package/dist/esm/models/operations/listscopedapikeys.d.ts.map +1 -1
  106. package/dist/esm/models/operations/listscopedapikeys.js +6 -0
  107. package/dist/esm/models/operations/listscopedapikeys.js.map +1 -1
  108. package/dist/esm/models/operations/listserviceaccountapikeys.d.ts +6 -0
  109. package/dist/esm/models/operations/listserviceaccountapikeys.d.ts.map +1 -1
  110. package/dist/esm/models/operations/listserviceaccountapikeys.js +6 -0
  111. package/dist/esm/models/operations/listserviceaccountapikeys.js.map +1 -1
  112. package/dist/esm/models/operations/reissueownerkey.d.ts +6 -0
  113. package/dist/esm/models/operations/reissueownerkey.d.ts.map +1 -1
  114. package/dist/esm/models/operations/reissueownerkey.js +6 -0
  115. package/dist/esm/models/operations/reissueownerkey.js.map +1 -1
  116. package/dist/esm/models/operations/updatescopedapikey.d.ts +6 -0
  117. package/dist/esm/models/operations/updatescopedapikey.d.ts.map +1 -1
  118. package/dist/esm/models/operations/updatescopedapikey.js +6 -0
  119. package/dist/esm/models/operations/updatescopedapikey.js.map +1 -1
  120. package/dist/esm/react-query/index.d.ts +1 -0
  121. package/dist/esm/react-query/index.d.ts.map +1 -1
  122. package/dist/esm/react-query/index.js +1 -0
  123. package/dist/esm/react-query/index.js.map +1 -1
  124. package/dist/esm/react-query/llmModelsGetQuota.core.d.ts +16 -0
  125. package/dist/esm/react-query/llmModelsGetQuota.core.d.ts.map +1 -0
  126. package/dist/esm/react-query/llmModelsGetQuota.core.js +33 -0
  127. package/dist/esm/react-query/llmModelsGetQuota.core.js.map +1 -0
  128. package/dist/esm/react-query/llmModelsGetQuota.d.ts +42 -0
  129. package/dist/esm/react-query/llmModelsGetQuota.d.ts.map +1 -0
  130. package/dist/esm/react-query/llmModelsGetQuota.js +50 -0
  131. package/dist/esm/react-query/llmModelsGetQuota.js.map +1 -0
  132. package/dist/esm/sdk/models.d.ts +7 -0
  133. package/dist/esm/sdk/models.d.ts.map +1 -1
  134. package/dist/esm/sdk/models.js +10 -0
  135. package/dist/esm/sdk/models.js.map +1 -1
  136. package/jsr.json +1 -1
  137. package/package.json +1 -1
  138. package/src/funcs/llmModelsGetQuota.ts +190 -0
  139. package/src/lib/config.ts +2 -2
  140. package/src/mcp-server/mcp-server.ts +1 -1
  141. package/src/mcp-server/server.ts +3 -1
  142. package/src/mcp-server/tools/llmModelsGetQuota.ts +37 -0
  143. package/src/models/components/responsescreaterequest.ts +9 -0
  144. package/src/models/operations/acceptclusterinvite.ts +12 -0
  145. package/src/models/operations/createscopedapikey.ts +12 -0
  146. package/src/models/operations/getmodelquota.ts +229 -0
  147. package/src/models/operations/index.ts +1 -0
  148. package/src/models/operations/listscopedapikeys.ts +12 -0
  149. package/src/models/operations/listserviceaccountapikeys.ts +12 -0
  150. package/src/models/operations/reissueownerkey.ts +12 -0
  151. package/src/models/operations/updatescopedapikey.ts +12 -0
  152. package/src/react-query/index.ts +1 -0
  153. package/src/react-query/llmModelsGetQuota.core.ts +81 -0
  154. package/src/react-query/llmModelsGetQuota.ts +149 -0
  155. package/src/sdk/models.ts +18 -0
@@ -0,0 +1,229 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import * as z from "zod/v3";
6
+ import { remap as remap$ } from "../../lib/primitives.js";
7
+ import { safeParse } from "../../lib/schemas.js";
8
+ import { ClosedEnum } from "../../types/enums.js";
9
+ import { Result as SafeParseResult } from "../../types/fp.js";
10
+ import { SDKValidationError } from "../errors/sdkvalidationerror.js";
11
+
12
+ export type GetModelQuotaRequest = {
13
+ modelId: string;
14
+ apiKeyId?: string | undefined;
15
+ serviceAccountId?: string | undefined;
16
+ /**
17
+ * Optional external end-user identifier forwarded by the API gateway.
18
+ */
19
+ xOnBehalfOf?: string | undefined;
20
+ };
21
+
22
+ export const GetModelQuotaScope = {
23
+ Global: "global",
24
+ Org: "org",
25
+ User: "user",
26
+ ApiKey: "apiKey",
27
+ ExternalUser: "externalUser",
28
+ } as const;
29
+ export type GetModelQuotaScope = ClosedEnum<typeof GetModelQuotaScope>;
30
+
31
+ export type Limits = {
32
+ scope: GetModelQuotaScope;
33
+ windowSeconds: number;
34
+ limit: number;
35
+ /**
36
+ * Reported tokens; may exceed the limit while admitted requests finish.
37
+ */
38
+ used: number;
39
+ remaining: number;
40
+ resetAt: Date | null;
41
+ };
42
+
43
+ /**
44
+ * OK
45
+ */
46
+ export type GetModelQuotaResponseBody = {
47
+ modelId: string;
48
+ limits: Array<Limits>;
49
+ };
50
+
51
+ /** @internal */
52
+ export const GetModelQuotaRequest$inboundSchema: z.ZodType<
53
+ GetModelQuotaRequest,
54
+ z.ZodTypeDef,
55
+ unknown
56
+ > = z.object({
57
+ model_id: z.string(),
58
+ api_key_id: z.string().optional(),
59
+ service_account_id: z.string().optional(),
60
+ "X-On-Behalf-Of": z.string().optional(),
61
+ }).transform((v) => {
62
+ return remap$(v, {
63
+ "model_id": "modelId",
64
+ "api_key_id": "apiKeyId",
65
+ "service_account_id": "serviceAccountId",
66
+ "X-On-Behalf-Of": "xOnBehalfOf",
67
+ });
68
+ });
69
+ /** @internal */
70
+ export type GetModelQuotaRequest$Outbound = {
71
+ model_id: string;
72
+ api_key_id?: string | undefined;
73
+ service_account_id?: string | undefined;
74
+ "X-On-Behalf-Of"?: string | undefined;
75
+ };
76
+
77
+ /** @internal */
78
+ export const GetModelQuotaRequest$outboundSchema: z.ZodType<
79
+ GetModelQuotaRequest$Outbound,
80
+ z.ZodTypeDef,
81
+ GetModelQuotaRequest
82
+ > = z.object({
83
+ modelId: z.string(),
84
+ apiKeyId: z.string().optional(),
85
+ serviceAccountId: z.string().optional(),
86
+ xOnBehalfOf: z.string().optional(),
87
+ }).transform((v) => {
88
+ return remap$(v, {
89
+ modelId: "model_id",
90
+ apiKeyId: "api_key_id",
91
+ serviceAccountId: "service_account_id",
92
+ xOnBehalfOf: "X-On-Behalf-Of",
93
+ });
94
+ });
95
+
96
+ export function getModelQuotaRequestToJSON(
97
+ getModelQuotaRequest: GetModelQuotaRequest,
98
+ ): string {
99
+ return JSON.stringify(
100
+ GetModelQuotaRequest$outboundSchema.parse(getModelQuotaRequest),
101
+ );
102
+ }
103
+ export function getModelQuotaRequestFromJSON(
104
+ jsonString: string,
105
+ ): SafeParseResult<GetModelQuotaRequest, SDKValidationError> {
106
+ return safeParse(
107
+ jsonString,
108
+ (x) => GetModelQuotaRequest$inboundSchema.parse(JSON.parse(x)),
109
+ `Failed to parse 'GetModelQuotaRequest' from JSON`,
110
+ );
111
+ }
112
+
113
+ /** @internal */
114
+ export const GetModelQuotaScope$inboundSchema: z.ZodNativeEnum<
115
+ typeof GetModelQuotaScope
116
+ > = z.nativeEnum(GetModelQuotaScope);
117
+ /** @internal */
118
+ export const GetModelQuotaScope$outboundSchema: z.ZodNativeEnum<
119
+ typeof GetModelQuotaScope
120
+ > = GetModelQuotaScope$inboundSchema;
121
+
122
+ /** @internal */
123
+ export const Limits$inboundSchema: z.ZodType<Limits, z.ZodTypeDef, unknown> = z
124
+ .object({
125
+ scope: GetModelQuotaScope$inboundSchema,
126
+ window_seconds: z.number().int(),
127
+ limit: z.number().int(),
128
+ used: z.number().int(),
129
+ remaining: z.number().int(),
130
+ reset_at: z.nullable(
131
+ z.string().datetime({ offset: true }).transform(v => new Date(v)),
132
+ ),
133
+ }).transform((v) => {
134
+ return remap$(v, {
135
+ "window_seconds": "windowSeconds",
136
+ "reset_at": "resetAt",
137
+ });
138
+ });
139
+ /** @internal */
140
+ export type Limits$Outbound = {
141
+ scope: string;
142
+ window_seconds: number;
143
+ limit: number;
144
+ used: number;
145
+ remaining: number;
146
+ reset_at: string | null;
147
+ };
148
+
149
+ /** @internal */
150
+ export const Limits$outboundSchema: z.ZodType<
151
+ Limits$Outbound,
152
+ z.ZodTypeDef,
153
+ Limits
154
+ > = z.object({
155
+ scope: GetModelQuotaScope$outboundSchema,
156
+ windowSeconds: z.number().int(),
157
+ limit: z.number().int(),
158
+ used: z.number().int(),
159
+ remaining: z.number().int(),
160
+ resetAt: z.nullable(z.date().transform(v => v.toISOString())),
161
+ }).transform((v) => {
162
+ return remap$(v, {
163
+ windowSeconds: "window_seconds",
164
+ resetAt: "reset_at",
165
+ });
166
+ });
167
+
168
+ export function limitsToJSON(limits: Limits): string {
169
+ return JSON.stringify(Limits$outboundSchema.parse(limits));
170
+ }
171
+ export function limitsFromJSON(
172
+ jsonString: string,
173
+ ): SafeParseResult<Limits, SDKValidationError> {
174
+ return safeParse(
175
+ jsonString,
176
+ (x) => Limits$inboundSchema.parse(JSON.parse(x)),
177
+ `Failed to parse 'Limits' from JSON`,
178
+ );
179
+ }
180
+
181
+ /** @internal */
182
+ export const GetModelQuotaResponseBody$inboundSchema: z.ZodType<
183
+ GetModelQuotaResponseBody,
184
+ z.ZodTypeDef,
185
+ unknown
186
+ > = z.object({
187
+ model_id: z.string(),
188
+ limits: z.array(z.lazy(() => Limits$inboundSchema)),
189
+ }).transform((v) => {
190
+ return remap$(v, {
191
+ "model_id": "modelId",
192
+ });
193
+ });
194
+ /** @internal */
195
+ export type GetModelQuotaResponseBody$Outbound = {
196
+ model_id: string;
197
+ limits: Array<Limits$Outbound>;
198
+ };
199
+
200
+ /** @internal */
201
+ export const GetModelQuotaResponseBody$outboundSchema: z.ZodType<
202
+ GetModelQuotaResponseBody$Outbound,
203
+ z.ZodTypeDef,
204
+ GetModelQuotaResponseBody
205
+ > = z.object({
206
+ modelId: z.string(),
207
+ limits: z.array(z.lazy(() => Limits$outboundSchema)),
208
+ }).transform((v) => {
209
+ return remap$(v, {
210
+ modelId: "model_id",
211
+ });
212
+ });
213
+
214
+ export function getModelQuotaResponseBodyToJSON(
215
+ getModelQuotaResponseBody: GetModelQuotaResponseBody,
216
+ ): string {
217
+ return JSON.stringify(
218
+ GetModelQuotaResponseBody$outboundSchema.parse(getModelQuotaResponseBody),
219
+ );
220
+ }
221
+ export function getModelQuotaResponseBodyFromJSON(
222
+ jsonString: string,
223
+ ): SafeParseResult<GetModelQuotaResponseBody, SDKValidationError> {
224
+ return safeParse(
225
+ jsonString,
226
+ (x) => GetModelQuotaResponseBody$inboundSchema.parse(JSON.parse(x)),
227
+ `Failed to parse 'GetModelQuotaResponseBody' from JSON`,
228
+ );
229
+ }
@@ -215,6 +215,7 @@ export * from "./getmcpserver.js";
215
215
  export * from "./getmemoryentry.js";
216
216
  export * from "./getmemorystore.js";
217
217
  export * from "./getmodel.js";
218
+ export * from "./getmodelquota.js";
218
219
  export * from "./getnetworkpolicyaccess.js";
219
220
  export * from "./getorganizationbilling.js";
220
221
  export * from "./getorgbudgets.js";
@@ -37,6 +37,9 @@ export type ResponseBody = {
37
37
  orgId: string | null;
38
38
  teamId: string | null;
39
39
  scopes: Array<string>;
40
+ rateLimitEnabled?: boolean | null | undefined;
41
+ rateLimitTimeWindow?: number | null | undefined;
42
+ rateLimitMax?: number | null | undefined;
40
43
  expiresAt?: string | null | undefined;
41
44
  };
42
45
 
@@ -118,6 +121,9 @@ export const ResponseBody$inboundSchema: z.ZodType<
118
121
  orgId: z.nullable(z.string()),
119
122
  teamId: z.nullable(z.string()),
120
123
  scopes: z.array(z.string()),
124
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
125
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
126
+ rateLimitMax: z.nullable(z.number()).optional(),
121
127
  expiresAt: z.nullable(z.string()).optional(),
122
128
  });
123
129
  /** @internal */
@@ -132,6 +138,9 @@ export type ResponseBody$Outbound = {
132
138
  orgId: string | null;
133
139
  teamId: string | null;
134
140
  scopes: Array<string>;
141
+ rateLimitEnabled?: boolean | null | undefined;
142
+ rateLimitTimeWindow?: number | null | undefined;
143
+ rateLimitMax?: number | null | undefined;
135
144
  expiresAt?: string | null | undefined;
136
145
  };
137
146
 
@@ -151,6 +160,9 @@ export const ResponseBody$outboundSchema: z.ZodType<
151
160
  orgId: z.nullable(z.string()),
152
161
  teamId: z.nullable(z.string()),
153
162
  scopes: z.array(z.string()),
163
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
164
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
165
+ rateLimitMax: z.nullable(z.number()).optional(),
154
166
  expiresAt: z.nullable(z.string()).optional(),
155
167
  });
156
168
 
@@ -37,6 +37,9 @@ export type ListServiceAccountApiKeysResponseBody = {
37
37
  orgId: string | null;
38
38
  teamId: string | null;
39
39
  scopes: Array<string>;
40
+ rateLimitEnabled?: boolean | null | undefined;
41
+ rateLimitTimeWindow?: number | null | undefined;
42
+ rateLimitMax?: number | null | undefined;
40
43
  expiresAt?: string | null | undefined;
41
44
  };
42
45
 
@@ -120,6 +123,9 @@ export const ListServiceAccountApiKeysResponseBody$inboundSchema: z.ZodType<
120
123
  orgId: z.nullable(z.string()),
121
124
  teamId: z.nullable(z.string()),
122
125
  scopes: z.array(z.string()),
126
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
127
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
128
+ rateLimitMax: z.nullable(z.number()).optional(),
123
129
  expiresAt: z.nullable(z.string()).optional(),
124
130
  });
125
131
  /** @internal */
@@ -134,6 +140,9 @@ export type ListServiceAccountApiKeysResponseBody$Outbound = {
134
140
  orgId: string | null;
135
141
  teamId: string | null;
136
142
  scopes: Array<string>;
143
+ rateLimitEnabled?: boolean | null | undefined;
144
+ rateLimitTimeWindow?: number | null | undefined;
145
+ rateLimitMax?: number | null | undefined;
137
146
  expiresAt?: string | null | undefined;
138
147
  };
139
148
 
@@ -153,6 +162,9 @@ export const ListServiceAccountApiKeysResponseBody$outboundSchema: z.ZodType<
153
162
  orgId: z.nullable(z.string()),
154
163
  teamId: z.nullable(z.string()),
155
164
  scopes: z.array(z.string()),
165
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
166
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
167
+ rateLimitMax: z.nullable(z.number()).optional(),
156
168
  expiresAt: z.nullable(z.string()).optional(),
157
169
  });
158
170
 
@@ -42,6 +42,9 @@ export type ApiKey = {
42
42
  orgId: string | null;
43
43
  teamId: string | null;
44
44
  scopes: Array<string>;
45
+ rateLimitEnabled?: boolean | null | undefined;
46
+ rateLimitTimeWindow?: number | null | undefined;
47
+ rateLimitMax?: number | null | undefined;
45
48
  expiresAt?: string | null | undefined;
46
49
  };
47
50
 
@@ -175,6 +178,9 @@ export const ApiKey$inboundSchema: z.ZodType<ApiKey, z.ZodTypeDef, unknown> = z
175
178
  orgId: z.nullable(z.string()),
176
179
  teamId: z.nullable(z.string()),
177
180
  scopes: z.array(z.string()),
181
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
182
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
183
+ rateLimitMax: z.nullable(z.number()).optional(),
178
184
  expiresAt: z.nullable(z.string()).optional(),
179
185
  });
180
186
  /** @internal */
@@ -189,6 +195,9 @@ export type ApiKey$Outbound = {
189
195
  orgId: string | null;
190
196
  teamId: string | null;
191
197
  scopes: Array<string>;
198
+ rateLimitEnabled?: boolean | null | undefined;
199
+ rateLimitTimeWindow?: number | null | undefined;
200
+ rateLimitMax?: number | null | undefined;
192
201
  expiresAt?: string | null | undefined;
193
202
  };
194
203
 
@@ -208,6 +217,9 @@ export const ApiKey$outboundSchema: z.ZodType<
208
217
  orgId: z.nullable(z.string()),
209
218
  teamId: z.nullable(z.string()),
210
219
  scopes: z.array(z.string()),
220
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
221
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
222
+ rateLimitMax: z.nullable(z.number()).optional(),
211
223
  expiresAt: z.nullable(z.string()).optional(),
212
224
  });
213
225
 
@@ -48,6 +48,9 @@ export type UpdateScopedApiKeyResponseBody = {
48
48
  orgId: string | null;
49
49
  teamId: string | null;
50
50
  scopes: Array<string>;
51
+ rateLimitEnabled?: boolean | null | undefined;
52
+ rateLimitTimeWindow?: number | null | undefined;
53
+ rateLimitMax?: number | null | undefined;
51
54
  expiresAt?: string | null | undefined;
52
55
  };
53
56
 
@@ -186,6 +189,9 @@ export const UpdateScopedApiKeyResponseBody$inboundSchema: z.ZodType<
186
189
  orgId: z.nullable(z.string()),
187
190
  teamId: z.nullable(z.string()),
188
191
  scopes: z.array(z.string()),
192
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
193
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
194
+ rateLimitMax: z.nullable(z.number()).optional(),
189
195
  expiresAt: z.nullable(z.string()).optional(),
190
196
  });
191
197
  /** @internal */
@@ -200,6 +206,9 @@ export type UpdateScopedApiKeyResponseBody$Outbound = {
200
206
  orgId: string | null;
201
207
  teamId: string | null;
202
208
  scopes: Array<string>;
209
+ rateLimitEnabled?: boolean | null | undefined;
210
+ rateLimitTimeWindow?: number | null | undefined;
211
+ rateLimitMax?: number | null | undefined;
203
212
  expiresAt?: string | null | undefined;
204
213
  };
205
214
 
@@ -219,6 +228,9 @@ export const UpdateScopedApiKeyResponseBody$outboundSchema: z.ZodType<
219
228
  orgId: z.nullable(z.string()),
220
229
  teamId: z.nullable(z.string()),
221
230
  scopes: z.array(z.string()),
231
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
232
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
233
+ rateLimitMax: z.nullable(z.number()).optional(),
222
234
  expiresAt: z.nullable(z.string()).optional(),
223
235
  });
224
236
 
@@ -338,6 +338,7 @@ export * from "./llmModelsDeleteCatalogEntry.js";
338
338
  export * from "./llmModelsDeleteOrgAutoModel.js";
339
339
  export * from "./llmModelsGet.js";
340
340
  export * from "./llmModelsGetClusterCurrency.js";
341
+ export * from "./llmModelsGetQuota.js";
341
342
  export * from "./llmModelsList.js";
342
343
  export * from "./llmModelsListCatalog.js";
343
344
  export * from "./llmModelsListCatalogModelAccess.js";
@@ -0,0 +1,81 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ QueryClient,
7
+ QueryFunctionContext,
8
+ QueryKey,
9
+ } from "@tanstack/react-query";
10
+ import { SDKCore } from "../core.js";
11
+ import { llmModelsGetQuota } from "../funcs/llmModelsGetQuota.js";
12
+ import { combineSignals } from "../lib/primitives.js";
13
+ import { RequestOptions } from "../lib/sdks.js";
14
+ import * as operations from "../models/operations/index.js";
15
+ import { unwrapAsync } from "../types/fp.js";
16
+ export type LlmModelsGetQuotaQueryData = operations.GetModelQuotaResponseBody;
17
+
18
+ export function prefetchLlmModelsGetQuota(
19
+ queryClient: QueryClient,
20
+ client$: SDKCore,
21
+ request: operations.GetModelQuotaRequest,
22
+ options?: RequestOptions,
23
+ ): Promise<void> {
24
+ return queryClient.prefetchQuery({
25
+ ...buildLlmModelsGetQuotaQuery(
26
+ client$,
27
+ request,
28
+ options,
29
+ ),
30
+ });
31
+ }
32
+
33
+ export function buildLlmModelsGetQuotaQuery(
34
+ client$: SDKCore,
35
+ request: operations.GetModelQuotaRequest,
36
+ options?: RequestOptions,
37
+ ): {
38
+ queryKey: QueryKey;
39
+ queryFn: (
40
+ context: QueryFunctionContext,
41
+ ) => Promise<LlmModelsGetQuotaQueryData>;
42
+ } {
43
+ return {
44
+ queryKey: queryKeyLlmModelsGetQuota(request.modelId, {
45
+ apiKeyId: request.apiKeyId,
46
+ serviceAccountId: request.serviceAccountId,
47
+ xOnBehalfOf: request.xOnBehalfOf,
48
+ }),
49
+ queryFn: async function llmModelsGetQuotaQueryFn(
50
+ ctx,
51
+ ): Promise<LlmModelsGetQuotaQueryData> {
52
+ const sig = combineSignals(
53
+ ctx.signal,
54
+ options?.signal,
55
+ options?.fetchOptions?.signal,
56
+ );
57
+ const mergedOptions = {
58
+ ...options?.fetchOptions,
59
+ ...options,
60
+ signal: sig,
61
+ };
62
+
63
+ return unwrapAsync(llmModelsGetQuota(
64
+ client$,
65
+ request,
66
+ mergedOptions,
67
+ ));
68
+ },
69
+ };
70
+ }
71
+
72
+ export function queryKeyLlmModelsGetQuota(
73
+ modelId: string,
74
+ parameters: {
75
+ apiKeyId?: string | undefined;
76
+ serviceAccountId?: string | undefined;
77
+ xOnBehalfOf?: string | undefined;
78
+ },
79
+ ): QueryKey {
80
+ return ["@meetkai/mka1", "models", "getQuota", modelId, parameters];
81
+ }
@@ -0,0 +1,149 @@
1
+ /*
2
+ * Code generated by Speakeasy (https://speakeasy.com). DO NOT EDIT.
3
+ */
4
+
5
+ import {
6
+ InvalidateQueryFilters,
7
+ QueryClient,
8
+ useQuery,
9
+ UseQueryResult,
10
+ useSuspenseQuery,
11
+ UseSuspenseQueryResult,
12
+ } from "@tanstack/react-query";
13
+ import {
14
+ ConnectionError,
15
+ InvalidRequestError,
16
+ RequestAbortedError,
17
+ RequestTimeoutError,
18
+ UnexpectedClientError,
19
+ } from "../models/errors/httpclienterrors.js";
20
+ import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
21
+ import { SDKError } from "../models/errors/sdkerror.js";
22
+ import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
23
+ import * as operations from "../models/operations/index.js";
24
+ import { useSDKContext } from "./_context.js";
25
+ import {
26
+ QueryHookOptions,
27
+ SuspenseQueryHookOptions,
28
+ TupleToPrefixes,
29
+ } from "./_types.js";
30
+ import {
31
+ buildLlmModelsGetQuotaQuery,
32
+ LlmModelsGetQuotaQueryData,
33
+ prefetchLlmModelsGetQuota,
34
+ queryKeyLlmModelsGetQuota,
35
+ } from "./llmModelsGetQuota.core.js";
36
+ export {
37
+ buildLlmModelsGetQuotaQuery,
38
+ type LlmModelsGetQuotaQueryData,
39
+ prefetchLlmModelsGetQuota,
40
+ queryKeyLlmModelsGetQuota,
41
+ };
42
+
43
+ export type LlmModelsGetQuotaQueryError =
44
+ | SDKError
45
+ | ResponseValidationError
46
+ | ConnectionError
47
+ | RequestAbortedError
48
+ | RequestTimeoutError
49
+ | InvalidRequestError
50
+ | UnexpectedClientError
51
+ | SDKValidationError;
52
+
53
+ /**
54
+ * Read a model's token quota
55
+ *
56
+ * @remarks
57
+ * Read current tokens-per-minute limits without consuming tokens or starting a window. Use a concrete active model, not auto. Omit selectors for the authenticated caller's context, including its delegated external user. Human sessions may select an authorized api_key_id, plus service_account_id for a service-account key; selected keys use their ordinary, non-delegated context. Scopes with missing subject identities are omitted to avoid exposing shared fallback usage; their enforcement is unchanged. An empty limits array means no reportable token rules for this context. Untouched windows have reset_at: null; unavailable counters return 503.
58
+ */
59
+ export function useLlmModelsGetQuota(
60
+ request: operations.GetModelQuotaRequest,
61
+ options?: QueryHookOptions<
62
+ LlmModelsGetQuotaQueryData,
63
+ LlmModelsGetQuotaQueryError
64
+ >,
65
+ ): UseQueryResult<LlmModelsGetQuotaQueryData, LlmModelsGetQuotaQueryError> {
66
+ const client = useSDKContext();
67
+ return useQuery({
68
+ ...buildLlmModelsGetQuotaQuery(
69
+ client,
70
+ request,
71
+ options,
72
+ ),
73
+ ...options,
74
+ });
75
+ }
76
+
77
+ /**
78
+ * Read a model's token quota
79
+ *
80
+ * @remarks
81
+ * Read current tokens-per-minute limits without consuming tokens or starting a window. Use a concrete active model, not auto. Omit selectors for the authenticated caller's context, including its delegated external user. Human sessions may select an authorized api_key_id, plus service_account_id for a service-account key; selected keys use their ordinary, non-delegated context. Scopes with missing subject identities are omitted to avoid exposing shared fallback usage; their enforcement is unchanged. An empty limits array means no reportable token rules for this context. Untouched windows have reset_at: null; unavailable counters return 503.
82
+ */
83
+ export function useLlmModelsGetQuotaSuspense(
84
+ request: operations.GetModelQuotaRequest,
85
+ options?: SuspenseQueryHookOptions<
86
+ LlmModelsGetQuotaQueryData,
87
+ LlmModelsGetQuotaQueryError
88
+ >,
89
+ ): UseSuspenseQueryResult<
90
+ LlmModelsGetQuotaQueryData,
91
+ LlmModelsGetQuotaQueryError
92
+ > {
93
+ const client = useSDKContext();
94
+ return useSuspenseQuery({
95
+ ...buildLlmModelsGetQuotaQuery(
96
+ client,
97
+ request,
98
+ options,
99
+ ),
100
+ ...options,
101
+ });
102
+ }
103
+
104
+ export function setLlmModelsGetQuotaData(
105
+ client: QueryClient,
106
+ queryKeyBase: [
107
+ modelId: string,
108
+ parameters: {
109
+ apiKeyId?: string | undefined;
110
+ serviceAccountId?: string | undefined;
111
+ xOnBehalfOf?: string | undefined;
112
+ },
113
+ ],
114
+ data: LlmModelsGetQuotaQueryData,
115
+ ): LlmModelsGetQuotaQueryData | undefined {
116
+ const key = queryKeyLlmModelsGetQuota(...queryKeyBase);
117
+
118
+ return client.setQueryData<LlmModelsGetQuotaQueryData>(key, data);
119
+ }
120
+
121
+ export function invalidateLlmModelsGetQuota(
122
+ client: QueryClient,
123
+ queryKeyBase: TupleToPrefixes<
124
+ [
125
+ modelId: string,
126
+ parameters: {
127
+ apiKeyId?: string | undefined;
128
+ serviceAccountId?: string | undefined;
129
+ xOnBehalfOf?: string | undefined;
130
+ },
131
+ ]
132
+ >,
133
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
134
+ ): Promise<void> {
135
+ return client.invalidateQueries({
136
+ ...filters,
137
+ queryKey: ["@meetkai/mka1", "models", "getQuota", ...queryKeyBase],
138
+ });
139
+ }
140
+
141
+ export function invalidateAllLlmModelsGetQuota(
142
+ client: QueryClient,
143
+ filters?: Omit<InvalidateQueryFilters, "queryKey" | "predicate" | "exact">,
144
+ ): Promise<void> {
145
+ return client.invalidateQueries({
146
+ ...filters,
147
+ queryKey: ["@meetkai/mka1", "models", "getQuota"],
148
+ });
149
+ }
package/src/sdk/models.ts CHANGED
@@ -13,6 +13,7 @@ import { llmModelsDeleteCatalogEntry } from "../funcs/llmModelsDeleteCatalogEntr
13
13
  import { llmModelsDeleteOrgAutoModel } from "../funcs/llmModelsDeleteOrgAutoModel.js";
14
14
  import { llmModelsGet } from "../funcs/llmModelsGet.js";
15
15
  import { llmModelsGetClusterCurrency } from "../funcs/llmModelsGetClusterCurrency.js";
16
+ import { llmModelsGetQuota } from "../funcs/llmModelsGetQuota.js";
16
17
  import { llmModelsList } from "../funcs/llmModelsList.js";
17
18
  import { llmModelsListCatalog } from "../funcs/llmModelsListCatalog.js";
18
19
  import { llmModelsListCatalogModelAccess } from "../funcs/llmModelsListCatalogModelAccess.js";
@@ -68,6 +69,23 @@ export class Models extends ClientSDK {
68
69
  ));
69
70
  }
70
71
 
72
+ /**
73
+ * Read a model's token quota
74
+ *
75
+ * @remarks
76
+ * Read current tokens-per-minute limits without consuming tokens or starting a window. Use a concrete active model, not auto. Omit selectors for the authenticated caller's context, including its delegated external user. Human sessions may select an authorized api_key_id, plus service_account_id for a service-account key; selected keys use their ordinary, non-delegated context. Scopes with missing subject identities are omitted to avoid exposing shared fallback usage; their enforcement is unchanged. An empty limits array means no reportable token rules for this context. Untouched windows have reset_at: null; unavailable counters return 503.
77
+ */
78
+ async getQuota(
79
+ request: operations.GetModelQuotaRequest,
80
+ options?: RequestOptions,
81
+ ): Promise<operations.GetModelQuotaResponseBody> {
82
+ return unwrapAsync(llmModelsGetQuota(
83
+ this,
84
+ request,
85
+ options,
86
+ ));
87
+ }
88
+
71
89
  /**
72
90
  * List the organization's model catalog
73
91
  *