@meetkai/mka1 0.55.0 → 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 (191) hide show
  1. package/README.md +360 -360
  2. package/bin/mcp-server.js +1542 -1279
  3. package/bin/mcp-server.js.map +21 -18
  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/agent.d.ts +2 -0
  19. package/dist/commonjs/models/components/agent.d.ts.map +1 -1
  20. package/dist/commonjs/models/components/agent.js +4 -0
  21. package/dist/commonjs/models/components/agent.js.map +1 -1
  22. package/dist/commonjs/models/components/agentversion.d.ts +2 -0
  23. package/dist/commonjs/models/components/agentversion.d.ts.map +1 -1
  24. package/dist/commonjs/models/components/agentversion.js +4 -0
  25. package/dist/commonjs/models/components/agentversion.js.map +1 -1
  26. package/dist/commonjs/models/components/createagentrequest.d.ts +5 -0
  27. package/dist/commonjs/models/components/createagentrequest.d.ts.map +1 -1
  28. package/dist/commonjs/models/components/createagentrequest.js +4 -0
  29. package/dist/commonjs/models/components/createagentrequest.js.map +1 -1
  30. package/dist/commonjs/models/components/responsescreaterequest.d.ts +5 -0
  31. package/dist/commonjs/models/components/responsescreaterequest.d.ts.map +1 -1
  32. package/dist/commonjs/models/components/responsescreaterequest.js +4 -0
  33. package/dist/commonjs/models/components/responsescreaterequest.js.map +1 -1
  34. package/dist/commonjs/models/components/updateagentrequest.d.ts +5 -0
  35. package/dist/commonjs/models/components/updateagentrequest.d.ts.map +1 -1
  36. package/dist/commonjs/models/components/updateagentrequest.js +4 -0
  37. package/dist/commonjs/models/components/updateagentrequest.js.map +1 -1
  38. package/dist/commonjs/models/operations/acceptclusterinvite.d.ts +6 -0
  39. package/dist/commonjs/models/operations/acceptclusterinvite.d.ts.map +1 -1
  40. package/dist/commonjs/models/operations/acceptclusterinvite.js +6 -0
  41. package/dist/commonjs/models/operations/acceptclusterinvite.js.map +1 -1
  42. package/dist/commonjs/models/operations/createscopedapikey.d.ts +6 -0
  43. package/dist/commonjs/models/operations/createscopedapikey.d.ts.map +1 -1
  44. package/dist/commonjs/models/operations/createscopedapikey.js +6 -0
  45. package/dist/commonjs/models/operations/createscopedapikey.js.map +1 -1
  46. package/dist/commonjs/models/operations/getmodelquota.d.ts +83 -0
  47. package/dist/commonjs/models/operations/getmodelquota.d.ts.map +1 -0
  48. package/dist/commonjs/models/operations/getmodelquota.js +153 -0
  49. package/dist/commonjs/models/operations/getmodelquota.js.map +1 -0
  50. package/dist/commonjs/models/operations/index.d.ts +1 -0
  51. package/dist/commonjs/models/operations/index.d.ts.map +1 -1
  52. package/dist/commonjs/models/operations/index.js +1 -0
  53. package/dist/commonjs/models/operations/index.js.map +1 -1
  54. package/dist/commonjs/models/operations/listscopedapikeys.d.ts +6 -0
  55. package/dist/commonjs/models/operations/listscopedapikeys.d.ts.map +1 -1
  56. package/dist/commonjs/models/operations/listscopedapikeys.js +6 -0
  57. package/dist/commonjs/models/operations/listscopedapikeys.js.map +1 -1
  58. package/dist/commonjs/models/operations/listserviceaccountapikeys.d.ts +6 -0
  59. package/dist/commonjs/models/operations/listserviceaccountapikeys.d.ts.map +1 -1
  60. package/dist/commonjs/models/operations/listserviceaccountapikeys.js +6 -0
  61. package/dist/commonjs/models/operations/listserviceaccountapikeys.js.map +1 -1
  62. package/dist/commonjs/models/operations/reissueownerkey.d.ts +6 -0
  63. package/dist/commonjs/models/operations/reissueownerkey.d.ts.map +1 -1
  64. package/dist/commonjs/models/operations/reissueownerkey.js +6 -0
  65. package/dist/commonjs/models/operations/reissueownerkey.js.map +1 -1
  66. package/dist/commonjs/models/operations/updatescopedapikey.d.ts +6 -0
  67. package/dist/commonjs/models/operations/updatescopedapikey.d.ts.map +1 -1
  68. package/dist/commonjs/models/operations/updatescopedapikey.js +6 -0
  69. package/dist/commonjs/models/operations/updatescopedapikey.js.map +1 -1
  70. package/dist/commonjs/react-query/index.d.ts +1 -0
  71. package/dist/commonjs/react-query/index.d.ts.map +1 -1
  72. package/dist/commonjs/react-query/index.js +1 -0
  73. package/dist/commonjs/react-query/index.js.map +1 -1
  74. package/dist/commonjs/react-query/llmModelsGetQuota.core.d.ts +16 -0
  75. package/dist/commonjs/react-query/llmModelsGetQuota.core.d.ts.map +1 -0
  76. package/dist/commonjs/react-query/llmModelsGetQuota.core.js +38 -0
  77. package/dist/commonjs/react-query/llmModelsGetQuota.core.js.map +1 -0
  78. package/dist/commonjs/react-query/llmModelsGetQuota.d.ts +42 -0
  79. package/dist/commonjs/react-query/llmModelsGetQuota.d.ts.map +1 -0
  80. package/dist/commonjs/react-query/llmModelsGetQuota.js +60 -0
  81. package/dist/commonjs/react-query/llmModelsGetQuota.js.map +1 -0
  82. package/dist/commonjs/sdk/models.d.ts +7 -0
  83. package/dist/commonjs/sdk/models.d.ts.map +1 -1
  84. package/dist/commonjs/sdk/models.js +10 -0
  85. package/dist/commonjs/sdk/models.js.map +1 -1
  86. package/dist/esm/funcs/llmModelsGetQuota.d.ts +19 -0
  87. package/dist/esm/funcs/llmModelsGetQuota.d.ts.map +1 -0
  88. package/dist/esm/funcs/llmModelsGetQuota.js +102 -0
  89. package/dist/esm/funcs/llmModelsGetQuota.js.map +1 -0
  90. package/dist/esm/lib/config.d.ts +2 -2
  91. package/dist/esm/lib/config.js +2 -2
  92. package/dist/esm/mcp-server/mcp-server.js +1 -1
  93. package/dist/esm/mcp-server/server.d.ts.map +1 -1
  94. package/dist/esm/mcp-server/server.js +3 -1
  95. package/dist/esm/mcp-server/server.js.map +1 -1
  96. package/dist/esm/mcp-server/tools/llmModelsGetQuota.d.ts +8 -0
  97. package/dist/esm/mcp-server/tools/llmModelsGetQuota.d.ts.map +1 -0
  98. package/dist/esm/mcp-server/tools/llmModelsGetQuota.js +28 -0
  99. package/dist/esm/mcp-server/tools/llmModelsGetQuota.js.map +1 -0
  100. package/dist/esm/models/components/agent.d.ts +2 -0
  101. package/dist/esm/models/components/agent.d.ts.map +1 -1
  102. package/dist/esm/models/components/agent.js +4 -0
  103. package/dist/esm/models/components/agent.js.map +1 -1
  104. package/dist/esm/models/components/agentversion.d.ts +2 -0
  105. package/dist/esm/models/components/agentversion.d.ts.map +1 -1
  106. package/dist/esm/models/components/agentversion.js +4 -0
  107. package/dist/esm/models/components/agentversion.js.map +1 -1
  108. package/dist/esm/models/components/createagentrequest.d.ts +5 -0
  109. package/dist/esm/models/components/createagentrequest.d.ts.map +1 -1
  110. package/dist/esm/models/components/createagentrequest.js +4 -0
  111. package/dist/esm/models/components/createagentrequest.js.map +1 -1
  112. package/dist/esm/models/components/responsescreaterequest.d.ts +5 -0
  113. package/dist/esm/models/components/responsescreaterequest.d.ts.map +1 -1
  114. package/dist/esm/models/components/responsescreaterequest.js +4 -0
  115. package/dist/esm/models/components/responsescreaterequest.js.map +1 -1
  116. package/dist/esm/models/components/updateagentrequest.d.ts +5 -0
  117. package/dist/esm/models/components/updateagentrequest.d.ts.map +1 -1
  118. package/dist/esm/models/components/updateagentrequest.js +4 -0
  119. package/dist/esm/models/components/updateagentrequest.js.map +1 -1
  120. package/dist/esm/models/operations/acceptclusterinvite.d.ts +6 -0
  121. package/dist/esm/models/operations/acceptclusterinvite.d.ts.map +1 -1
  122. package/dist/esm/models/operations/acceptclusterinvite.js +6 -0
  123. package/dist/esm/models/operations/acceptclusterinvite.js.map +1 -1
  124. package/dist/esm/models/operations/createscopedapikey.d.ts +6 -0
  125. package/dist/esm/models/operations/createscopedapikey.d.ts.map +1 -1
  126. package/dist/esm/models/operations/createscopedapikey.js +6 -0
  127. package/dist/esm/models/operations/createscopedapikey.js.map +1 -1
  128. package/dist/esm/models/operations/getmodelquota.d.ts +83 -0
  129. package/dist/esm/models/operations/getmodelquota.d.ts.map +1 -0
  130. package/dist/esm/models/operations/getmodelquota.js +111 -0
  131. package/dist/esm/models/operations/getmodelquota.js.map +1 -0
  132. package/dist/esm/models/operations/index.d.ts +1 -0
  133. package/dist/esm/models/operations/index.d.ts.map +1 -1
  134. package/dist/esm/models/operations/index.js +1 -0
  135. package/dist/esm/models/operations/index.js.map +1 -1
  136. package/dist/esm/models/operations/listscopedapikeys.d.ts +6 -0
  137. package/dist/esm/models/operations/listscopedapikeys.d.ts.map +1 -1
  138. package/dist/esm/models/operations/listscopedapikeys.js +6 -0
  139. package/dist/esm/models/operations/listscopedapikeys.js.map +1 -1
  140. package/dist/esm/models/operations/listserviceaccountapikeys.d.ts +6 -0
  141. package/dist/esm/models/operations/listserviceaccountapikeys.d.ts.map +1 -1
  142. package/dist/esm/models/operations/listserviceaccountapikeys.js +6 -0
  143. package/dist/esm/models/operations/listserviceaccountapikeys.js.map +1 -1
  144. package/dist/esm/models/operations/reissueownerkey.d.ts +6 -0
  145. package/dist/esm/models/operations/reissueownerkey.d.ts.map +1 -1
  146. package/dist/esm/models/operations/reissueownerkey.js +6 -0
  147. package/dist/esm/models/operations/reissueownerkey.js.map +1 -1
  148. package/dist/esm/models/operations/updatescopedapikey.d.ts +6 -0
  149. package/dist/esm/models/operations/updatescopedapikey.d.ts.map +1 -1
  150. package/dist/esm/models/operations/updatescopedapikey.js +6 -0
  151. package/dist/esm/models/operations/updatescopedapikey.js.map +1 -1
  152. package/dist/esm/react-query/index.d.ts +1 -0
  153. package/dist/esm/react-query/index.d.ts.map +1 -1
  154. package/dist/esm/react-query/index.js +1 -0
  155. package/dist/esm/react-query/index.js.map +1 -1
  156. package/dist/esm/react-query/llmModelsGetQuota.core.d.ts +16 -0
  157. package/dist/esm/react-query/llmModelsGetQuota.core.d.ts.map +1 -0
  158. package/dist/esm/react-query/llmModelsGetQuota.core.js +33 -0
  159. package/dist/esm/react-query/llmModelsGetQuota.core.js.map +1 -0
  160. package/dist/esm/react-query/llmModelsGetQuota.d.ts +42 -0
  161. package/dist/esm/react-query/llmModelsGetQuota.d.ts.map +1 -0
  162. package/dist/esm/react-query/llmModelsGetQuota.js +50 -0
  163. package/dist/esm/react-query/llmModelsGetQuota.js.map +1 -0
  164. package/dist/esm/sdk/models.d.ts +7 -0
  165. package/dist/esm/sdk/models.d.ts.map +1 -1
  166. package/dist/esm/sdk/models.js +10 -0
  167. package/dist/esm/sdk/models.js.map +1 -1
  168. package/jsr.json +1 -1
  169. package/package.json +1 -1
  170. package/src/funcs/llmModelsGetQuota.ts +190 -0
  171. package/src/lib/config.ts +2 -2
  172. package/src/mcp-server/mcp-server.ts +1 -1
  173. package/src/mcp-server/server.ts +3 -1
  174. package/src/mcp-server/tools/llmModelsGetQuota.ts +37 -0
  175. package/src/models/components/agent.ts +6 -0
  176. package/src/models/components/agentversion.ts +6 -0
  177. package/src/models/components/createagentrequest.ts +9 -0
  178. package/src/models/components/responsescreaterequest.ts +9 -0
  179. package/src/models/components/updateagentrequest.ts +9 -0
  180. package/src/models/operations/acceptclusterinvite.ts +12 -0
  181. package/src/models/operations/createscopedapikey.ts +12 -0
  182. package/src/models/operations/getmodelquota.ts +229 -0
  183. package/src/models/operations/index.ts +1 -0
  184. package/src/models/operations/listscopedapikeys.ts +12 -0
  185. package/src/models/operations/listserviceaccountapikeys.ts +12 -0
  186. package/src/models/operations/reissueownerkey.ts +12 -0
  187. package/src/models/operations/updatescopedapikey.ts +12 -0
  188. package/src/react-query/index.ts +1 -0
  189. package/src/react-query/llmModelsGetQuota.core.ts +81 -0
  190. package/src/react-query/llmModelsGetQuota.ts +149 -0
  191. package/src/sdk/models.ts +18 -0
