@breign/client 1.0.131 → 1.0.132

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 (32) hide show
  1. package/dist/apis/AiGatewayApi.d.ts +108 -1
  2. package/dist/apis/AiGatewayApi.js +218 -1
  3. package/dist/models/AiGatewayV1CreditsUio.d.ts +38 -0
  4. package/dist/models/AiGatewayV1CreditsUio.js +52 -0
  5. package/dist/models/AiGatewayV1EndpointPricingUio.d.ts +50 -0
  6. package/dist/models/AiGatewayV1EndpointPricingUio.js +54 -0
  7. package/dist/models/AiGatewayV1EndpointUio.d.ts +111 -0
  8. package/dist/models/AiGatewayV1EndpointUio.js +85 -0
  9. package/dist/models/AiGatewayV1GenerationDataUio.d.ts +146 -0
  10. package/dist/models/AiGatewayV1GenerationDataUio.js +96 -0
  11. package/dist/models/AiGatewayV1GenerationUio.d.ts +33 -0
  12. package/dist/models/AiGatewayV1GenerationUio.js +51 -0
  13. package/dist/models/AiGatewayV1ModelEndpointsDataArchitectureUio.d.ts +56 -0
  14. package/dist/models/AiGatewayV1ModelEndpointsDataArchitectureUio.js +56 -0
  15. package/dist/models/AiGatewayV1ModelEndpointsDataUio.d.ts +70 -0
  16. package/dist/models/AiGatewayV1ModelEndpointsDataUio.js +72 -0
  17. package/dist/models/AiGatewayV1ModelEndpointsUio.d.ts +33 -0
  18. package/dist/models/AiGatewayV1ModelEndpointsUio.js +51 -0
  19. package/dist/models/AiGatewayV1ModelListUio.d.ts +46 -0
  20. package/dist/models/AiGatewayV1ModelListUio.js +62 -0
  21. package/dist/models/AiGatewayV1ModelPricingUio.d.ts +50 -0
  22. package/dist/models/AiGatewayV1ModelPricingUio.js +54 -0
  23. package/dist/models/AiGatewayV1ModelUio.d.ts +114 -0
  24. package/dist/models/AiGatewayV1ModelUio.js +99 -0
  25. package/dist/models/AiGatewayV1ReportRowUio.d.ts +140 -0
  26. package/dist/models/AiGatewayV1ReportRowUio.js +104 -0
  27. package/dist/models/AiGatewayV1ReportUio.d.ts +33 -0
  28. package/dist/models/AiGatewayV1ReportUio.js +51 -0
  29. package/dist/models/index.d.ts +13 -0
  30. package/dist/models/index.js +13 -0
  31. package/dist/openapi.json +1176 -364
  32. package/package.json +1 -1
