litellm-api 0.0.2 → 1.0.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.
package/dist/index.cjs CHANGED
@@ -1,841 +1,437 @@
1
- 'use strict';
1
+ Object.defineProperty(exports, '__esModule', { value: true });
2
+
3
+ var z = require('zod');
4
+
5
+ function _interopNamespace(e) {
6
+ if (e && e.__esModule) return e;
7
+ var n = Object.create(null);
8
+ if (e) {
9
+ Object.keys(e).forEach(function (k) {
10
+ if (k !== 'default') {
11
+ var d = Object.getOwnPropertyDescriptor(e, k);
12
+ Object.defineProperty(n, k, d.get ? d : {
13
+ enumerable: true,
14
+ get: function () { return e[k]; }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n.default = e;
20
+ return n;
21
+ }
22
+
23
+ var z__namespace = /*#__PURE__*/_interopNamespace(z);
2
24
 
3
25
  function notEmpty(value) {
4
- return value !== null && value !== void 0;
26
+ return value !== null && value !== undefined;
5
27
  }
6
28
  function compactObject(obj) {
7
- return Object.fromEntries(Object.entries(obj).filter(([, value]) => notEmpty(value)));
29
+ return Object.fromEntries(Object.entries(obj).filter(([, value])=>notEmpty(value)));
8
30
  }
9
31
 
10
- async function fetch$1({
11
- url,
12
- method,
13
- body,
14
- headers,
15
- pathParams,
16
- queryParams,
17
- signal,
18
- token,
19
- fetchImpl,
20
- baseUrl
21
- }) {
22
- try {
23
- const requestHeaders = compactObject({
24
- "Content-Type": "application/json",
25
- Authorization: token ? `Bearer ${token}` : void 0,
26
- ...headers
27
- });
28
- if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
29
- delete requestHeaders["Content-Type"];
30
- }
31
- const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
32
- const response = await fetchImpl(`${baseUrl}${resolveUrl(url, queryParams, pathParams)}`, {
33
- signal,
34
- method: method.toUpperCase(),
35
- body: payload,
36
- headers: requestHeaders
37
- });
38
- if (!response.ok) {
39
- let error;
40
- try {
41
- error = await response.json();
42
- } catch (e) {
43
- error = {
44
- status: "unknown",
45
- payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
32
+ async function client({ url, method, body, headers, pathParams, queryParams, signal, baseUrl = "", token = null, fetchImpl = fetch }) {
33
+ try {
34
+ const requestHeaders = compactObject({
35
+ "Content-Type": "application/json",
36
+ Authorization: token ? `Bearer ${token}` : undefined,
37
+ ...headers
38
+ });
39
+ if (requestHeaders["Content-Type"]?.toLowerCase().includes("multipart/form-data")) {
40
+ delete requestHeaders["Content-Type"];
41
+ }
42
+ const payload = body instanceof FormData ? body : requestHeaders["Content-Type"] === "application/json" ? JSON.stringify(body) : body;
43
+ const fullUrl = `${baseUrl}${resolveUrl(url, queryParams, pathParams)}`;
44
+ const response = await fetchImpl(fullUrl, {
45
+ signal,
46
+ method: method.toUpperCase(),
47
+ body: payload,
48
+ headers: requestHeaders
49
+ });
50
+ if (!response.ok) {
51
+ let error;
52
+ try {
53
+ error = await response.json();
54
+ } catch (e) {
55
+ error = {
56
+ status: "unknown",
57
+ payload: e instanceof Error ? `Unexpected error (${e.message})` : "Unexpected error"
58
+ };
59
+ }
60
+ throw error;
61
+ }
62
+ if (response.headers?.get("content-type")?.includes("json")) {
63
+ return await response.json();
64
+ } else {
65
+ return await response.text();
66
+ }
67
+ } catch (e) {
68
+ const errorObject = {
69
+ name: "unknown",
70
+ message: e instanceof Error ? `Network error (${e.message})` : "Network error",
71
+ stack: e
46
72
  };
47
- }
48
- throw error;
49
- }
50
- if (response.headers?.get("content-type")?.includes("json")) {
51
- return await response.json();
52
- } else {
53
- return await response.text();
73
+ throw errorObject;
54
74
  }
55
- } catch (e) {
56
- let errorObject = {
57
- name: "unknown",
58
- message: e instanceof Error ? `Network error (${e.message})` : "Network error",
59
- stack: e
60
- };
61
- throw errorObject;
62
- }
63
75
  }
64
- const resolveUrl = (url, queryParams = {}, pathParams = {}) => {
65
- let query = new URLSearchParams(queryParams).toString();
66
- if (query) query = `?${query}`;
67
- return url.replace(/\{\w*\}/g, (key) => pathParams[key.slice(1, -1)] ?? "") + query;
76
+ const resolveUrl = (url, queryParams = {}, pathParams = {})=>{
77
+ let query = new URLSearchParams(queryParams).toString();
78
+ if (query) query = `?${query}`;
79
+ return url.replace(/\{\w*\}/g, (key)=>pathParams[key.slice(1, -1)] ?? "") + query;
68
80
  };
69
81
 
70
- const modelListModelsGet = (variables, signal) => fetch$1({
71
- url: "/models",
72
- method: "get",
73
- ...variables,
74
- signal
75
- });
76
- const modelListV1ModelsGet = (variables, signal) => fetch$1({
77
- url: "/v1/models",
78
- method: "get",
79
- ...variables,
80
- signal
81
- });
82
- const chatCompletionOpenaiDeploymentsModelChatCompletionsPost = (variables, signal) => fetch$1({ url: "/openai/deployments/{model}/chat/completions", method: "post", ...variables, signal });
83
- const chatCompletionEnginesModelChatCompletionsPost = (variables, signal) => fetch$1({ url: "/engines/{model}/chat/completions", method: "post", ...variables, signal });
84
- const chatCompletionChatCompletionsPost = (variables, signal) => fetch$1({ url: "/chat/completions", method: "post", ...variables, signal });
85
- const chatCompletionV1ChatCompletionsPost = (variables, signal) => fetch$1({ url: "/v1/chat/completions", method: "post", ...variables, signal });
86
- const completionOpenaiDeploymentsModelCompletionsPost = (variables, signal) => fetch$1({ url: "/openai/deployments/{model}/completions", method: "post", ...variables, signal });
87
- const completionEnginesModelCompletionsPost = (variables, signal) => fetch$1({ url: "/engines/{model}/completions", method: "post", ...variables, signal });
88
- const completionCompletionsPost = (variables, signal) => fetch$1({ url: "/completions", method: "post", ...variables, signal });
89
- const completionV1CompletionsPost = (variables, signal) => fetch$1({ url: "/v1/completions", method: "post", ...variables, signal });
90
- const embeddingsOpenaiDeploymentsModelEmbeddingsPost = (variables, signal) => fetch$1({ url: "/openai/deployments/{model}/embeddings", method: "post", ...variables, signal });
91
- const embeddingsEnginesModelEmbeddingsPost = (variables, signal) => fetch$1({ url: "/engines/{model}/embeddings", method: "post", ...variables, signal });
92
- const embeddingsEmbeddingsPost = (variables, signal) => fetch$1({ url: "/embeddings", method: "post", ...variables, signal });
93
- const embeddingsV1EmbeddingsPost = (variables, signal) => fetch$1({ url: "/v1/embeddings", method: "post", ...variables, signal });
94
- const imageGenerationImagesGenerationsPost = (variables, signal) => fetch$1(
95
- { url: "/images/generations", method: "post", ...variables, signal }
96
- );
97
- const imageGenerationV1ImagesGenerationsPost = (variables, signal) => fetch$1({ url: "/v1/images/generations", method: "post", ...variables, signal });
98
- const audioSpeechAudioSpeechPost = (variables, signal) => fetch$1({
99
- url: "/audio/speech",
100
- method: "post",
101
- ...variables,
102
- signal
103
- });
104
- const audioSpeechV1AudioSpeechPost = (variables, signal) => fetch$1({
105
- url: "/v1/audio/speech",
106
- method: "post",
107
- ...variables,
108
- signal
109
- });
110
- const audioTranscriptionsAudioTranscriptionsPost = (variables, signal) => fetch$1({ url: "/audio/transcriptions", method: "post", ...variables, signal });
111
- const audioTranscriptionsV1AudioTranscriptionsPost = (variables, signal) => fetch$1({ url: "/v1/audio/transcriptions", method: "post", ...variables, signal });
112
- const getAssistantsAssistantsGet = (variables, signal) => fetch$1({
113
- url: "/assistants",
114
- method: "get",
115
- ...variables,
116
- signal
117
- });
118
- const createAssistantAssistantsPost = (variables, signal) => fetch$1({
119
- url: "/assistants",
120
- method: "post",
121
- ...variables,
122
- signal
123
- });
124
- const getAssistantsV1AssistantsGet = (variables, signal) => fetch$1({
125
- url: "/v1/assistants",
126
- method: "get",
127
- ...variables,
128
- signal
129
- });
130
- const createAssistantV1AssistantsPost = (variables, signal) => fetch$1({
131
- url: "/v1/assistants",
132
- method: "post",
133
- ...variables,
134
- signal
135
- });
136
- const deleteAssistantAssistantsAssistantIdDelete = (variables, signal) => fetch$1({ url: "/assistants/{assistantId}", method: "delete", ...variables, signal });
137
- const deleteAssistantV1AssistantsAssistantIdDelete = (variables, signal) => fetch$1({ url: "/v1/assistants/{assistantId}", method: "delete", ...variables, signal });
138
- const createThreadsThreadsPost = (variables, signal) => fetch$1({
139
- url: "/threads",
140
- method: "post",
141
- ...variables,
142
- signal
143
- });
144
- const createThreadsV1ThreadsPost = (variables, signal) => fetch$1({
145
- url: "/v1/threads",
146
- method: "post",
147
- ...variables,
148
- signal
149
- });
150
- const getThreadThreadsThreadIdGet = (variables, signal) => fetch$1({ url: "/threads/{threadId}", method: "get", ...variables, signal });
151
- const getThreadV1ThreadsThreadIdGet = (variables, signal) => fetch$1({ url: "/v1/threads/{threadId}", method: "get", ...variables, signal });
152
- const addMessagesThreadsThreadIdMessagesPost = (variables, signal) => fetch$1({ url: "/threads/{threadId}/messages", method: "post", ...variables, signal });
153
- const getMessagesThreadsThreadIdMessagesGet = (variables, signal) => fetch$1({ url: "/threads/{threadId}/messages", method: "get", ...variables, signal });
154
- const addMessagesV1ThreadsThreadIdMessagesPost = (variables, signal) => fetch$1({ url: "/v1/threads/{threadId}/messages", method: "post", ...variables, signal });
155
- const getMessagesV1ThreadsThreadIdMessagesGet = (variables, signal) => fetch$1({ url: "/v1/threads/{threadId}/messages", method: "get", ...variables, signal });
156
- const runThreadThreadsThreadIdRunsPost = (variables, signal) => fetch$1({ url: "/threads/{threadId}/runs", method: "post", ...variables, signal });
157
- const runThreadV1ThreadsThreadIdRunsPost = (variables, signal) => fetch$1({ url: "/v1/threads/{threadId}/runs", method: "post", ...variables, signal });
158
- const moderationsModerationsPost = (variables, signal) => fetch$1({
159
- url: "/moderations",
160
- method: "post",
161
- ...variables,
162
- signal
163
- });
164
- const moderationsV1ModerationsPost = (variables, signal) => fetch$1({
165
- url: "/v1/moderations",
166
- method: "post",
167
- ...variables,
168
- signal
169
- });
170
- const tokenCounterUtilsTokenCounterPost = (variables, signal) => fetch$1({
171
- url: "/utils/token_counter",
172
- method: "post",
173
- ...variables,
174
- signal
175
- });
176
- const supportedOpenaiParamsUtilsSupportedOpenaiParamsGet = (variables, signal) => fetch$1({ url: "/utils/supported_openai_params", method: "get", ...variables, signal });
177
- const transformRequestUtilsTransformRequestPost = (variables, signal) => fetch$1({ url: "/utils/transform_request", method: "post", ...variables, signal });
178
- const modelInfoV1V1ModelInfoGet = (variables, signal) => fetch$1({ url: "/v1/model/info", method: "get", ...variables, signal });
179
- const modelInfoV1ModelInfoGet = (variables, signal) => fetch$1({ url: "/model/info", method: "get", ...variables, signal });
180
- const modelGroupInfoModelGroupInfoGet = (variables, signal) => fetch$1({ url: "/model_group/info", method: "get", ...variables, signal });
181
- const responsesApiResponsesPost = (variables, signal) => fetch$1({
182
- url: "/responses",
183
- method: "post",
184
- ...variables,
185
- signal
186
- });
187
- const responsesApiV1ResponsesPost = (variables, signal) => fetch$1({
188
- url: "/v1/responses",
189
- method: "post",
190
- ...variables,
191
- signal
192
- });
193
- const getResponseResponsesResponseIdGet = (variables, signal) => fetch$1({ url: "/responses/{responseId}", method: "get", ...variables, signal });
194
- const deleteResponseResponsesResponseIdDelete = (variables, signal) => fetch$1({ url: "/responses/{responseId}", method: "delete", ...variables, signal });
195
- const getResponseV1ResponsesResponseIdGet = (variables, signal) => fetch$1({ url: "/v1/responses/{responseId}", method: "get", ...variables, signal });
196
- const deleteResponseV1ResponsesResponseIdDelete = (variables, signal) => fetch$1({ url: "/v1/responses/{responseId}", method: "delete", ...variables, signal });
197
- const getResponseInputItemsResponsesResponseIdInputItemsGet = (variables, signal) => fetch$1({ url: "/responses/{responseId}/input_items", method: "get", ...variables, signal });
198
- const getResponseInputItemsV1ResponsesResponseIdInputItemsGet = (variables, signal) => fetch$1({ url: "/v1/responses/{responseId}/input_items", method: "get", ...variables, signal });
199
- const createBatchBatchesPost = (variables, signal) => fetch$1({ url: "/batches", method: "post", ...variables, signal });
200
- const listBatchesBatchesGet = (variables, signal) => fetch$1(
201
- { url: "/batches", method: "get", ...variables, signal }
202
- );
203
- const createBatchV1BatchesPost = (variables, signal) => fetch$1({ url: "/v1/batches", method: "post", ...variables, signal });
204
- const listBatchesV1BatchesGet = (variables, signal) => fetch$1({ url: "/v1/batches", method: "get", ...variables, signal });
205
- const createBatchProviderV1BatchesPost = (variables, signal) => fetch$1({ url: "/{provider}/v1/batches", method: "post", ...variables, signal });
206
- const listBatchesProviderV1BatchesGet = (variables, signal) => fetch$1({ url: "/{provider}/v1/batches", method: "get", ...variables, signal });
207
- const retrieveBatchBatchesBatchIdGet = (variables, signal) => fetch$1({ url: "/batches/{batchId}", method: "get", ...variables, signal });
208
- const retrieveBatchV1BatchesBatchIdGet = (variables, signal) => fetch$1({ url: "/v1/batches/{batchId}", method: "get", ...variables, signal });
209
- const retrieveBatchProviderV1BatchesBatchIdGet = (variables, signal) => fetch$1({ url: "/{provider}/v1/batches/{batchId}", method: "get", ...variables, signal });
210
- const cancelBatchBatchesBatchIdCancelPost = (variables, signal) => fetch$1({ url: "/batches/{batchId}/cancel", method: "post", ...variables, signal });
211
- const cancelBatchV1BatchesBatchIdCancelPost = (variables, signal) => fetch$1({ url: "/v1/batches/{batchId}/cancel", method: "post", ...variables, signal });
212
- const cancelBatchProviderV1BatchesBatchIdCancelPost = (variables, signal) => fetch$1({ url: "/{provider}/v1/batches/{batchId}/cancel", method: "post", ...variables, signal });
213
- const rerankRerankPost = (variables, signal) => fetch$1({
214
- url: "/rerank",
215
- method: "post",
216
- ...variables,
217
- signal
218
- });
219
- const rerankV1RerankPost = (variables, signal) => fetch$1({
220
- url: "/v1/rerank",
221
- method: "post",
222
- ...variables,
223
- signal
224
- });
225
- const rerankV2RerankPost = (variables, signal) => fetch$1({
226
- url: "/v2/rerank",
227
- method: "post",
228
- ...variables,
229
- signal
230
- });
231
- const createFineTuningJobFineTuningJobsPost = (variables, signal) => fetch$1({ url: "/fine_tuning/jobs", method: "post", ...variables, signal });
232
- const listFineTuningJobsFineTuningJobsGet = (variables, signal) => fetch$1({ url: "/fine_tuning/jobs", method: "get", ...variables, signal });
233
- const createFineTuningJobV1FineTuningJobsPost = (variables, signal) => fetch$1({ url: "/v1/fine_tuning/jobs", method: "post", ...variables, signal });
234
- const listFineTuningJobsV1FineTuningJobsGet = (variables, signal) => fetch$1({ url: "/v1/fine_tuning/jobs", method: "get", ...variables, signal });
235
- const retrieveFineTuningJobFineTuningJobsFineTuningJobIdGet = (variables, signal) => fetch$1({ url: "/fine_tuning/jobs/{fineTuningJobId}", method: "get", ...variables, signal });
236
- const retrieveFineTuningJobV1FineTuningJobsFineTuningJobIdGet = (variables, signal) => fetch$1({ url: "/v1/fine_tuning/jobs/{fineTuningJobId}", method: "get", ...variables, signal });
237
- const cancelFineTuningJobFineTuningJobsFineTuningJobIdCancelPost = (variables, signal) => fetch$1({ url: "/fine_tuning/jobs/{fineTuningJobId}/cancel", method: "post", ...variables, signal });
238
- const cancelFineTuningJobV1FineTuningJobsFineTuningJobIdCancelPost = (variables, signal) => fetch$1({ url: "/v1/fine_tuning/jobs/{fineTuningJobId}/cancel", method: "post", ...variables, signal });
239
- const getCredentialsCredentialsGet = (variables, signal) => fetch$1({
240
- url: "/credentials",
241
- method: "get",
242
- ...variables,
243
- signal
244
- });
245
- const createCredentialCredentialsPost = (variables, signal) => fetch$1({ url: "/credentials", method: "post", ...variables, signal });
246
- const getCredentialCredentialsByModelModelIdGet = (variables, signal) => fetch$1({ url: "/credentials/by_model/{modelId}", method: "get", ...variables, signal });
247
- const getCredentialCredentialsByNameCredentialNameGet = (variables, signal) => fetch$1({ url: "/credentials/by_name/{credentialName}", method: "get", ...variables, signal });
248
- const deleteCredentialCredentialsCredentialNameDelete = (variables, signal) => fetch$1({ url: "/credentials/{credentialName}", method: "delete", ...variables, signal });
249
- const updateCredentialCredentialsCredentialNamePatch = (variables, signal) => fetch$1({ url: "/credentials/{credentialName}", method: "patch", ...variables, signal });
250
- const handleSseMcpGet = (variables, signal) => fetch$1({ url: "/mcp/", method: "get", ...variables, signal });
251
- const handleMessagesMcpSseMessagesPost = (variables, signal) => fetch$1({
252
- url: "/mcp/sse/messages",
253
- method: "post",
254
- ...variables,
255
- signal
256
- });
257
- const listToolRestApiMcpToolsListGet = (variables, signal) => fetch$1({
258
- url: "/mcp/tools/list",
259
- method: "get",
260
- ...variables,
261
- signal
262
- });
263
- const callToolRestApiMcpToolsCallPost = (variables, signal) => fetch$1({
264
- url: "/mcp/tools/call",
265
- method: "post",
266
- ...variables,
267
- signal
268
- });
269
- const testEndpointTestGet = (variables, signal) => fetch$1({
270
- url: "/test",
271
- method: "get",
272
- ...variables,
273
- signal
274
- });
275
- const healthServicesEndpointHealthServicesGet = (variables, signal) => fetch$1({ url: "/health/services", method: "get", ...variables, signal });
276
- const healthEndpointHealthGet = (variables, signal) => fetch$1({ url: "/health", method: "get", ...variables, signal });
277
- const activeCallbacksActiveCallbacksGet = (variables, signal) => fetch$1({
278
- url: "/active/callbacks",
279
- method: "get",
280
- ...variables,
281
- signal
282
- });
283
- const activeCallbacksSettingsGet = (variables, signal) => fetch$1({
284
- url: "/settings",
285
- method: "get",
286
- ...variables,
287
- signal
288
- });
289
- const healthReadinessHealthReadinessGet = (variables, signal) => fetch$1({
290
- url: "/health/readiness",
291
- method: "get",
292
- ...variables,
293
- signal
294
- });
295
- const healthLivelinessHealthLivenessGet = (variables, signal) => fetch$1({
296
- url: "/health/liveness",
297
- method: "get",
298
- ...variables,
299
- signal
300
- });
301
- const healthLivelinessHealthLivelinessGet = (variables, signal) => fetch$1({
302
- url: "/health/liveliness",
303
- method: "get",
304
- ...variables,
305
- signal
306
- });
307
- const testModelConnectionHealthTestConnectionPost = (variables, signal) => fetch$1({ url: "/health/test_connection", method: "post", ...variables, signal });
308
- const generateKeyFnKeyGeneratePost = (variables, signal) => fetch$1({ url: "/key/generate", method: "post", ...variables, signal });
309
- const updateKeyFnKeyUpdatePost = (variables, signal) => fetch$1({ url: "/key/update", method: "post", ...variables, signal });
310
- const deleteKeyFnKeyDeletePost = (variables, signal) => fetch$1({ url: "/key/delete", method: "post", ...variables, signal });
311
- const infoKeyFnKeyInfoGet = (variables, signal) => fetch$1({
312
- url: "/key/info",
313
- method: "get",
314
- ...variables,
315
- signal
316
- });
317
- const regenerateKeyFnKeyRegeneratePost = (variables, signal) => fetch$1({ url: "/key/regenerate", method: "post", ...variables, signal });
318
- const regenerateKeyFnKeyKeyRegeneratePost = (variables, signal) => fetch$1({ url: "/key/{key}/regenerate", method: "post", ...variables, signal });
319
- const listKeysKeyListGet = (variables, signal) => fetch$1({
320
- url: "/key/list",
321
- method: "get",
322
- ...variables,
323
- signal
324
- });
325
- const blockKeyKeyBlockPost = (variables, signal) => fetch$1({ url: "/key/block", method: "post", ...variables, signal });
326
- const unblockKeyKeyUnblockPost = (variables, signal) => fetch$1({ url: "/key/unblock", method: "post", ...variables, signal });
327
- const keyHealthKeyHealthPost = (variables, signal) => fetch$1({
328
- url: "/key/health",
329
- method: "post",
330
- ...variables,
331
- signal
332
- });
333
- const newUserUserNewPost = (variables, signal) => fetch$1({
334
- url: "/user/new",
335
- method: "post",
336
- ...variables,
337
- signal
338
- });
339
- const userInfoUserInfoGet = (variables, signal) => fetch$1({
340
- url: "/user/info",
341
- method: "get",
342
- ...variables,
343
- signal
344
- });
345
- const userUpdateUserUpdatePost = (variables, signal) => fetch$1({
346
- url: "/user/update",
347
- method: "post",
348
- ...variables,
349
- signal
350
- });
351
- const getUsersUserListGet = (variables, signal) => fetch$1({
352
- url: "/user/list",
353
- method: "get",
354
- ...variables,
355
- signal
356
- });
357
- const getUsersUserGetUsersGet = (variables, signal) => fetch$1({ url: "/user/get_users", method: "get", ...variables, signal });
358
- const deleteUserUserDeletePost = (variables, signal) => fetch$1({ url: "/user/delete", method: "post", ...variables, signal });
359
- const getUserDailyActivityUserDailyActivityGet = (variables, signal) => fetch$1({ url: "/user/daily/activity", method: "get", ...variables, signal });
360
- const newTeamTeamNewPost = (variables, signal) => fetch$1({
361
- url: "/team/new",
362
- method: "post",
363
- ...variables,
364
- signal
365
- });
366
- const updateTeamTeamUpdatePost = (variables, signal) => fetch$1({ url: "/team/update", method: "post", ...variables, signal });
367
- const teamMemberAddTeamMemberAddPost = (variables, signal) => fetch$1({
368
- url: "/team/member_add",
369
- method: "post",
370
- ...variables,
371
- signal
372
- });
373
- const teamMemberDeleteTeamMemberDeletePost = (variables, signal) => fetch$1({ url: "/team/member_delete", method: "post", ...variables, signal });
374
- const teamMemberUpdateTeamMemberUpdatePost = (variables, signal) => fetch$1({ url: "/team/member_update", method: "post", ...variables, signal });
375
- const deleteTeamTeamDeletePost = (variables, signal) => fetch$1({ url: "/team/delete", method: "post", ...variables, signal });
376
- const teamInfoTeamInfoGet = (variables, signal) => fetch$1({
377
- url: "/team/info",
378
- method: "get",
379
- ...variables,
380
- signal
381
- });
382
- const blockTeamTeamBlockPost = (variables, signal) => fetch$1({
383
- url: "/team/block",
384
- method: "post",
385
- ...variables,
386
- signal
387
- });
388
- const unblockTeamTeamUnblockPost = (variables, signal) => fetch$1({
389
- url: "/team/unblock",
390
- method: "post",
391
- ...variables,
392
- signal
393
- });
394
- const listTeamTeamListGet = (variables, signal) => fetch$1({
395
- url: "/team/list",
396
- method: "get",
397
- ...variables,
398
- signal
399
- });
400
- const teamModelAddTeamModelAddPost = (variables, signal) => fetch$1({ url: "/team/model/add", method: "post", ...variables, signal });
401
- const teamModelDeleteTeamModelDeletePost = (variables, signal) => fetch$1({ url: "/team/model/delete", method: "post", ...variables, signal });
402
- const newOrganizationOrganizationNewPost = (variables, signal) => fetch$1({ url: "/organization/new", method: "post", ...variables, signal });
403
- const updateOrganizationOrganizationUpdatePatch = (variables, signal) => fetch$1({ url: "/organization/update", method: "patch", ...variables, signal });
404
- const deleteOrganizationOrganizationDeleteDelete = (variables, signal) => fetch$1({ url: "/organization/delete", method: "delete", ...variables, signal });
405
- const listOrganizationOrganizationListGet = (variables, signal) => fetch$1({
406
- url: "/organization/list",
407
- method: "get",
408
- ...variables,
409
- signal
410
- });
411
- const infoOrganizationOrganizationInfoGet = (variables, signal) => fetch$1({ url: "/organization/info", method: "get", ...variables, signal });
412
- const deprecatedInfoOrganizationOrganizationInfoPost = (variables, signal) => fetch$1({ url: "/organization/info", method: "post", ...variables, signal });
413
- const organizationMemberAddOrganizationMemberAddPost = (variables, signal) => fetch$1({ url: "/organization/member_add", method: "post", ...variables, signal });
414
- const organizationMemberUpdateOrganizationMemberUpdatePatch = (variables, signal) => fetch$1({ url: "/organization/member_update", method: "patch", ...variables, signal });
415
- const organizationMemberDeleteOrganizationMemberDeleteDelete = (variables, signal) => fetch$1({ url: "/organization/member_delete", method: "delete", ...variables, signal });
416
- const blockUserCustomerBlockPost = (variables, signal) => fetch$1({
417
- url: "/customer/block",
418
- method: "post",
419
- ...variables,
420
- signal
421
- });
422
- const unblockUserCustomerUnblockPost = (variables, signal) => fetch$1({
423
- url: "/customer/unblock",
424
- method: "post",
425
- ...variables,
426
- signal
427
- });
428
- const newEndUserCustomerNewPost = (variables, signal) => fetch$1({
429
- url: "/customer/new",
430
- method: "post",
431
- ...variables,
432
- signal
433
- });
434
- const endUserInfoCustomerInfoGet = (variables, signal) => fetch$1({ url: "/customer/info", method: "get", ...variables, signal });
435
- const updateEndUserCustomerUpdatePost = (variables, signal) => fetch$1({ url: "/customer/update", method: "post", ...variables, signal });
436
- const deleteEndUserCustomerDeletePost = (variables, signal) => fetch$1({ url: "/customer/delete", method: "post", ...variables, signal });
437
- const listEndUserCustomerListGet = (variables, signal) => fetch$1({
438
- url: "/customer/list",
439
- method: "get",
440
- ...variables,
441
- signal
442
- });
443
- const viewSpendTagsSpendTagsGet = (variables, signal) => fetch$1({ url: "/spend/tags", method: "get", ...variables, signal });
444
- const getGlobalSpendReportGlobalSpendReportGet = (variables, signal) => fetch$1({ url: "/global/spend/report", method: "get", ...variables, signal });
445
- const globalViewSpendTagsGlobalSpendTagsGet = (variables, signal) => fetch$1({ url: "/global/spend/tags", method: "get", ...variables, signal });
446
- const calculateSpendSpendCalculatePost = (variables, signal) => fetch$1({ url: "/spend/calculate", method: "post", ...variables, signal });
447
- const viewSpendLogsSpendLogsGet = (variables, signal) => fetch$1({ url: "/spend/logs", method: "get", ...variables, signal });
448
- const globalSpendResetGlobalSpendResetPost = (variables, signal) => fetch$1(
449
- { url: "/global/spend/reset", method: "post", ...variables, signal }
450
- );
451
- const cachePingCachePingGet = (variables, signal) => fetch$1({
452
- url: "/cache/ping",
453
- method: "get",
454
- ...variables,
455
- signal
456
- });
457
- const cacheDeleteCacheDeletePost = (variables, signal) => fetch$1({
458
- url: "/cache/delete",
459
- method: "post",
460
- ...variables,
461
- signal
462
- });
463
- const cacheRedisInfoCacheRedisInfoGet = (variables, signal) => fetch$1({
464
- url: "/cache/redis/info",
465
- method: "get",
466
- ...variables,
467
- signal
468
- });
469
- const cacheFlushallCacheFlushallPost = (variables, signal) => fetch$1({
470
- url: "/cache/flushall",
471
- method: "post",
472
- ...variables,
473
- signal
474
- });
475
- const listGuardrailsGuardrailsListGet = (variables, signal) => fetch$1({
476
- url: "/guardrails/list",
477
- method: "get",
478
- ...variables,
479
- signal
480
- });
481
- const addAllowedIpAddAllowedIpPost = (variables, signal) => fetch$1({
482
- url: "/add/allowed_ip",
483
- method: "post",
484
- ...variables,
485
- signal
486
- });
487
- const deleteAllowedIpDeleteAllowedIpPost = (variables, signal) => fetch$1({ url: "/delete/allowed_ip", method: "post", ...variables, signal });
488
- const getSsoSettingsGetInternalUserSettingsGet = (variables, signal) => fetch$1({ url: "/get/internal_user_settings", method: "get", ...variables, signal });
489
- const updateInternalUserSettingsUpdateInternalUserSettingsPatch = (variables, signal) => fetch$1({ url: "/update/internal_user_settings", method: "patch", ...variables, signal });
490
- const createFileFilesPost = (variables, signal) => fetch$1({ url: "/files", method: "post", ...variables, signal });
491
- const listFilesFilesGet = (variables, signal) => fetch$1({
492
- url: "/files",
493
- method: "get",
494
- ...variables,
495
- signal
496
- });
497
- const createFileV1FilesPost = (variables, signal) => fetch$1({ url: "/v1/files", method: "post", ...variables, signal });
498
- const listFilesV1FilesGet = (variables, signal) => fetch$1({
499
- url: "/v1/files",
500
- method: "get",
501
- ...variables,
502
- signal
503
- });
504
- const createFileProviderV1FilesPost = (variables, signal) => fetch$1({ url: "/{provider}/v1/files", method: "post", ...variables, signal });
505
- const listFilesProviderV1FilesGet = (variables, signal) => fetch$1({ url: "/{provider}/v1/files", method: "get", ...variables, signal });
506
- const getFileContentFilesFileIdContentGet = (variables, signal) => fetch$1({ url: "/files/{fileId}/content", method: "get", ...variables, signal });
507
- const getFileContentV1FilesFileIdContentGet = (variables, signal) => fetch$1({ url: "/v1/files/{fileId}/content", method: "get", ...variables, signal });
508
- const getFileContentProviderV1FilesFileIdContentGet = (variables, signal) => fetch$1({ url: "/{provider}/v1/files/{fileId}/content", method: "get", ...variables, signal });
509
- const getFileFilesFileIdGet = (variables, signal) => fetch$1({ url: "/files/{fileId}", method: "get", ...variables, signal });
510
- const deleteFileFilesFileIdDelete = (variables, signal) => fetch$1({ url: "/files/{fileId}", method: "delete", ...variables, signal });
511
- const getFileV1FilesFileIdGet = (variables, signal) => fetch$1({ url: "/v1/files/{fileId}", method: "get", ...variables, signal });
512
- const deleteFileV1FilesFileIdDelete = (variables, signal) => fetch$1({ url: "/v1/files/{fileId}", method: "delete", ...variables, signal });
513
- const getFileProviderV1FilesFileIdGet = (variables, signal) => fetch$1({ url: "/{provider}/v1/files/{fileId}", method: "get", ...variables, signal });
514
- const deleteFileProviderV1FilesFileIdDelete = (variables, signal) => fetch$1({ url: "/{provider}/v1/files/{fileId}", method: "delete", ...variables, signal });
515
- const addTeamCallbacksTeamTeamIdCallbackPost = (variables, signal) => fetch$1({ url: "/team/{teamId}/callback", method: "post", ...variables, signal });
516
- const getTeamCallbacksTeamTeamIdCallbackGet = (variables, signal) => fetch$1({ url: "/team/{teamId}/callback", method: "get", ...variables, signal });
517
- const disableTeamLoggingTeamTeamIdDisableLoggingPost = (variables, signal) => fetch$1({ url: "/team/{teamId}/disable_logging", method: "post", ...variables, signal });
518
- const newBudgetBudgetNewPost = (variables, signal) => fetch$1({
519
- url: "/budget/new",
520
- method: "post",
521
- ...variables,
522
- signal
523
- });
524
- const updateBudgetBudgetUpdatePost = (variables, signal) => fetch$1({
525
- url: "/budget/update",
526
- method: "post",
527
- ...variables,
528
- signal
529
- });
530
- const infoBudgetBudgetInfoPost = (variables, signal) => fetch$1({
531
- url: "/budget/info",
532
- method: "post",
533
- ...variables,
534
- signal
535
- });
536
- const budgetSettingsBudgetSettingsGet = (variables, signal) => fetch$1({ url: "/budget/settings", method: "get", ...variables, signal });
537
- const listBudgetBudgetListGet = (variables, signal) => fetch$1({
538
- url: "/budget/list",
539
- method: "get",
540
- ...variables,
541
- signal
542
- });
543
- const deleteBudgetBudgetDeletePost = (variables, signal) => fetch$1({ url: "/budget/delete", method: "post", ...variables, signal });
544
- const patchModelModelModelIdUpdatePatch = (variables, signal) => fetch$1({ url: "/model/{modelId}/update", method: "patch", ...variables, signal });
545
- const deleteModelModelDeletePost = (variables, signal) => fetch$1({
546
- url: "/model/delete",
547
- method: "post",
548
- ...variables,
549
- signal
550
- });
551
- const addNewModelModelNewPost = (variables, signal) => fetch$1({
552
- url: "/model/new",
553
- method: "post",
554
- ...variables,
555
- signal
556
- });
557
- const updateModelModelUpdatePost = (variables, signal) => fetch$1({
558
- url: "/model/update",
559
- method: "post",
560
- ...variables,
561
- signal
562
- });
82
+ /**
83
+ * @summary Create a Stripe Checkout session for API access
84
+ * @description Returns a Stripe Checkout URL. After payment, you'll receive an API key.
85
+ * @link /billing/checkout
86
+ */ async function createCheckoutBillingCheckoutPost({ config } = {}) {
87
+ const { client: request = client, ...requestConfig } = config ?? {};
88
+ const data = await request({
89
+ method: "POST",
90
+ url: `/billing/checkout`,
91
+ ...requestConfig,
92
+ headers: {
93
+ ...requestConfig.headers
94
+ }
95
+ });
96
+ return data;
97
+ }
98
+ /**
99
+ * @summary Check your free-tier usage
100
+ * @description See how many requests you've used today (free tier, by IP).
101
+ * @link /billing/usage
102
+ */ async function checkUsageBillingUsageGet({ config } = {}) {
103
+ const { client: request = client, ...requestConfig } = config ?? {};
104
+ const data = await request({
105
+ method: "GET",
106
+ url: `/billing/usage`,
107
+ ...requestConfig,
108
+ headers: {
109
+ ...requestConfig.headers
110
+ }
111
+ });
112
+ return data;
113
+ }
114
+ /**
115
+ * @summary List the full LiteLLM model catalog
116
+ * @description Returns model pricing, context window sizes, and capability metadata from LiteLLM's built-in catalog. Supports filtering by provider, mode, model name pattern, and pagination.
117
+ * @link /model_catalog
118
+ */ async function listModelCatalogModelCatalogGet({ queryParams, config } = {}) {
119
+ const { client: request = client, ...requestConfig } = config ?? {};
120
+ const data = await request({
121
+ method: "GET",
122
+ url: `/model_catalog`,
123
+ queryParams,
124
+ ...requestConfig,
125
+ headers: {
126
+ ...requestConfig.headers
127
+ }
128
+ });
129
+ return data;
130
+ }
131
+ /**
132
+ * @summary Get a single model from the catalog
133
+ * @description Returns detailed information for a specific model by its exact ID.
134
+ * @link /model_catalog/{model_id}
135
+ */ async function getModelCatalogEntryModelCatalogModelIdGet({ pathParams, config } = {}) {
136
+ const { client: request = client, ...requestConfig } = config ?? {};
137
+ if (!pathParams.model_id) {
138
+ throw new Error(`Missing required path parameter: model_id`);
139
+ }
140
+ const data = await request({
141
+ method: "GET",
142
+ url: `/model_catalog/${pathParams.model_id}`,
143
+ ...requestConfig,
144
+ headers: {
145
+ ...requestConfig.headers
146
+ }
147
+ });
148
+ return data;
149
+ }
150
+ const operationsByPath = {
151
+ "POST /billing/checkout": createCheckoutBillingCheckoutPost,
152
+ "GET /billing/usage": checkUsageBillingUsageGet,
153
+ "GET /model_catalog": listModelCatalogModelCatalogGet,
154
+ "GET /model_catalog/{model_id}": getModelCatalogEntryModelCatalogModelIdGet
155
+ };
563
156
  const operationsByTag = {
564
- modelManagement: {
565
- modelListModelsGet,
566
- modelListV1ModelsGet,
567
- modelInfoV1V1ModelInfoGet,
568
- modelInfoV1ModelInfoGet,
569
- modelGroupInfoModelGroupInfoGet,
570
- patchModelModelModelIdUpdatePatch,
571
- deleteModelModelDeletePost,
572
- addNewModelModelNewPost,
573
- updateModelModelUpdatePost
574
- },
575
- chatCompletions: {
576
- chatCompletionOpenaiDeploymentsModelChatCompletionsPost,
577
- chatCompletionEnginesModelChatCompletionsPost,
578
- chatCompletionChatCompletionsPost,
579
- chatCompletionV1ChatCompletionsPost
580
- },
581
- completions: {
582
- completionOpenaiDeploymentsModelCompletionsPost,
583
- completionEnginesModelCompletionsPost,
584
- completionCompletionsPost,
585
- completionV1CompletionsPost
586
- },
587
- embeddings: {
588
- embeddingsOpenaiDeploymentsModelEmbeddingsPost,
589
- embeddingsEnginesModelEmbeddingsPost,
590
- embeddingsEmbeddingsPost,
591
- embeddingsV1EmbeddingsPost
592
- },
593
- images: { imageGenerationImagesGenerationsPost, imageGenerationV1ImagesGenerationsPost },
594
- audio: {
595
- audioSpeechAudioSpeechPost,
596
- audioSpeechV1AudioSpeechPost,
597
- audioTranscriptionsAudioTranscriptionsPost,
598
- audioTranscriptionsV1AudioTranscriptionsPost
599
- },
600
- assistants: {
601
- getAssistantsAssistantsGet,
602
- createAssistantAssistantsPost,
603
- getAssistantsV1AssistantsGet,
604
- createAssistantV1AssistantsPost,
605
- deleteAssistantAssistantsAssistantIdDelete,
606
- deleteAssistantV1AssistantsAssistantIdDelete,
607
- createThreadsThreadsPost,
608
- createThreadsV1ThreadsPost,
609
- getThreadThreadsThreadIdGet,
610
- getThreadV1ThreadsThreadIdGet,
611
- addMessagesThreadsThreadIdMessagesPost,
612
- getMessagesThreadsThreadIdMessagesGet,
613
- addMessagesV1ThreadsThreadIdMessagesPost,
614
- getMessagesV1ThreadsThreadIdMessagesGet,
615
- runThreadThreadsThreadIdRunsPost,
616
- runThreadV1ThreadsThreadIdRunsPost
617
- },
618
- moderations: { moderationsModerationsPost, moderationsV1ModerationsPost },
619
- llmUtils: {
620
- tokenCounterUtilsTokenCounterPost,
621
- supportedOpenaiParamsUtilsSupportedOpenaiParamsGet,
622
- transformRequestUtilsTransformRequestPost
623
- },
624
- responses: {
625
- responsesApiResponsesPost,
626
- responsesApiV1ResponsesPost,
627
- getResponseResponsesResponseIdGet,
628
- deleteResponseResponsesResponseIdDelete,
629
- getResponseV1ResponsesResponseIdGet,
630
- deleteResponseV1ResponsesResponseIdDelete,
631
- getResponseInputItemsResponsesResponseIdInputItemsGet,
632
- getResponseInputItemsV1ResponsesResponseIdInputItemsGet
633
- },
634
- batch: {
635
- createBatchBatchesPost,
636
- listBatchesBatchesGet,
637
- createBatchV1BatchesPost,
638
- listBatchesV1BatchesGet,
639
- createBatchProviderV1BatchesPost,
640
- listBatchesProviderV1BatchesGet,
641
- retrieveBatchBatchesBatchIdGet,
642
- retrieveBatchV1BatchesBatchIdGet,
643
- retrieveBatchProviderV1BatchesBatchIdGet,
644
- cancelBatchBatchesBatchIdCancelPost,
645
- cancelBatchV1BatchesBatchIdCancelPost,
646
- cancelBatchProviderV1BatchesBatchIdCancelPost
647
- },
648
- rerank: { rerankRerankPost, rerankV1RerankPost, rerankV2RerankPost },
649
- fineTuning: {
650
- createFineTuningJobFineTuningJobsPost,
651
- listFineTuningJobsFineTuningJobsGet,
652
- createFineTuningJobV1FineTuningJobsPost,
653
- listFineTuningJobsV1FineTuningJobsGet,
654
- retrieveFineTuningJobFineTuningJobsFineTuningJobIdGet,
655
- retrieveFineTuningJobV1FineTuningJobsFineTuningJobIdGet,
656
- cancelFineTuningJobFineTuningJobsFineTuningJobIdCancelPost,
657
- cancelFineTuningJobV1FineTuningJobsFineTuningJobIdCancelPost
658
- },
659
- credentialManagement: {
660
- getCredentialsCredentialsGet,
661
- createCredentialCredentialsPost,
662
- getCredentialCredentialsByModelModelIdGet,
663
- getCredentialCredentialsByNameCredentialNameGet,
664
- deleteCredentialCredentialsCredentialNameDelete,
665
- updateCredentialCredentialsCredentialNamePatch
666
- },
667
- mcp: {
668
- handleSseMcpGet,
669
- handleMessagesMcpSseMessagesPost,
670
- listToolRestApiMcpToolsListGet,
671
- callToolRestApiMcpToolsCallPost
672
- },
673
- health: {
674
- testEndpointTestGet,
675
- healthServicesEndpointHealthServicesGet,
676
- healthEndpointHealthGet,
677
- activeCallbacksActiveCallbacksGet,
678
- activeCallbacksSettingsGet,
679
- healthReadinessHealthReadinessGet,
680
- healthLivelinessHealthLivenessGet,
681
- healthLivelinessHealthLivelinessGet,
682
- testModelConnectionHealthTestConnectionPost
683
- },
684
- keyManagement: {
685
- generateKeyFnKeyGeneratePost,
686
- updateKeyFnKeyUpdatePost,
687
- deleteKeyFnKeyDeletePost,
688
- infoKeyFnKeyInfoGet,
689
- regenerateKeyFnKeyRegeneratePost,
690
- regenerateKeyFnKeyKeyRegeneratePost,
691
- listKeysKeyListGet,
692
- blockKeyKeyBlockPost,
693
- unblockKeyKeyUnblockPost,
694
- keyHealthKeyHealthPost
695
- },
696
- internalUserManagement: {
697
- newUserUserNewPost,
698
- userInfoUserInfoGet,
699
- userUpdateUserUpdatePost,
700
- getUsersUserListGet,
701
- getUsersUserGetUsersGet,
702
- deleteUserUserDeletePost,
703
- getUserDailyActivityUserDailyActivityGet
704
- },
705
- budgetSpendTracking: {
706
- getUserDailyActivityUserDailyActivityGet,
707
- viewSpendTagsSpendTagsGet,
708
- getGlobalSpendReportGlobalSpendReportGet,
709
- globalViewSpendTagsGlobalSpendTagsGet,
710
- calculateSpendSpendCalculatePost,
711
- viewSpendLogsSpendLogsGet,
712
- globalSpendResetGlobalSpendResetPost,
713
- addAllowedIpAddAllowedIpPost,
714
- deleteAllowedIpDeleteAllowedIpPost
715
- },
716
- teamManagement: {
717
- newTeamTeamNewPost,
718
- updateTeamTeamUpdatePost,
719
- teamMemberAddTeamMemberAddPost,
720
- teamMemberDeleteTeamMemberDeletePost,
721
- teamMemberUpdateTeamMemberUpdatePost,
722
- deleteTeamTeamDeletePost,
723
- teamInfoTeamInfoGet,
724
- blockTeamTeamBlockPost,
725
- unblockTeamTeamUnblockPost,
726
- listTeamTeamListGet,
727
- teamModelAddTeamModelAddPost,
728
- teamModelDeleteTeamModelDeletePost,
729
- addTeamCallbacksTeamTeamIdCallbackPost,
730
- getTeamCallbacksTeamTeamIdCallbackGet,
731
- disableTeamLoggingTeamTeamIdDisableLoggingPost
732
- },
733
- organizationManagement: {
734
- newOrganizationOrganizationNewPost,
735
- updateOrganizationOrganizationUpdatePatch,
736
- deleteOrganizationOrganizationDeleteDelete,
737
- listOrganizationOrganizationListGet,
738
- infoOrganizationOrganizationInfoGet,
739
- deprecatedInfoOrganizationOrganizationInfoPost,
740
- organizationMemberAddOrganizationMemberAddPost,
741
- organizationMemberUpdateOrganizationMemberUpdatePatch,
742
- organizationMemberDeleteOrganizationMemberDeleteDelete
743
- },
744
- customerManagement: {
745
- blockUserCustomerBlockPost,
746
- unblockUserCustomerUnblockPost,
747
- newEndUserCustomerNewPost,
748
- endUserInfoCustomerInfoGet,
749
- updateEndUserCustomerUpdatePost,
750
- deleteEndUserCustomerDeletePost,
751
- listEndUserCustomerListGet
752
- },
753
- caching: {
754
- cachePingCachePingGet,
755
- cacheDeleteCacheDeletePost,
756
- cacheRedisInfoCacheRedisInfoGet,
757
- cacheFlushallCacheFlushallPost
758
- },
759
- guardrails: { listGuardrailsGuardrailsListGet },
760
- sSOSettings: { getSsoSettingsGetInternalUserSettingsGet, updateInternalUserSettingsUpdateInternalUserSettingsPatch },
761
- files: {
762
- createFileFilesPost,
763
- listFilesFilesGet,
764
- createFileV1FilesPost,
765
- listFilesV1FilesGet,
766
- createFileProviderV1FilesPost,
767
- listFilesProviderV1FilesGet,
768
- getFileContentFilesFileIdContentGet,
769
- getFileContentV1FilesFileIdContentGet,
770
- getFileContentProviderV1FilesFileIdContentGet,
771
- getFileFilesFileIdGet,
772
- deleteFileFilesFileIdDelete,
773
- getFileV1FilesFileIdGet,
774
- deleteFileV1FilesFileIdDelete,
775
- getFileProviderV1FilesFileIdGet,
776
- deleteFileProviderV1FilesFileIdDelete
777
- },
778
- budgetManagement: {
779
- newBudgetBudgetNewPost,
780
- updateBudgetBudgetUpdatePost,
781
- infoBudgetBudgetInfoPost,
782
- budgetSettingsBudgetSettingsGet,
783
- listBudgetBudgetListGet,
784
- deleteBudgetBudgetDeletePost
785
- }
157
+ "billing": {
158
+ createCheckoutBillingCheckoutPost,
159
+ checkUsageBillingUsageGet
160
+ }
161
+ };
162
+ const tagDictionary = {
163
+ "billing": {
164
+ "POST": [
165
+ "createCheckoutBillingCheckoutPost"
166
+ ],
167
+ "GET": [
168
+ "checkUsageBillingUsageGet"
169
+ ]
170
+ }
786
171
  };
787
172
 
788
173
  class LiteLLMApi {
789
- #baseUrl;
790
- #token;
791
- #fetch;
792
- constructor(options) {
793
- this.#baseUrl = options.baseUrl;
794
- this.#token = options.token;
795
- this.#fetch = options.fetch || fetch;
796
- if (!this.#fetch) throw new Error("Fetch is required");
797
- }
798
- get api() {
799
- const token = this.#token;
800
- const fetchImpl = this.#fetch;
801
- return new Proxy(
802
- {},
803
- {
804
- get: (_target, namespace) => {
805
- if (operationsByTag[namespace] === void 0) {
806
- return void 0;
807
- }
808
- return new Proxy(
809
- {},
810
- {
811
- get: (_target2, operation) => {
812
- if (operationsByTag[namespace][operation] === void 0) {
813
- return void 0;
174
+ #baseUrl;
175
+ #token;
176
+ #fetch;
177
+ constructor(options){
178
+ this.#baseUrl = options.baseUrl;
179
+ this.#token = options.token;
180
+ this.#fetch = options.fetch || fetch;
181
+ if (!this.#fetch) throw new Error("Fetch is required");
182
+ }
183
+ get api() {
184
+ const getConfig = async ()=>({
185
+ baseUrl: this.#baseUrl,
186
+ token: this.#token,
187
+ fetchImpl: this.#fetch
188
+ });
189
+ return new Proxy({}, {
190
+ get: (_target, namespace)=>{
191
+ if (operationsByTag[namespace] === undefined) {
192
+ return undefined;
814
193
  }
815
- const method = operationsByTag[namespace][operation];
816
- return async (params) => {
817
- return await method({ ...params, token, fetchImpl });
818
- };
819
- }
194
+ return new Proxy({}, {
195
+ get: (_target, operation)=>{
196
+ if (operationsByTag[namespace][operation] === undefined) {
197
+ return undefined;
198
+ }
199
+ const method = operationsByTag[namespace][operation];
200
+ return async (params)=>{
201
+ return await method({
202
+ ...params,
203
+ config: await getConfig()
204
+ });
205
+ };
206
+ }
207
+ });
820
208
  }
821
- );
822
- }
823
- }
824
- );
825
- }
826
- async request(endpoint, params) {
827
- const [method = "", url = ""] = endpoint.split(" ");
828
- const extraParams = params || {};
829
- const result = await fetch$1({
830
- ...extraParams,
831
- method,
832
- url,
833
- baseUrl: this.#baseUrl,
834
- token: this.#token,
835
- fetchImpl: this.#fetch
836
- });
837
- return result;
838
- }
209
+ });
210
+ }
211
+ async request(endpoint, params) {
212
+ const [method = "", url = ""] = endpoint.split(" ");
213
+ const extraParams = params || {};
214
+ const result = await client({
215
+ ...extraParams,
216
+ method,
217
+ url,
218
+ baseUrl: this.#baseUrl,
219
+ token: this.#token,
220
+ fetchImpl: this.#fetch
221
+ });
222
+ return result;
223
+ }
839
224
  }
840
225
 
226
+ // @ts-nocheck
227
+ const checkoutResponseSchema = z__namespace.object({
228
+ "url": z__namespace.string().describe("Stripe Checkout URL — redirect the user here")
229
+ });
230
+ const freeTierResponseSchema = z__namespace.object({
231
+ "ip_hash": z__namespace.string(),
232
+ "requests_today": z__namespace.int(),
233
+ "daily_limit": z__namespace.int(),
234
+ "remaining": z__namespace.int()
235
+ });
236
+ const validationErrorSchema = z__namespace.object({
237
+ "loc": z__namespace.array(z__namespace.union([
238
+ z__namespace.string(),
239
+ z__namespace.int()
240
+ ])),
241
+ "msg": z__namespace.string(),
242
+ "type": z__namespace.string(),
243
+ "input": z__namespace.unknown().optional(),
244
+ "ctx": z__namespace.object({}).optional()
245
+ });
246
+ const HTTPValidationErrorSchema = z__namespace.object({
247
+ "detail": z__namespace.array(validationErrorSchema).optional()
248
+ });
249
+ const modelCatalogEntrySchema = z__namespace.object({
250
+ "id": z__namespace.string().describe("Canonical model identifier (e.g. 'gpt-4o')"),
251
+ "object": z__namespace.string().optional().default("model_catalog.entry"),
252
+ "provider": z__namespace.union([
253
+ z__namespace.string(),
254
+ z__namespace.null()
255
+ ]).optional().describe("LiteLLM provider key (e.g. 'openai', 'azure')"),
256
+ "mode": z__namespace.union([
257
+ z__namespace.string(),
258
+ z__namespace.null()
259
+ ]).optional().describe("Model mode: chat, embedding, completion, image_generation, etc."),
260
+ "max_input_tokens": z__namespace.union([
261
+ z__namespace.int(),
262
+ z__namespace.null()
263
+ ]).optional(),
264
+ "max_output_tokens": z__namespace.union([
265
+ z__namespace.int(),
266
+ z__namespace.null()
267
+ ]).optional(),
268
+ "max_tokens": z__namespace.union([
269
+ z__namespace.int(),
270
+ z__namespace.null()
271
+ ]).optional().describe("Legacy combined token limit"),
272
+ "input_cost_per_token": z__namespace.union([
273
+ z__namespace.number(),
274
+ z__namespace.null()
275
+ ]).optional(),
276
+ "output_cost_per_token": z__namespace.union([
277
+ z__namespace.number(),
278
+ z__namespace.null()
279
+ ]).optional(),
280
+ "cache_read_input_token_cost": z__namespace.union([
281
+ z__namespace.number(),
282
+ z__namespace.null()
283
+ ]).optional(),
284
+ "input_cost_per_audio_token": z__namespace.union([
285
+ z__namespace.number(),
286
+ z__namespace.null()
287
+ ]).optional(),
288
+ "output_cost_per_reasoning_token": z__namespace.union([
289
+ z__namespace.number(),
290
+ z__namespace.null()
291
+ ]).optional(),
292
+ "deprecation_date": z__namespace.union([
293
+ z__namespace.string(),
294
+ z__namespace.null()
295
+ ]).optional().describe("ISO date when the model is deprecated (YYYY-MM-DD)"),
296
+ "supports_function_calling": z__namespace.union([
297
+ z__namespace.boolean(),
298
+ z__namespace.null()
299
+ ]).optional(),
300
+ "supports_parallel_function_calling": z__namespace.union([
301
+ z__namespace.boolean(),
302
+ z__namespace.null()
303
+ ]).optional(),
304
+ "supports_vision": z__namespace.union([
305
+ z__namespace.boolean(),
306
+ z__namespace.null()
307
+ ]).optional(),
308
+ "supports_audio_input": z__namespace.union([
309
+ z__namespace.boolean(),
310
+ z__namespace.null()
311
+ ]).optional(),
312
+ "supports_audio_output": z__namespace.union([
313
+ z__namespace.boolean(),
314
+ z__namespace.null()
315
+ ]).optional(),
316
+ "supports_prompt_caching": z__namespace.union([
317
+ z__namespace.boolean(),
318
+ z__namespace.null()
319
+ ]).optional(),
320
+ "supports_reasoning": z__namespace.union([
321
+ z__namespace.boolean(),
322
+ z__namespace.null()
323
+ ]).optional(),
324
+ "supports_response_schema": z__namespace.union([
325
+ z__namespace.boolean(),
326
+ z__namespace.null()
327
+ ]).optional(),
328
+ "supports_system_messages": z__namespace.union([
329
+ z__namespace.boolean(),
330
+ z__namespace.null()
331
+ ]).optional(),
332
+ "supports_web_search": z__namespace.union([
333
+ z__namespace.boolean(),
334
+ z__namespace.null()
335
+ ]).optional()
336
+ }).catchall(z__namespace.unknown()).describe("A single model in the catalog.");
337
+ const modelCatalogListResponseSchema = z__namespace.object({
338
+ "object": z__namespace.string().optional().default("list"),
339
+ "data": z__namespace.array(modelCatalogEntrySchema),
340
+ "total_count": z__namespace.int().describe("Total models matching the filters"),
341
+ "has_more": z__namespace.boolean(),
342
+ "page": z__namespace.int(),
343
+ "page_size": z__namespace.int()
344
+ }).describe("Stripe-style list response.");
345
+ const createCheckoutBillingCheckoutPostStatus200Schema = checkoutResponseSchema;
346
+ const createCheckoutBillingCheckoutPostResponseSchema = createCheckoutBillingCheckoutPostStatus200Schema;
347
+ const checkUsageBillingUsageGetStatus200Schema = freeTierResponseSchema;
348
+ const checkUsageBillingUsageGetResponseSchema = checkUsageBillingUsageGetStatus200Schema;
349
+ const listModelCatalogModelCatalogGetQueryProviderSchema = z__namespace.union([
350
+ z__namespace.string(),
351
+ z__namespace.null()
352
+ ]).optional().describe("Filter by provider (e.g. 'openai', 'anthropic', 'bedrock'). Case-insensitive.");
353
+ const listModelCatalogModelCatalogGetQueryModeSchema = z__namespace.union([
354
+ z__namespace.string(),
355
+ z__namespace.null()
356
+ ]).optional().describe("Filter by mode (e.g. 'chat', 'embedding', 'image_generation').");
357
+ const listModelCatalogModelCatalogGetQueryModelSchema = z__namespace.union([
358
+ z__namespace.string(),
359
+ z__namespace.null()
360
+ ]).optional().describe("Filter by model name. Supports substring match or regex (prefix with 're:').");
361
+ const listModelCatalogModelCatalogGetQuerySupportsVisionSchema = z__namespace.union([
362
+ z__namespace.boolean(),
363
+ z__namespace.null()
364
+ ]).optional();
365
+ const listModelCatalogModelCatalogGetQuerySupportsFunctionCallingSchema = z__namespace.union([
366
+ z__namespace.boolean(),
367
+ z__namespace.null()
368
+ ]).optional();
369
+ const listModelCatalogModelCatalogGetQuerySupportsReasoningSchema = z__namespace.union([
370
+ z__namespace.boolean(),
371
+ z__namespace.null()
372
+ ]).optional();
373
+ const listModelCatalogModelCatalogGetQuerySupportsAudioInputSchema = z__namespace.union([
374
+ z__namespace.boolean(),
375
+ z__namespace.null()
376
+ ]).optional();
377
+ const listModelCatalogModelCatalogGetQuerySupportsAudioOutputSchema = z__namespace.union([
378
+ z__namespace.boolean(),
379
+ z__namespace.null()
380
+ ]).optional();
381
+ const listModelCatalogModelCatalogGetQuerySupportsPromptCachingSchema = z__namespace.union([
382
+ z__namespace.boolean(),
383
+ z__namespace.null()
384
+ ]).optional();
385
+ const listModelCatalogModelCatalogGetQuerySupportsResponseSchemaSchema = z__namespace.union([
386
+ z__namespace.boolean(),
387
+ z__namespace.null()
388
+ ]).optional();
389
+ const listModelCatalogModelCatalogGetQueryPageSchema = z__namespace.int().min(1).optional().default(1).describe("Page number (1-indexed)");
390
+ const listModelCatalogModelCatalogGetQueryPageSizeSchema = z__namespace.int().min(1).max(500).optional().default(50).describe("Number of results per page (max 500)");
391
+ const listModelCatalogModelCatalogGetStatus200Schema = modelCatalogListResponseSchema.describe("Stripe-style list response.");
392
+ const listModelCatalogModelCatalogGetStatus422Schema = HTTPValidationErrorSchema;
393
+ const listModelCatalogModelCatalogGetResponseSchema = z__namespace.union([
394
+ listModelCatalogModelCatalogGetStatus200Schema,
395
+ listModelCatalogModelCatalogGetStatus422Schema
396
+ ]);
397
+ const getModelCatalogEntryModelCatalogModelIdGetPathModelIdSchema = z__namespace.string();
398
+ const getModelCatalogEntryModelCatalogModelIdGetStatus200Schema = modelCatalogEntrySchema.describe("A single model in the catalog.");
399
+ const getModelCatalogEntryModelCatalogModelIdGetStatus422Schema = HTTPValidationErrorSchema;
400
+ const getModelCatalogEntryModelCatalogModelIdGetResponseSchema = z__namespace.union([
401
+ getModelCatalogEntryModelCatalogModelIdGetStatus200Schema,
402
+ getModelCatalogEntryModelCatalogModelIdGetStatus422Schema
403
+ ]);
404
+
405
+ exports.HTTPValidationErrorSchema = HTTPValidationErrorSchema;
841
406
  exports.LiteLLMApi = LiteLLMApi;
407
+ exports.checkUsageBillingUsageGetResponseSchema = checkUsageBillingUsageGetResponseSchema;
408
+ exports.checkUsageBillingUsageGetStatus200Schema = checkUsageBillingUsageGetStatus200Schema;
409
+ exports.checkoutResponseSchema = checkoutResponseSchema;
410
+ exports.createCheckoutBillingCheckoutPostResponseSchema = createCheckoutBillingCheckoutPostResponseSchema;
411
+ exports.createCheckoutBillingCheckoutPostStatus200Schema = createCheckoutBillingCheckoutPostStatus200Schema;
412
+ exports.freeTierResponseSchema = freeTierResponseSchema;
413
+ exports.getModelCatalogEntryModelCatalogModelIdGetPathModelIdSchema = getModelCatalogEntryModelCatalogModelIdGetPathModelIdSchema;
414
+ exports.getModelCatalogEntryModelCatalogModelIdGetResponseSchema = getModelCatalogEntryModelCatalogModelIdGetResponseSchema;
415
+ exports.getModelCatalogEntryModelCatalogModelIdGetStatus200Schema = getModelCatalogEntryModelCatalogModelIdGetStatus200Schema;
416
+ exports.getModelCatalogEntryModelCatalogModelIdGetStatus422Schema = getModelCatalogEntryModelCatalogModelIdGetStatus422Schema;
417
+ exports.listModelCatalogModelCatalogGetQueryModeSchema = listModelCatalogModelCatalogGetQueryModeSchema;
418
+ exports.listModelCatalogModelCatalogGetQueryModelSchema = listModelCatalogModelCatalogGetQueryModelSchema;
419
+ exports.listModelCatalogModelCatalogGetQueryPageSchema = listModelCatalogModelCatalogGetQueryPageSchema;
420
+ exports.listModelCatalogModelCatalogGetQueryPageSizeSchema = listModelCatalogModelCatalogGetQueryPageSizeSchema;
421
+ exports.listModelCatalogModelCatalogGetQueryProviderSchema = listModelCatalogModelCatalogGetQueryProviderSchema;
422
+ exports.listModelCatalogModelCatalogGetQuerySupportsAudioInputSchema = listModelCatalogModelCatalogGetQuerySupportsAudioInputSchema;
423
+ exports.listModelCatalogModelCatalogGetQuerySupportsAudioOutputSchema = listModelCatalogModelCatalogGetQuerySupportsAudioOutputSchema;
424
+ exports.listModelCatalogModelCatalogGetQuerySupportsFunctionCallingSchema = listModelCatalogModelCatalogGetQuerySupportsFunctionCallingSchema;
425
+ exports.listModelCatalogModelCatalogGetQuerySupportsPromptCachingSchema = listModelCatalogModelCatalogGetQuerySupportsPromptCachingSchema;
426
+ exports.listModelCatalogModelCatalogGetQuerySupportsReasoningSchema = listModelCatalogModelCatalogGetQuerySupportsReasoningSchema;
427
+ exports.listModelCatalogModelCatalogGetQuerySupportsResponseSchemaSchema = listModelCatalogModelCatalogGetQuerySupportsResponseSchemaSchema;
428
+ exports.listModelCatalogModelCatalogGetQuerySupportsVisionSchema = listModelCatalogModelCatalogGetQuerySupportsVisionSchema;
429
+ exports.listModelCatalogModelCatalogGetResponseSchema = listModelCatalogModelCatalogGetResponseSchema;
430
+ exports.listModelCatalogModelCatalogGetStatus200Schema = listModelCatalogModelCatalogGetStatus200Schema;
431
+ exports.listModelCatalogModelCatalogGetStatus422Schema = listModelCatalogModelCatalogGetStatus422Schema;
432
+ exports.modelCatalogEntrySchema = modelCatalogEntrySchema;
433
+ exports.modelCatalogListResponseSchema = modelCatalogListResponseSchema;
434
+ exports.operationsByPath = operationsByPath;
435
+ exports.operationsByTag = operationsByTag;
436
+ exports.tagDictionary = tagDictionary;
437
+ exports.validationErrorSchema = validationErrorSchema;