@@ -38,6 +38,10 @@ export type CreateAgentRequest = {
38
38
  toolChoice?: any | undefined;
39
39
  parallelToolCalls?: boolean | undefined;
40
40
  maxToolCalls?: number | null | undefined;
41
+ /**
42
+ * Ordered chain of model IDs the gateway tries when a model call fails on the model before it; forwarded unchanged to the Responses API, which validates it. Empty (the default) means the run keeps the gateway's own fallback rules for the model.
43
+ */
44
+ fallbackModels?: Array<string> | undefined;
41
45
  text?: AgentTextConfiguration | null | undefined;
42
46
  reasoning?: AgentReasoningConfiguration | null | undefined;
43
47
  metadata?: { [k: string]: string } | undefined;
@@ -57,6 +61,7 @@ export const CreateAgentRequest$inboundSchema: z.ZodType<
57
61
  tool_choice: z.any().optional(),
58
62
  parallel_tool_calls: z.boolean().default(true),
59
63
  max_tool_calls: z.nullable(z.number().int()).optional(),
64
+ fallback_models: z.array(z.string()).optional(),
60
65
  text: z.nullable(AgentTextConfiguration$inboundSchema).optional(),
61
66
  reasoning: z.nullable(AgentReasoningConfiguration$inboundSchema).optional(),
62
67
  metadata: z.record(z.string()).optional(),
@@ -65,6 +70,7 @@ export const CreateAgentRequest$inboundSchema: z.ZodType<
65
70
  "tool_choice": "toolChoice",
66
71
  "parallel_tool_calls": "parallelToolCalls",
67
72
  "max_tool_calls": "maxToolCalls",
73
+ "fallback_models": "fallbackModels",
68
74
  });