@@ -10,7 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
- import type { AiGatewayChatCompletionRequestUio, AiGatewayChatCompletionResponseUio, AiGatewayEmbeddingRequestUio, AiGatewayEmbeddingResponseUio, AiGatewayModelListUio, AiGatewayModelUio, AiGatewayUsageUio, OpenAiChatCompletionRequestUio, OpenAiChatCompletionResponseUio } from '../models/index';
13
+ import type { AiGatewayChatCompletionRequestUio, AiGatewayChatCompletionResponseUio, AiGatewayEmbeddingRequestUio, AiGatewayEmbeddingResponseUio, AiGatewayModelListUio, AiGatewayModelUio, AiGatewayUsageUio, AiGatewayV1CreditsUio, AiGatewayV1GenerationUio, AiGatewayV1ModelEndpointsUio, AiGatewayV1ModelListUio, AiGatewayV1ReportUio, OpenAiChatCompletionRequestUio, OpenAiChatCompletionResponseUio } from '../models/index';
14
14
  export interface CreateAiGatewayChatCompletionRequest {
15
15
  organizationId: string;
16
16
  aiGatewayChatCompletionRequestUio: AiGatewayChatCompletionRequestUio;
@@ -36,9 +36,36 @@ export interface GetAiGatewayModelRequest {
36
36
  organizationId: string;
37
37
  model: string;
38
38
  }
39
+ export interface GetAiGatewayV1CreditsRequest {
40
+ organizationId: string;
41
+ }
42
+ export interface GetAiGatewayV1GenerationRequest {
43
+ organizationId: string;
44
+ id: string;
45
+ }
46
+ export interface GetAiGatewayV1ModelEndpointsRequest {
47
+ organizationId: string;
48
+ creator: string;
49
+ model: string;
50
+ }
51
+ export interface GetAiGatewayV1ReportRequest {
52
+ organizationId: string;
53
+ startDate: string;
54
+ endDate: string;
55
+ groupBy?: GetAiGatewayV1ReportGroupByEnum;
56
+ datePart?: GetAiGatewayV1ReportDatePartEnum;
57
+ userId?: string;
58
+ model?: string;
59
+ provider?: string;
60
+ tags?: string;
61
+ tagsMatch?: GetAiGatewayV1ReportTagsMatchEnum;
62
+ }
39
63
  export interface ListAiGatewayModelsRequest {
40
64
  organizationId: string;
41
65
  }
66
+ export interface ListAiGatewayV1ModelsRequest {
67
+ organizationId: string;
68
+ }
42
69
  /**
43
70
  *
44
71
  */
@@ -103,6 +130,46 @@ export declare class AiGatewayApi extends runtime.BaseAPI {
103
130
  * Get a model available through the AI gateway
104
131
  */
105
132
  getAiGatewayModel(organizationId: string, model: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayModelUio>;
133
+ /**
134
+ * Équivalent de `GET /v1/credits`. `total_used` est la dépense cumulée de l\'organisation, calculée depuis la configuration de prix. `balance` est toujours null : Breign n\'a pas de notion de crédits prépayés.
135
+ * Check credit balance (AI Gateway REST API)
136
+ */
137
+ getAiGatewayV1CreditsRaw(requestParameters: GetAiGatewayV1CreditsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayV1CreditsUio>>;
138
+ /**
139
+ * Équivalent de `GET /v1/credits`. `total_used` est la dépense cumulée de l\'organisation, calculée depuis la configuration de prix. `balance` est toujours null : Breign n\'a pas de notion de crédits prépayés.
140
+ * Check credit balance (AI Gateway REST API)
141
+ */
142
+ getAiGatewayV1Credits(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayV1CreditsUio>;
143
+ /**
144
+ * Équivalent de `GET /v1/generation`. L\'identifiant est renvoyé comme `id` des complétions compatibles OpenAI, injecté dans le premier chunk en streaming, et exposé dans `providerMetadata.gateway.generationId` sur les routes AI SDK.
145
+ * Look up a generation (AI Gateway REST API)
146
+ */
147
+ getAiGatewayV1GenerationRaw(requestParameters: GetAiGatewayV1GenerationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayV1GenerationUio>>;
148
+ /**
149
+ * Équivalent de `GET /v1/generation`. L\'identifiant est renvoyé comme `id` des complétions compatibles OpenAI, injecté dans le premier chunk en streaming, et exposé dans `providerMetadata.gateway.generationId` sur les routes AI SDK.
150
+ * Look up a generation (AI Gateway REST API)
151
+ */
152
+ getAiGatewayV1Generation(organizationId: string, id: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayV1GenerationUio>;
153
+ /**
154
+ * Équivalent de `GET /v1/models/{creator}/{model}/endpoints`. Un modèle n\'étant servi que par le provider qui le déclare dans l\'organisation, la liste contient toujours un seul endpoint. Les identifiants Breign n\'ayant pas toujours de créateur, `{creator}/{model}` est résolu d\'abord tel quel, puis sur le seul segment `{model}`.
155
+ * Get model endpoints (AI Gateway REST API)
156
+ */
157
+ getAiGatewayV1ModelEndpointsRaw(requestParameters: GetAiGatewayV1ModelEndpointsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayV1ModelEndpointsUio>>;
158
+ /**
159
+ * Équivalent de `GET /v1/models/{creator}/{model}/endpoints`. Un modèle n\'étant servi que par le provider qui le déclare dans l\'organisation, la liste contient toujours un seul endpoint. Les identifiants Breign n\'ayant pas toujours de créateur, `{creator}/{model}` est résolu d\'abord tel quel, puis sur le seul segment `{model}`.
160
+ * Get model endpoints (AI Gateway REST API)
161
+ */
162
+ getAiGatewayV1ModelEndpoints(organizationId: string, creator: string, model: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayV1ModelEndpointsUio>;
163
+ /**
164
+ * Équivalent de `GET /v1/report`. L\'attribution applicative provient des en-têtes `ai-reporting-user` et `ai-reporting-tags` posés sur les appels d\'inférence. Réservé aux administrateurs de l\'organisation.
165
+ * Query spend report (AI Gateway REST API)
166
+ */
167
+ getAiGatewayV1ReportRaw(requestParameters: GetAiGatewayV1ReportRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayV1ReportUio>>;
168
+ /**
169
+ * Équivalent de `GET /v1/report`. L\'attribution applicative provient des en-têtes `ai-reporting-user` et `ai-reporting-tags` posés sur les appels d\'inférence. Réservé aux administrateurs de l\'organisation.
170
+ * Query spend report (AI Gateway REST API)
171
+ */
172
+ getAiGatewayV1Report(organizationId: string, startDate: string, endDate: string, groupBy?: GetAiGatewayV1ReportGroupByEnum, datePart?: GetAiGatewayV1ReportDatePartEnum, userId?: string, model?: string, provider?: string, tags?: string, tagsMatch?: GetAiGatewayV1ReportTagsMatchEnum, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayV1ReportUio>;
106
173
  /**
107
174
  * Lists every model exposed by the organization\'s engine providers, in an OpenAI-compatible envelope. Accessible à tout membre de l\'organisation. Chaque `id` est l\'identifiant côté provider : c\'est la valeur à renvoyer dans `model` sur les endpoints de complétion et d\'embedding.
108
175
  * List models available through the AI gateway
@@ -113,6 +180,16 @@ export declare class AiGatewayApi extends runtime.BaseAPI {
113
180
  * List models available through the AI gateway
114
181
  */
115
182
  listAiGatewayModels(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayModelListUio>;
183
+ /**
184
+ * Équivalent de `GET /v1/models` de l\'AI Gateway Vercel, monté sous le préfixe organisation. Liste les modèles des providers configurés pour l\'organisation.
185
+ * List models (AI Gateway REST API)
186
+ */
187
+ listAiGatewayV1ModelsRaw(requestParameters: ListAiGatewayV1ModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AiGatewayV1ModelListUio>>;
188
+ /**
189
+ * Équivalent de `GET /v1/models` de l\'AI Gateway Vercel, monté sous le préfixe organisation. Liste les modèles des providers configurés pour l\'organisation.
190
+ * List models (AI Gateway REST API)
191
+ */
192
+ listAiGatewayV1Models(organizationId: string, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AiGatewayV1ModelListUio>;
116
193
  }
117
194
  /**
118
195
  * @export
@@ -123,3 +200,33 @@ export declare const GetAiGatewayMetricsGranularityEnum: {
123
200
  readonly Week: "week";
124
201
  };
125
202
  export type GetAiGatewayMetricsGranularityEnum = typeof GetAiGatewayMetricsGranularityEnum[keyof typeof GetAiGatewayMetricsGranularityEnum];
203
+ /**
204
+ * @export
205
+ */
206
+ export declare const GetAiGatewayV1ReportGroupByEnum: {
207
+ readonly Day: "day";
208
+ readonly User: "user";
209
+ readonly Model: "model";
210
+ readonly Tag: "tag";
211
+ readonly Provider: "provider";
212
+ readonly CredentialType: "credential_type";
213
+ readonly ZeroDataRetention: "zero_data_retention";
214
+ readonly ApiKeyName: "api_key_name";
215
+ };
216
+ export type GetAiGatewayV1ReportGroupByEnum = typeof GetAiGatewayV1ReportGroupByEnum[keyof typeof GetAiGatewayV1ReportGroupByEnum];
217
+ /**
218
+ * @export
219
+ */
220
+ export declare const GetAiGatewayV1ReportDatePartEnum: {
221
+ readonly Day: "day";
222
+ readonly Hour: "hour";
223
+ };
224
+ export type GetAiGatewayV1ReportDatePartEnum = typeof GetAiGatewayV1ReportDatePartEnum[keyof typeof GetAiGatewayV1ReportDatePartEnum];
225
+ /**
226
+ * @export
227
+ */
228
+ export declare const GetAiGatewayV1ReportTagsMatchEnum: {
229
+ readonly Any: "any";
230
+ readonly All: "all";
231
+ };
232
+ export type GetAiGatewayV1ReportTagsMatchEnum = typeof GetAiGatewayV1ReportTagsMatchEnum[keyof typeof GetAiGatewayV1ReportTagsMatchEnum];
@@ -46,7 +46,7 @@ var __importStar = (this && this.__importStar) || (function () {
46
46
  };
47
47
  })();
48
48
  Object.defineProperty(exports, "__esModule", { value: true });
49
- exports.GetAiGatewayMetricsGranularityEnum = exports.AiGatewayApi = void 0;
49
+ exports.GetAiGatewayV1ReportTagsMatchEnum = exports.GetAiGatewayV1ReportDatePartEnum = exports.GetAiGatewayV1ReportGroupByEnum = exports.GetAiGatewayMetricsGranularityEnum = exports.AiGatewayApi = void 0;
50
50
  const runtime = __importStar(require("../runtime"));
51
51
  const index_1 = require("../models/index");
52
52
  /**
@@ -253,6 +253,167 @@ class AiGatewayApi extends runtime.BaseAPI {
253
253
  const response = await this.getAiGatewayModelRaw({ organizationId: organizationId, model: model }, initOverrides);
254
254
  return await response.value();
255
255
  }
256
+ /**
257
+ * Équivalent de `GET /v1/credits`. `total_used` est la dépense cumulée de l\'organisation, calculée depuis la configuration de prix. `balance` est toujours null : Breign n\'a pas de notion de crédits prépayés.
258
+ * Check credit balance (AI Gateway REST API)
259
+ */
260
+ async getAiGatewayV1CreditsRaw(requestParameters, initOverrides) {
261
+ if (requestParameters['organizationId'] == null) {
262
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAiGatewayV1Credits().');
263
+ }
264
+ const queryParameters = {};
265
+ const headerParameters = {};
266
+ if (this.configuration && this.configuration.apiKey) {
267
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
268
+ }
269
+ const response = await this.request({
270
+ path: `/organizations/{organizationId}/ai-gateway/v1/credits`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
271
+ method: 'GET',
272
+ headers: headerParameters,
273
+ query: queryParameters,
274
+ }, initOverrides);
275
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayV1CreditsUioFromJSON)(jsonValue));
276
+ }
277
+ /**
278
+ * Équivalent de `GET /v1/credits`. `total_used` est la dépense cumulée de l\'organisation, calculée depuis la configuration de prix. `balance` est toujours null : Breign n\'a pas de notion de crédits prépayés.
279
+ * Check credit balance (AI Gateway REST API)
280
+ */
281
+ async getAiGatewayV1Credits(organizationId, initOverrides) {
282
+ const response = await this.getAiGatewayV1CreditsRaw({ organizationId: organizationId }, initOverrides);
283
+ return await response.value();
284
+ }
285
+ /**
286
+ * Équivalent de `GET /v1/generation`. L\'identifiant est renvoyé comme `id` des complétions compatibles OpenAI, injecté dans le premier chunk en streaming, et exposé dans `providerMetadata.gateway.generationId` sur les routes AI SDK.
287
+ * Look up a generation (AI Gateway REST API)
288
+ */
289
+ async getAiGatewayV1GenerationRaw(requestParameters, initOverrides) {
290
+ if (requestParameters['organizationId'] == null) {
291
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAiGatewayV1Generation().');
292
+ }
293
+ if (requestParameters['id'] == null) {
294
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getAiGatewayV1Generation().');
295
+ }
296
+ const queryParameters = {};
297
+ if (requestParameters['id'] != null) {
298
+ queryParameters['id'] = requestParameters['id'];
299
+ }
300
+ const headerParameters = {};
301
+ if (this.configuration && this.configuration.apiKey) {
302
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
303
+ }
304
+ const response = await this.request({
305
+ path: `/organizations/{organizationId}/ai-gateway/v1/generation`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
306
+ method: 'GET',
307
+ headers: headerParameters,
308
+ query: queryParameters,
309
+ }, initOverrides);
310
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayV1GenerationUioFromJSON)(jsonValue));
311
+ }
312
+ /**
313
+ * Équivalent de `GET /v1/generation`. L\'identifiant est renvoyé comme `id` des complétions compatibles OpenAI, injecté dans le premier chunk en streaming, et exposé dans `providerMetadata.gateway.generationId` sur les routes AI SDK.
314
+ * Look up a generation (AI Gateway REST API)
315
+ */
316
+ async getAiGatewayV1Generation(organizationId, id, initOverrides) {
317
+ const response = await this.getAiGatewayV1GenerationRaw({ organizationId: organizationId, id: id }, initOverrides);
318
+ return await response.value();
319
+ }
320
+ /**
321
+ * Équivalent de `GET /v1/models/{creator}/{model}/endpoints`. Un modèle n\'étant servi que par le provider qui le déclare dans l\'organisation, la liste contient toujours un seul endpoint. Les identifiants Breign n\'ayant pas toujours de créateur, `{creator}/{model}` est résolu d\'abord tel quel, puis sur le seul segment `{model}`.
322
+ * Get model endpoints (AI Gateway REST API)
323
+ */
324
+ async getAiGatewayV1ModelEndpointsRaw(requestParameters, initOverrides) {
325
+ if (requestParameters['organizationId'] == null) {
326
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAiGatewayV1ModelEndpoints().');
327
+ }
328
+ if (requestParameters['creator'] == null) {
329
+ throw new runtime.RequiredError('creator', 'Required parameter "creator" was null or undefined when calling getAiGatewayV1ModelEndpoints().');
330
+ }
331
+ if (requestParameters['model'] == null) {
332
+ throw new runtime.RequiredError('model', 'Required parameter "model" was null or undefined when calling getAiGatewayV1ModelEndpoints().');
333
+ }
334
+ const queryParameters = {};
335
+ const headerParameters = {};
336
+ if (this.configuration && this.configuration.apiKey) {
337
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
338
+ }
339
+ const response = await this.request({
340
+ path: `/organizations/{organizationId}/ai-gateway/v1/models/{creator}/{model}/endpoints`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))).replace(`{${"creator"}}`, encodeURIComponent(String(requestParameters['creator']))).replace(`{${"model"}}`, encodeURIComponent(String(requestParameters['model']))),
341
+ method: 'GET',
342
+ headers: headerParameters,
343
+ query: queryParameters,
344
+ }, initOverrides);
345
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayV1ModelEndpointsUioFromJSON)(jsonValue));
346
+ }
347
+ /**
348
+ * Équivalent de `GET /v1/models/{creator}/{model}/endpoints`. Un modèle n\'étant servi que par le provider qui le déclare dans l\'organisation, la liste contient toujours un seul endpoint. Les identifiants Breign n\'ayant pas toujours de créateur, `{creator}/{model}` est résolu d\'abord tel quel, puis sur le seul segment `{model}`.
349
+ * Get model endpoints (AI Gateway REST API)
350
+ */
351
+ async getAiGatewayV1ModelEndpoints(organizationId, creator, model, initOverrides) {
352
+ const response = await this.getAiGatewayV1ModelEndpointsRaw({ organizationId: organizationId, creator: creator, model: model }, initOverrides);
353
+ return await response.value();
354
+ }
355
+ /**
356
+ * Équivalent de `GET /v1/report`. L\'attribution applicative provient des en-têtes `ai-reporting-user` et `ai-reporting-tags` posés sur les appels d\'inférence. Réservé aux administrateurs de l\'organisation.
357
+ * Query spend report (AI Gateway REST API)
358
+ */
359
+ async getAiGatewayV1ReportRaw(requestParameters, initOverrides) {
360
+ if (requestParameters['organizationId'] == null) {
361
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling getAiGatewayV1Report().');
362
+ }
363
+ if (requestParameters['startDate'] == null) {
364
+ throw new runtime.RequiredError('startDate', 'Required parameter "startDate" was null or undefined when calling getAiGatewayV1Report().');
365
+ }
366
+ if (requestParameters['endDate'] == null) {
367
+ throw new runtime.RequiredError('endDate', 'Required parameter "endDate" was null or undefined when calling getAiGatewayV1Report().');
368
+ }
369
+ const queryParameters = {};
370
+ if (requestParameters['startDate'] != null) {
371
+ queryParameters['start_date'] = requestParameters['startDate'];
372
+ }
373
+ if (requestParameters['endDate'] != null) {
374
+ queryParameters['end_date'] = requestParameters['endDate'];
375
+ }
376
+ if (requestParameters['groupBy'] != null) {
377
+ queryParameters['group_by'] = requestParameters['groupBy'];
378
+ }
379
+ if (requestParameters['datePart'] != null) {
380
+ queryParameters['date_part'] = requestParameters['datePart'];
381
+ }
382
+ if (requestParameters['userId'] != null) {
383
+ queryParameters['user_id'] = requestParameters['userId'];
384
+ }
385
+ if (requestParameters['model'] != null) {
386
+ queryParameters['model'] = requestParameters['model'];
387
+ }
388
+ if (requestParameters['provider'] != null) {
389
+ queryParameters['provider'] = requestParameters['provider'];
390
+ }
391
+ if (requestParameters['tags'] != null) {
392
+ queryParameters['tags'] = requestParameters['tags'];
393
+ }
394
+ if (requestParameters['tagsMatch'] != null) {
395
+ queryParameters['tags_match'] = requestParameters['tagsMatch'];
396
+ }
397
+ const headerParameters = {};
398
+ if (this.configuration && this.configuration.apiKey) {
399
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
400
+ }
401
+ const response = await this.request({
402
+ path: `/organizations/{organizationId}/ai-gateway/v1/report`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
403
+ method: 'GET',
404
+ headers: headerParameters,
405
+ query: queryParameters,
406
+ }, initOverrides);
407
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayV1ReportUioFromJSON)(jsonValue));
408
+ }
409
+ /**
410
+ * Équivalent de `GET /v1/report`. L\'attribution applicative provient des en-têtes `ai-reporting-user` et `ai-reporting-tags` posés sur les appels d\'inférence. Réservé aux administrateurs de l\'organisation.
411
+ * Query spend report (AI Gateway REST API)
412
+ */
413
+ async getAiGatewayV1Report(organizationId, startDate, endDate, groupBy, datePart, userId, model, provider, tags, tagsMatch, initOverrides) {
414
+ const response = await this.getAiGatewayV1ReportRaw({ organizationId: organizationId, startDate: startDate, endDate: endDate, groupBy: groupBy, datePart: datePart, userId: userId, model: model, provider: provider, tags: tags, tagsMatch: tagsMatch }, initOverrides);
415
+ return await response.value();
416
+ }
256
417
  /**
257
418
  * Lists every model exposed by the organization\'s engine providers, in an OpenAI-compatible envelope. Accessible à tout membre de l\'organisation. Chaque `id` est l\'identifiant côté provider : c\'est la valeur à renvoyer dans `model` sur les endpoints de complétion et d\'embedding.
258
419
  * List models available through the AI gateway
@@ -282,6 +443,35 @@ class AiGatewayApi extends runtime.BaseAPI {
282
443
  const response = await this.listAiGatewayModelsRaw({ organizationId: organizationId }, initOverrides);
283
444
  return await response.value();
284
445
  }
446
+ /**
447
+ * Équivalent de `GET /v1/models` de l\'AI Gateway Vercel, monté sous le préfixe organisation. Liste les modèles des providers configurés pour l\'organisation.
448
+ * List models (AI Gateway REST API)
449
+ */
450
+ async listAiGatewayV1ModelsRaw(requestParameters, initOverrides) {
451
+ if (requestParameters['organizationId'] == null) {
452
+ throw new runtime.RequiredError('organizationId', 'Required parameter "organizationId" was null or undefined when calling listAiGatewayV1Models().');
453
+ }
454
+ const queryParameters = {};
455
+ const headerParameters = {};
456
+ if (this.configuration && this.configuration.apiKey) {
457
+ headerParameters["X-API-Key"] = await this.configuration.apiKey("X-API-Key"); // ApiKeyAuth authentication
458
+ }
459
+ const response = await this.request({
460
+ path: `/organizations/{organizationId}/ai-gateway/v1/models`.replace(`{${"organizationId"}}`, encodeURIComponent(String(requestParameters['organizationId']))),
461
+ method: 'GET',
462
+ headers: headerParameters,
463
+ query: queryParameters,
464
+ }, initOverrides);
465
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.AiGatewayV1ModelListUioFromJSON)(jsonValue));
466
+ }
467
+ /**
468
+ * Équivalent de `GET /v1/models` de l\'AI Gateway Vercel, monté sous le préfixe organisation. Liste les modèles des providers configurés pour l\'organisation.
469
+ * List models (AI Gateway REST API)
470
+ */
471
+ async listAiGatewayV1Models(organizationId, initOverrides) {
472
+ const response = await this.listAiGatewayV1ModelsRaw({ organizationId: organizationId }, initOverrides);
473
+ return await response.value();
474
+ }
285
475
  }
286
476
  exports.AiGatewayApi = AiGatewayApi;
287
477
  /**
@@ -292,3 +482,30 @@ exports.GetAiGatewayMetricsGranularityEnum = {
292
482
  Day: 'day',
293
483
  Week: 'week'
294
484
  };
485
+ /**
486
+ * @export
487
+ */
488
+ exports.GetAiGatewayV1ReportGroupByEnum = {
489
+ Day: 'day',
490
+ User: 'user',
491
+ Model: 'model',
492
+ Tag: 'tag',
493
+ Provider: 'provider',
494
+ CredentialType: 'credential_type',
495
+ ZeroDataRetention: 'zero_data_retention',
496
+ ApiKeyName: 'api_key_name'
497
+ };
498
+ /**
499
+ * @export
500
+ */
501
+ exports.GetAiGatewayV1ReportDatePartEnum = {
502
+ Day: 'day',
503
+ Hour: 'hour'
504
+ };
505
+ /**
506
+ * @export
507
+ */
508
+ exports.GetAiGatewayV1ReportTagsMatchEnum = {
509
+ Any: 'any',
510
+ All: 'all'
511
+ };
@@ -0,0 +1,38 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AiGatewayV1CreditsUio
16
+ */
17
+ export interface AiGatewayV1CreditsUio {
18
+ /**
19
+ * Toujours null — Breign n'a pas de notion de crédits prépayés
20
+ * @type {string}
21
+ * @memberof AiGatewayV1CreditsUio
22
+ */
23
+ balance?: string | null;
24
+ /**
25
+ * Dépense cumulée de l'organisation, calculée depuis la configuration de prix
26
+ * @type {string}
27
+ * @memberof AiGatewayV1CreditsUio
28
+ */
29
+ totalUsed: string;
30
+ }
31
+ /**
32
+ * Check if a given object implements the AiGatewayV1CreditsUio interface.
33
+ */
34
+ export declare function instanceOfAiGatewayV1CreditsUio(value: object): value is AiGatewayV1CreditsUio;
35
+ export declare function AiGatewayV1CreditsUioFromJSON(json: any): AiGatewayV1CreditsUio;
36
+ export declare function AiGatewayV1CreditsUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AiGatewayV1CreditsUio;
37
+ export declare function AiGatewayV1CreditsUioToJSON(json: any): AiGatewayV1CreditsUio;
38
+ export declare function AiGatewayV1CreditsUioToJSONTyped(value?: AiGatewayV1CreditsUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAiGatewayV1CreditsUio = instanceOfAiGatewayV1CreditsUio;
17
+ exports.AiGatewayV1CreditsUioFromJSON = AiGatewayV1CreditsUioFromJSON;
18
+ exports.AiGatewayV1CreditsUioFromJSONTyped = AiGatewayV1CreditsUioFromJSONTyped;
19
+ exports.AiGatewayV1CreditsUioToJSON = AiGatewayV1CreditsUioToJSON;
20
+ exports.AiGatewayV1CreditsUioToJSONTyped = AiGatewayV1CreditsUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AiGatewayV1CreditsUio interface.
23
+ */
24
+ function instanceOfAiGatewayV1CreditsUio(value) {
25
+ if (!('totalUsed' in value) || value['totalUsed'] === undefined)
26
+ return false;
27
+ return true;
28
+ }
29
+ function AiGatewayV1CreditsUioFromJSON(json) {
30
+ return AiGatewayV1CreditsUioFromJSONTyped(json, false);
31
+ }
32
+ function AiGatewayV1CreditsUioFromJSONTyped(json, ignoreDiscriminator) {
33
+ if (json == null) {
34
+ return json;
35
+ }
36
+ return {
37
+ 'balance': json['balance'] == null ? undefined : json['balance'],
38
+ 'totalUsed': json['total_used'],
39
+ };
40
+ }
41
+ function AiGatewayV1CreditsUioToJSON(json) {
42
+ return AiGatewayV1CreditsUioToJSONTyped(json, false);
43
+ }
44
+ function AiGatewayV1CreditsUioToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'balance': value['balance'],
50
+ 'total_used': value['totalUsed'],
51
+ };
52
+ }
@@ -0,0 +1,50 @@
1
+ /**
2
+ * brain-client
3
+ * Api ands models for brain-app and brain-app
4
+ *
5
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
6
+ *
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface AiGatewayV1EndpointPricingUio
16
+ */
17
+ export interface AiGatewayV1EndpointPricingUio {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AiGatewayV1EndpointPricingUio
22
+ */
23
+ prompt?: string | null;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof AiGatewayV1EndpointPricingUio
28
+ */
29
+ completion?: string | null;
30
+ /**
31
+ *
32
+ * @type {string}
33
+ * @memberof AiGatewayV1EndpointPricingUio
34
+ */
35
+ inputCacheRead?: string | null;
36
+ /**
37
+ *
38
+ * @type {string}
39
+ * @memberof AiGatewayV1EndpointPricingUio
40
+ */
41
+ inputCacheWrite?: string | null;
42
+ }
43
+ /**
44
+ * Check if a given object implements the AiGatewayV1EndpointPricingUio interface.
45
+ */
46
+ export declare function instanceOfAiGatewayV1EndpointPricingUio(value: object): value is AiGatewayV1EndpointPricingUio;
47
+ export declare function AiGatewayV1EndpointPricingUioFromJSON(json: any): AiGatewayV1EndpointPricingUio;
48
+ export declare function AiGatewayV1EndpointPricingUioFromJSONTyped(json: any, ignoreDiscriminator: boolean): AiGatewayV1EndpointPricingUio;
49
+ export declare function AiGatewayV1EndpointPricingUioToJSON(json: any): AiGatewayV1EndpointPricingUio;
50
+ export declare function AiGatewayV1EndpointPricingUioToJSONTyped(value?: AiGatewayV1EndpointPricingUio | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,54 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * brain-client
6
+ * Api ands models for brain-app and brain-app
7
+ *
8
+ * The version of the OpenAPI document: 0.0.0-SNAPSHOT
9
+ *
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfAiGatewayV1EndpointPricingUio = instanceOfAiGatewayV1EndpointPricingUio;
17
+ exports.AiGatewayV1EndpointPricingUioFromJSON = AiGatewayV1EndpointPricingUioFromJSON;
18
+ exports.AiGatewayV1EndpointPricingUioFromJSONTyped = AiGatewayV1EndpointPricingUioFromJSONTyped;
19
+ exports.AiGatewayV1EndpointPricingUioToJSON = AiGatewayV1EndpointPricingUioToJSON;
20
+ exports.AiGatewayV1EndpointPricingUioToJSONTyped = AiGatewayV1EndpointPricingUioToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the AiGatewayV1EndpointPricingUio interface.
23
+ */
24
+ function instanceOfAiGatewayV1EndpointPricingUio(value) {
25
+ return true;
26
+ }
27
+ function AiGatewayV1EndpointPricingUioFromJSON(json) {
28
+ return AiGatewayV1EndpointPricingUioFromJSONTyped(json, false);
29
+ }
30
+ function AiGatewayV1EndpointPricingUioFromJSONTyped(json, ignoreDiscriminator) {
31
+ if (json == null) {
32
+ return json;
33
+ }
34
+ return {
35
+ 'prompt': json['prompt'] == null ? undefined : json['prompt'],
36
+ 'completion': json['completion'] == null ? undefined : json['completion'],
37
+ 'inputCacheRead': json['input_cache_read'] == null ? undefined : json['input_cache_read'],
38
+ 'inputCacheWrite': json['input_cache_write'] == null ? undefined : json['input_cache_write'],
39
+ };
40
+ }
41
+ function AiGatewayV1EndpointPricingUioToJSON(json) {
42
+ return AiGatewayV1EndpointPricingUioToJSONTyped(json, false);
43
+ }
44
+ function AiGatewayV1EndpointPricingUioToJSONTyped(value, ignoreDiscriminator = false) {
45
+ if (value == null) {
46
+ return value;
47
+ }
48
+ return {
49
+ 'prompt': value['prompt'],
50
+ 'completion': value['completion'],
51
+ 'input_cache_read': value['inputCacheRead'],
52
+ 'input_cache_write': value['inputCacheWrite'],
53
+ };
54
+ }