69
75
  });
70
76
  /** @internal */
@@ -77,6 +83,7 @@ export type CreateAgentRequest$Outbound = {
77
83
  tool_choice?: any | undefined;
78
84
  parallel_tool_calls: boolean;
79
85
  max_tool_calls?: number | null | undefined;
86
+ fallback_models?: Array<string> | undefined;
80
87
  text?: AgentTextConfiguration$Outbound | null | undefined;
81
88
  reasoning?: AgentReasoningConfiguration$Outbound | null | undefined;
82
89
  metadata?: { [k: string]: string } | undefined;
@@ -96,6 +103,7 @@ export const CreateAgentRequest$outboundSchema: z.ZodType<
96
103
  toolChoice: z.any().optional(),
97
104
  parallelToolCalls: z.boolean().default(true),
98
105
  maxToolCalls: z.nullable(z.number().int()).optional(),
106
+ fallbackModels: z.array(z.string()).optional(),
99
107
  text: z.nullable(AgentTextConfiguration$outboundSchema).optional(),
100
108
  reasoning: z.nullable(AgentReasoningConfiguration$outboundSchema).optional(),
101
109
  metadata: z.record(z.string()).optional(),
@@ -104,6 +112,7 @@ export const CreateAgentRequest$outboundSchema: z.ZodType<
104
112
  toolChoice: "tool_choice",
105
113
  parallelToolCalls: "parallel_tool_calls",
106
114
  maxToolCalls: "max_tool_calls",
115
+ fallbackModels: "fallback_models",
107
116
  });
108
117
  });
109
118
 
@@ -265,6 +265,10 @@ export type ResponsesCreateRequest = {
265
265
  * The ID of the model to use for generating the response.
266
266
  */
267
267
  model: string;
268
+ /**
269
+ * Ordered list of model IDs to fall back to when a model call fails (provider error or unhealthy provider), tried in order after `model`. Each entry must be a model available to your organization, including your own registered models, and may not be `auto`. When set, this chain replaces any fallback rules configured on the models themselves; an empty list disables fallback for the request. With `model: "auto"`, the chain is tried after the routed model fails. Once the run has switched to a fallback it stays on it for the remaining steps; a step that has already streamed output does not fall back. The served model is reported in `resolved_model`. Maximum length is configured by the gateway (default 5).
270
+ */
271
+ fallbackModels?: Array<string> | undefined;
268
272
  /**
269
273
  * The user input to send to the agent. Can be a simple text string for basic queries, or an array of item objects containing text, images, files, or audio for multimodal interactions. This is the main content the agent will respond to.
270
274
  */
@@ -799,6 +803,7 @@ export const ResponsesCreateRequest$inboundSchema: z.ZodType<
799
803
  unknown
800
804
  > = z.object({
801
805
  model: z.string(),
806
+ fallback_models: z.array(z.string()).optional(),
802
807
  input: z.union([z.string(), z.array(Item$inboundSchema)]).optional(),
803
808
  instructions: z.string().optional(),
804
809
  conversation: z.nullable(z.union([Conversation$inboundSchema, z.string()]))
@@ -865,6 +870,7 @@ export const ResponsesCreateRequest$inboundSchema: z.ZodType<
865
870
  user: z.string().optional(),
866
871
  }).transform((v) => {
867
872
  return remap$(v, {
873
+ "fallback_models": "fallbackModels",
868
874
  "previous_response_id": "previousResponseId",
869
875
  "stream_options": "streamOptions",
870
876
  "stream_events": "streamEvents",
@@ -895,6 +901,7 @@ export const ResponsesCreateRequest$inboundSchema: z.ZodType<
895
901
  /** @internal */
896
902
  export type ResponsesCreateRequest$Outbound = {
897
903
  model: string;
904
+ fallback_models?: Array<string> | undefined;
898
905
  input?: string | Array<Item$Outbound> | undefined;
899
906
  instructions?: string | undefined;
900
907
  conversation?: Conversation$Outbound | string | null | undefined;
@@ -967,6 +974,7 @@ export const ResponsesCreateRequest$outboundSchema: z.ZodType<
967
974
  ResponsesCreateRequest
968
975
  > = z.object({
969
976
  model: z.string(),
977
+ fallbackModels: z.array(z.string()).optional(),
970
978
  input: z.union([z.string(), z.array(Item$outboundSchema)]).optional(),
971
979
  instructions: z.string().optional(),
972
980
  conversation: z.nullable(z.union([Conversation$outboundSchema, z.string()]))
@@ -1033,6 +1041,7 @@ export const ResponsesCreateRequest$outboundSchema: z.ZodType<
1033
1041
  user: z.string().optional(),
1034
1042
  }).transform((v) => {
1035
1043
  return remap$(v, {
1044
+ fallbackModels: "fallback_models",
1036
1045
  previousResponseId: "previous_response_id",
1037
1046
  streamOptions: "stream_options",
1038
1047
  streamEvents: "stream_events",
@@ -41,6 +41,10 @@ export type UpdateAgentRequest = {
41
41
  toolChoice?: any | undefined;
42
42
  parallelToolCalls?: boolean | undefined;
43
43
  maxToolCalls?: number | null | undefined;
44
+ /**
45
+ * Ordered chain of model IDs the gateway tries when a model call fails on the model before it; forwarded unchanged to the Responses API, which validates it. Empty (the default) means the run keeps the gateway's own fallback rules for the model.
46
+ */
47
+ fallbackModels?: Array<string> | undefined;
44
48
  text?: AgentTextConfiguration | null | undefined;
45
49
  reasoning?: AgentReasoningConfiguration | null | undefined;
46
50
  metadata?: { [k: string]: string } | undefined;
@@ -60,6 +64,7 @@ export const UpdateAgentRequest$inboundSchema: z.ZodType<
60
64
  tool_choice: z.any().optional(),
61
65
  parallel_tool_calls: z.boolean().optional(),
62
66
  max_tool_calls: z.nullable(z.number().int()).optional(),
67
+ fallback_models: z.array(z.string()).optional(),
63
68
  text: z.nullable(AgentTextConfiguration$inboundSchema).optional(),
64
69
  reasoning: z.nullable(AgentReasoningConfiguration$inboundSchema).optional(),
65
70
  metadata: z.record(z.string()).optional(),
@@ -68,6 +73,7 @@ export const UpdateAgentRequest$inboundSchema: z.ZodType<
68
73
  "tool_choice": "toolChoice",
69
74
  "parallel_tool_calls": "parallelToolCalls",
70
75
  "max_tool_calls": "maxToolCalls",
76
+ "fallback_models": "fallbackModels",
71
77
  });
72
78
  });
73
79
  /** @internal */
@@ -80,6 +86,7 @@ export type UpdateAgentRequest$Outbound = {
80
86
  tool_choice?: any | undefined;
81
87
  parallel_tool_calls?: boolean | undefined;
82
88
  max_tool_calls?: number | null | undefined;
89
+ fallback_models?: Array<string> | undefined;
83
90
  text?: AgentTextConfiguration$Outbound | null | undefined;
84
91
  reasoning?: AgentReasoningConfiguration$Outbound | null | undefined;
85
92
  metadata?: { [k: string]: string } | undefined;
@@ -99,6 +106,7 @@ export const UpdateAgentRequest$outboundSchema: z.ZodType<
99
106
  toolChoice: z.any().optional(),
100
107
  parallelToolCalls: z.boolean().optional(),
101
108
  maxToolCalls: z.nullable(z.number().int()).optional(),
109
+ fallbackModels: z.array(z.string()).optional(),
102
110
  text: z.nullable(AgentTextConfiguration$outboundSchema).optional(),
103
111
  reasoning: z.nullable(AgentReasoningConfiguration$outboundSchema).optional(),
104
112
  metadata: z.record(z.string()).optional(),
@@ -107,6 +115,7 @@ export const UpdateAgentRequest$outboundSchema: z.ZodType<
107
115
  toolChoice: "tool_choice",
108
116
  parallelToolCalls: "parallel_tool_calls",
109
117
  maxToolCalls: "max_tool_calls",
118
+ fallbackModels: "fallback_models",
110
119
  });
111
120
  });
112
121
 
@@ -60,6 +60,9 @@ export type AcceptClusterInviteApiKey = {
60
60
  orgId: string | null;
61
61
  teamId: string | null;
62
62
  scopes: Array<string>;
63
+ rateLimitEnabled?: boolean | null | undefined;
64
+ rateLimitTimeWindow?: number | null | undefined;
65
+ rateLimitMax?: number | null | undefined;
63
66
  expiresAt?: string | null | undefined;
64
67
  };
65
68
 
@@ -310,6 +313,9 @@ export const AcceptClusterInviteApiKey$inboundSchema: z.ZodType<
310
313
  orgId: z.nullable(z.string()),
311
314
  teamId: z.nullable(z.string()),
312
315
  scopes: z.array(z.string()),
316
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
317
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
318
+ rateLimitMax: z.nullable(z.number()).optional(),
313
319
  expiresAt: z.nullable(z.string()).optional(),
314
320
  });
315
321
  /** @internal */
@@ -324,6 +330,9 @@ export type AcceptClusterInviteApiKey$Outbound = {
324
330
  orgId: string | null;
325
331
  teamId: string | null;
326
332
  scopes: Array<string>;
333
+ rateLimitEnabled?: boolean | null | undefined;
334
+ rateLimitTimeWindow?: number | null | undefined;
335
+ rateLimitMax?: number | null | undefined;
327
336
  expiresAt?: string | null | undefined;
328
337
  };
329
338
 
@@ -343,6 +352,9 @@ export const AcceptClusterInviteApiKey$outboundSchema: z.ZodType<
343
352
  orgId: z.nullable(z.string()),
344
353
  teamId: z.nullable(z.string()),
345
354
  scopes: z.array(z.string()),
355
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
356
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
357
+ rateLimitMax: z.nullable(z.number()).optional(),
346
358
  expiresAt: z.nullable(z.string()).optional(),
347
359
  });
348
360
 
@@ -53,6 +53,9 @@ export type CreateScopedApiKeyResponseBody = {
53
53
  orgId: string | null;
54
54
  teamId: string | null;
55
55
  scopes: Array<string>;
56
+ rateLimitEnabled?: boolean | null | undefined;
57
+ rateLimitTimeWindow?: number | null | undefined;
58
+ rateLimitMax?: number | null | undefined;
56
59
  expiresAt?: string | null | undefined;
57
60
  };
58
61
 
@@ -233,6 +236,9 @@ export const CreateScopedApiKeyResponseBody$inboundSchema: z.ZodType<
233
236
  orgId: z.nullable(z.string()),
234
237
  teamId: z.nullable(z.string()),
235
238
  scopes: z.array(z.string()),
239
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
240
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
241
+ rateLimitMax: z.nullable(z.number()).optional(),
236
242
  expiresAt: z.nullable(z.string()).optional(),
237
243
  });
238
244
  /** @internal */
@@ -247,6 +253,9 @@ export type CreateScopedApiKeyResponseBody$Outbound = {
247
253
  orgId: string | null;
248
254
  teamId: string | null;
249
255
  scopes: Array<string>;
256
+ rateLimitEnabled?: boolean | null | undefined;
257
+ rateLimitTimeWindow?: number | null | undefined;
258
+ rateLimitMax?: number | null | undefined;
250
259
  expiresAt?: string | null | undefined;
251
260
  };
252
261
 
@@ -266,6 +275,9 @@ export const CreateScopedApiKeyResponseBody$outboundSchema: z.ZodType<
266
275
  orgId: z.nullable(z.string()),
267
276
  teamId: z.nullable(z.string()),
268
277
  scopes: z.array(z.string()),
278
+ rateLimitEnabled: z.nullable(z.boolean()).optional(),
279
+ rateLimitTimeWindow: z.nullable(z.number()).optional(),
280
+ rateLimitMax: z.nullable(z.number()).optional(),
269
281
  expiresAt: z.nullable(z.string()).optional(),
270
282
  });
271
283
 
@@ -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";