berget 2.2.6 → 2.2.8

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 (145) hide show
  1. package/.github/workflows/publish.yml +2 -2
  2. package/.github/workflows/test.yml +10 -4
  3. package/.husky/pre-commit +1 -0
  4. package/.prettierignore +15 -0
  5. package/.prettierrc +7 -3
  6. package/CONTRIBUTING.md +38 -0
  7. package/README.md +2 -148
  8. package/dist/index.js +10 -11
  9. package/dist/package.json +30 -2
  10. package/dist/src/agents/app.js +28 -0
  11. package/dist/src/agents/backend.js +25 -0
  12. package/dist/src/agents/devops.js +34 -0
  13. package/dist/src/agents/frontend.js +25 -0
  14. package/dist/src/agents/fullstack.js +25 -0
  15. package/dist/src/agents/index.js +61 -0
  16. package/dist/src/agents/quality.js +70 -0
  17. package/dist/src/agents/security.js +26 -0
  18. package/dist/src/agents/types.js +2 -0
  19. package/dist/src/client.js +97 -117
  20. package/dist/src/commands/api-keys.js +75 -90
  21. package/dist/src/commands/auth.js +7 -16
  22. package/dist/src/commands/autocomplete.js +1 -1
  23. package/dist/src/commands/billing.js +6 -17
  24. package/dist/src/commands/chat.js +68 -101
  25. package/dist/src/commands/clusters.js +9 -18
  26. package/dist/src/commands/code/__tests__/auth-sync.test.js +351 -0
  27. package/dist/src/commands/code/__tests__/fake-api-key-service.js +13 -0
  28. package/dist/src/commands/code/__tests__/fake-auth-service.js +47 -0
  29. package/dist/src/commands/code/__tests__/fake-command-runner.js +21 -34
  30. package/dist/src/commands/code/__tests__/fake-file-store.js +20 -33
  31. package/dist/src/commands/code/__tests__/fake-prompter.js +83 -57
  32. package/dist/src/commands/code/__tests__/setup-flow.test.js +359 -92
  33. package/dist/src/commands/code/adapters/clack-prompter.js +15 -22
  34. package/dist/src/commands/code/adapters/fs-file-store.js +26 -40
  35. package/dist/src/commands/code/adapters/spawn-command-runner.js +27 -37
  36. package/dist/src/commands/code/auth-sync.js +270 -0
  37. package/dist/src/commands/code/errors.js +12 -9
  38. package/dist/src/commands/code/ports/auth-services.js +2 -0
  39. package/dist/src/commands/code/setup.js +387 -281
  40. package/dist/src/commands/code.js +205 -332
  41. package/dist/src/commands/index.js +5 -5
  42. package/dist/src/commands/models.js +6 -17
  43. package/dist/src/commands/users.js +5 -16
  44. package/dist/src/constants/command-structure.js +104 -104
  45. package/dist/src/services/api-key-service.js +132 -157
  46. package/dist/src/services/auth-service.js +89 -342
  47. package/dist/src/services/browser-auth.js +268 -0
  48. package/dist/src/services/chat-service.js +371 -401
  49. package/dist/src/services/cluster-service.js +47 -62
  50. package/dist/src/services/collaborator-service.js +10 -25
  51. package/dist/src/services/flux-service.js +14 -29
  52. package/dist/src/services/helm-service.js +10 -25
  53. package/dist/src/services/kubectl-service.js +16 -33
  54. package/dist/src/utils/config-checker.js +3 -3
  55. package/dist/src/utils/config-loader.js +95 -95
  56. package/dist/src/utils/default-api-key.js +124 -134
  57. package/dist/src/utils/env-manager.js +55 -66
  58. package/dist/src/utils/error-handler.js +20 -21
  59. package/dist/src/utils/logger.js +72 -65
  60. package/dist/src/utils/markdown-renderer.js +27 -27
  61. package/dist/src/utils/opencode-validator.js +63 -68
  62. package/dist/src/utils/token-manager.js +74 -45
  63. package/dist/tests/commands/chat.test.js +16 -25
  64. package/dist/tests/commands/code.test.js +95 -104
  65. package/dist/tests/utils/config-loader.test.js +48 -48
  66. package/dist/tests/utils/env-manager.test.js +43 -52
  67. package/dist/tests/utils/opencode-validator.test.js +22 -21
  68. package/dist/vitest.config.js +1 -1
  69. package/eslint.config.mjs +67 -0
  70. package/index.ts +35 -42
  71. package/package.json +30 -2
  72. package/src/agents/app.ts +27 -0
  73. package/src/agents/backend.ts +24 -0
  74. package/src/agents/devops.ts +33 -0
  75. package/src/agents/frontend.ts +24 -0
  76. package/src/agents/fullstack.ts +24 -0
  77. package/src/agents/index.ts +73 -0
  78. package/src/agents/quality.ts +69 -0
  79. package/src/agents/security.ts +26 -0
  80. package/src/agents/types.ts +17 -0
  81. package/src/client.ts +118 -152
  82. package/src/commands/api-keys.ts +241 -333
  83. package/src/commands/auth.ts +22 -27
  84. package/src/commands/autocomplete.ts +9 -9
  85. package/src/commands/billing.ts +20 -24
  86. package/src/commands/chat.ts +248 -338
  87. package/src/commands/clusters.ts +27 -26
  88. package/src/commands/code/__tests__/auth-sync.test.ts +482 -0
  89. package/src/commands/code/__tests__/fake-api-key-service.ts +13 -0
  90. package/src/commands/code/__tests__/fake-auth-service.ts +50 -0
  91. package/src/commands/code/__tests__/fake-command-runner.ts +45 -42
  92. package/src/commands/code/__tests__/fake-file-store.ts +32 -23
  93. package/src/commands/code/__tests__/fake-prompter.ts +116 -77
  94. package/src/commands/code/__tests__/setup-flow.test.ts +624 -268
  95. package/src/commands/code/adapters/clack-prompter.ts +53 -39
  96. package/src/commands/code/adapters/fs-file-store.ts +32 -27
  97. package/src/commands/code/adapters/spawn-command-runner.ts +38 -29
  98. package/src/commands/code/auth-sync.ts +329 -0
  99. package/src/commands/code/errors.ts +18 -18
  100. package/src/commands/code/ports/auth-services.ts +14 -0
  101. package/src/commands/code/ports/command-runner.ts +8 -4
  102. package/src/commands/code/ports/file-store.ts +5 -4
  103. package/src/commands/code/ports/prompter.ts +24 -18
  104. package/src/commands/code/setup.ts +570 -340
  105. package/src/commands/code.ts +338 -539
  106. package/src/commands/index.ts +20 -19
  107. package/src/commands/models.ts +28 -32
  108. package/src/commands/users.ts +15 -21
  109. package/src/constants/command-structure.ts +134 -157
  110. package/src/services/api-key-service.ts +105 -122
  111. package/src/services/auth-service.ts +99 -345
  112. package/src/services/browser-auth.ts +296 -0
  113. package/src/services/chat-service.ts +265 -299
  114. package/src/services/cluster-service.ts +42 -45
  115. package/src/services/collaborator-service.ts +14 -19
  116. package/src/services/flux-service.ts +23 -25
  117. package/src/services/helm-service.ts +19 -21
  118. package/src/services/kubectl-service.ts +17 -19
  119. package/src/types/api.d.ts +1905 -1907
  120. package/src/types/json.d.ts +2 -2
  121. package/src/utils/config-checker.ts +10 -10
  122. package/src/utils/config-loader.ts +162 -178
  123. package/src/utils/default-api-key.ts +114 -125
  124. package/src/utils/env-manager.ts +53 -57
  125. package/src/utils/error-handler.ts +61 -56
  126. package/src/utils/logger.ts +79 -73
  127. package/src/utils/markdown-renderer.ts +31 -31
  128. package/src/utils/opencode-validator.ts +85 -89
  129. package/src/utils/token-manager.ts +108 -87
  130. package/templates/agents/app.md +1 -0
  131. package/templates/agents/backend.md +1 -0
  132. package/templates/agents/devops.md +2 -0
  133. package/templates/agents/frontend.md +1 -0
  134. package/templates/agents/fullstack.md +1 -0
  135. package/templates/agents/quality.md +45 -40
  136. package/templates/agents/security.md +1 -0
  137. package/tests/commands/chat.test.ts +53 -62
  138. package/tests/commands/code.test.ts +265 -310
  139. package/tests/utils/config-loader.test.ts +189 -188
  140. package/tests/utils/env-manager.test.ts +110 -113
  141. package/tests/utils/opencode-validator.test.ts +52 -56
  142. package/tsconfig.json +4 -3
  143. package/vitest.config.ts +3 -3
  144. package/AGENTS.md +0 -374
  145. package/TODO.md +0 -19
@@ -3,2117 +3,2115 @@
3
3
  * Do not make direct changes to the file.
4
4
  */
5
5
 
6
- /** OneOf type helpers */
7
- type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never }
8
- type XOR<T, U> = T | U extends object
9
- ? (Without<T, U> & U) | (Without<U, T> & T)
10
- : T | U
11
- type OneOf<T extends any[]> = T extends [infer Only]
12
- ? Only
13
- : T extends [infer A, infer B, ...infer Rest]
14
- ? OneOf<[XOR<A, B>, ...Rest]>
15
- : never
16
-
17
- export interface paths {
18
- '/v1/api-keys': {
19
- /**
20
- * List all API keys
21
- * @description Lists all API keys for the authenticated user's organization.
22
- *
23
- * ## Using the CLI
24
- *
25
- * You can also manage API keys using our CLI tool:
26
- * ```
27
- * # Login first (if you haven't already)
28
- * npx berget auth login
29
- *
30
- * # List all API keys
31
- * npx berget api-keys list
32
- *
33
- * # Create a new API key
34
- * npx berget api-keys create --name my-api-key
35
- * ```
36
- */
37
- get: {
38
- responses: {
39
- /** @description List of API keys */
40
- 200: {
41
- content: {
42
- 'application/json': components['schemas']['ApiKeyListResponse']
43
- }
44
- }
45
- /** @description Unauthorized */
46
- 401: {
47
- content: never
48
- }
49
- /** @description Server error */
50
- 500: {
51
- content: never
52
- }
53
- }
54
- }
55
- /**
56
- * Create a new API key
57
- * @description Creates a new API key for the authenticated user's organization. The full API key is only returned once at creation time.
58
- *
59
- * ## Using the CLI
60
- *
61
- * Creating an API key is easier with our CLI tool:
62
- * ```
63
- * # Login first (if you haven't already)
64
- * npx berget auth login
65
- *
66
- * # Create a new API key
67
- * npx berget api-keys create --name my-api-key
68
- * ```
69
- */
70
- post: {
71
- requestBody: {
72
- content: {
73
- 'application/json': components['schemas']['CreateApiKey']
74
- }
75
- }
76
- responses: {
77
- /** @description API key created successfully */
78
- 201: {
79
- content: {
80
- 'application/json': components['schemas']['CreateApiKeyResponse']
81
- }
82
- }
83
- /** @description Unauthorized */
84
- 401: {
85
- content: never
86
- }
87
- /** @description Server error */
88
- 500: {
89
- content: never
90
- }
91
- }
92
- }
93
- }
94
- '/v1/api-keys/{id}': {
95
- /**
96
- * Delete an API key
97
- * @description Permanently deletes an API key
98
- */
99
- delete: {
100
- parameters: {
101
- path: {
102
- /** @description API key ID */
103
- id: string
104
- }
105
- }
106
- responses: {
107
- /** @description API key deleted successfully */
108
- 204: {
109
- content: never
110
- }
111
- /** @description Unauthorized */
112
- 401: {
113
- content: never
114
- }
115
- /** @description API key not found */
116
- 404: {
117
- content: never
118
- }
119
- /** @description Server error */
120
- 500: {
121
- content: never
122
- }
123
- }
124
- }
125
- }
126
- '/v1/api-keys/{id}/rotate': {
127
- /**
128
- * Rotate an API key
129
- * @description Rotates an API key by invalidating the old key and generating a new one. The new key is returned in the response and is only shown once.
130
- *
131
- * ## Using the CLI
132
- *
133
- * You can also rotate API keys using our CLI tool:
134
- * ```
135
- * # Login first (if you haven't already)
136
- * npx berget auth login
137
- *
138
- * # Rotate an API key
139
- * npx berget api-keys rotate --id <key-id>
140
- * ```
141
- *
142
- * ## Security Note
143
- *
144
- * When you rotate an API key, the old key becomes invalid immediately. Make sure to update any applications using the key.
145
- */
146
- put: {
147
- parameters: {
148
- path: {
149
- /** @description API key ID */
150
- id: string
151
- }
152
- }
153
- responses: {
154
- /** @description API key rotated successfully */
155
- 200: {
156
- content: {
157
- 'application/json': components['schemas']['CreateApiKeyResponse']
158
- }
159
- }
160
- /** @description Unauthorized */
161
- 401: {
162
- content: never
163
- }
164
- /** @description API key not found */
165
- 404: {
166
- content: never
167
- }
168
- /** @description Server error */
169
- 500: {
170
- content: never
171
- }
172
- }
173
- }
174
- }
175
- '/v1/api-keys/{id}/usage': {
176
- /**
177
- * Get API key usage statistics
178
- * @description Returns usage statistics for a specific API key including request count, daily breakdown, model-specific usage, and token consumption.
179
- *
180
- * ## Using the CLI
181
- *
182
- * You can also view API key usage using our CLI tool:
183
- * ```
184
- * # Login first (if you haven't already)
185
- * npx berget auth login
186
- *
187
- * # View usage for a specific API key
188
- * npx berget api-keys usage --id <key-id>
189
- *
190
- * # View usage for all API keys
191
- * npx berget usage
192
- * ```
193
- */
194
- get: {
195
- parameters: {
196
- query?: {
197
- /** @description Start date in YYYY-MM-DD format */
198
- start_date?: string
199
- /** @description End date in YYYY-MM-DD format */
200
- end_date?: string
201
- }
202
- path: {
203
- /** @description API key ID */
204
- id: string
205
- }
206
- }
207
- responses: {
208
- /** @description API key usage statistics */
209
- 200: {
210
- content: {
211
- 'application/json': components['schemas']['ApiKeyUsageResponse']
212
- }
213
- }
214
- /** @description Unauthorized */
215
- 401: {
216
- content: never
217
- }
218
- /** @description API key not found */
219
- 404: {
220
- content: never
221
- }
222
- /** @description Server error */
223
- 500: {
224
- content: never
225
- }
226
- }
227
- }
228
- }
229
- '/v1/apps/templates': {
230
- /**
231
- * List app templates
232
- * @description Retrieves a list of all available application templates that can be installed in your cluster
233
- */
234
- get: {
235
- responses: {
236
- /** @description List of app templates */
237
- 200: {
238
- content: {
239
- 'application/json': components['schemas']['AppTemplateList']
240
- }
241
- }
242
- /** @description Unauthorized */
243
- 401: {
244
- content: never
245
- }
246
- /** @description Server error */
247
- 500: {
248
- content: never
249
- }
250
- }
251
- }
252
- }
253
- '/v1/apps/templates/{appId}': {
254
- /**
255
- * Get app template details
256
- * @description Retrieves detailed information about a specific app template
257
- */
258
- get: {
259
- parameters: {
260
- path: {
261
- /** @description App template ID */
262
- appId: string
263
- }
264
- }
265
- responses: {
266
- /** @description App template details */
267
- 200: {
268
- content: {
269
- 'application/json': components['schemas']['AppTemplate']
270
- }
271
- }
272
- /** @description Unauthorized */
273
- 401: {
274
- content: never
275
- }
276
- /** @description App template not found */
277
- 404: {
278
- content: never
279
- }
280
- /** @description Server error */
281
- 500: {
282
- content: never
283
- }
284
- }
285
- }
286
- }
287
- '/v1/apps/installations': {
288
- /**
289
- * List app installations
290
- * @description Retrieves a list of all installed applications in your clusters
291
- */
292
- get: {
293
- responses: {
294
- /** @description List of app installations */
295
- 200: {
296
- content: {
297
- 'application/json': components['schemas']['AppInstallationList']
298
- }
299
- }
300
- /** @description Unauthorized */
301
- 401: {
302
- content: never
303
- }
304
- /** @description Server error */
305
- 500: {
306
- content: never
307
- }
308
- }
309
- }
310
- /**
311
- * Install an app
312
- * @description Installs an application from a template into your cluster
313
- */
314
- post: {
315
- requestBody: {
316
- content: {
317
- 'application/json': components['schemas']['AppInstallRequest']
318
- }
319
- }
320
- responses: {
321
- /** @description App installation initiated */
322
- 201: {
323
- content: {
324
- 'application/json': components['schemas']['AppInstallation']
325
- }
326
- }
327
- /** @description Invalid request */
328
- 400: {
329
- content: never
330
- }
331
- /** @description Unauthorized */
332
- 401: {
333
- content: never
334
- }
335
- /** @description App template not found */
336
- 404: {
337
- content: never
338
- }
339
- /** @description Server error */
340
- 500: {
341
- content: never
342
- }
343
- }
344
- }
345
- }
346
- '/v1/apps/installations/{installationId}': {
347
- /**
348
- * Get installation details
349
- * @description Retrieves detailed information about a specific app installation
350
- */
351
- get: {
352
- parameters: {
353
- path: {
354
- /** @description Installation ID */
355
- installationId: string
356
- }
357
- }
358
- responses: {
359
- /** @description Installation details */
360
- 200: {
361
- content: {
362
- 'application/json': components['schemas']['AppInstallation']
363
- }
364
- }
365
- /** @description Unauthorized */
366
- 401: {
367
- content: never
368
- }
369
- /** @description Installation not found */
370
- 404: {
371
- content: never
372
- }
373
- /** @description Server error */
374
- 500: {
375
- content: never
376
- }
377
- }
378
- }
379
- /**
380
- * Uninstall an app
381
- * @description Removes an installed application from your cluster
382
- */
383
- delete: {
384
- parameters: {
385
- path: {
386
- /** @description Installation ID */
387
- installationId: string
388
- }
389
- }
390
- responses: {
391
- /** @description App uninstallation initiated */
392
- 204: {
393
- content: never
394
- }
395
- /** @description Unauthorized */
396
- 401: {
397
- content: never
398
- }
399
- /** @description Installation not found */
400
- 404: {
401
- content: never
402
- }
403
- /** @description Server error */
404
- 500: {
405
- content: never
406
- }
407
- }
408
- }
409
- }
410
- '/v1/auth/login': {
411
- /**
412
- * OAuth login
413
- * @description Initiates OAuth login flow via Keycloak.
414
- *
415
- * ## CLI Authentication
416
- *
417
- * For a simpler experience, you can use our CLI tool to authenticate:
418
- * ```
419
- * npx berget auth login
420
- * ```
421
- *
422
- * After logging in, you can create an API key with:
423
- * ```
424
- * npx berget api-keys create --name my-api-key
425
- * ```
426
- */
427
- get: {
428
- parameters: {
429
- query?: {
430
- /** @description URL to redirect to after successful login */
431
- redirect_uri?: string
432
- /** @description How to return the token after successful login (default is redirect) */
433
- response_type?: 'redirect' | 'json'
434
- }
435
- }
436
- responses: {
437
- /** @description Redirects to Keycloak for login */
438
- 302: {
439
- content: never
440
- }
441
- }
442
- }
443
- }
444
- '/v1/auth/callback': {
445
- /**
446
- * OAuth callback
447
- * @description Handles Keycloak login callback and exchanges token
448
- */
449
- get: {
450
- parameters: {
451
- query: {
452
- code: string
453
- state: string
454
- }
455
- }
456
- responses: {
457
- /** @description Redirects to frontend */
458
- 302: {
459
- content: never
460
- }
461
- }
462
- }
463
- }
464
- '/v1/auth/device': {
465
- /**
466
- * Initiate device authorization flow
467
- * @description Initiates the device authorization flow, returning a device code and user verification URL.
468
- *
469
- * ## Using the CLI
470
- *
471
- * The recommended way to authenticate is through our CLI tool:
472
- * ```
473
- * npx berget auth login
474
- * ```
475
- *
476
- * This handles the device flow automatically and provides a better user experience.
477
- */
478
- post: {
479
- responses: {
480
- /** @description Device authorization initiated */
481
- 200: {
482
- content: {
483
- 'application/json': components['schemas']['DeviceAuthInitResponse']
484
- }
485
- }
486
- }
487
- }
488
- }
489
- '/v1/auth/device/token': {
490
- /**
491
- * Poll for device token
492
- * @description Polls for the status of a device authorization flow. The client should poll this endpoint
493
- * until it receives a token or an error.
494
- *
495
- * ## Using the CLI
496
- *
497
- * The recommended way to authenticate is through our CLI tool:
498
- * ```
499
- * npx berget auth login
500
- * ```
501
- *
502
- * This handles the polling automatically and provides a better user experience.
503
- *
504
- * ## Troubleshooting
505
- *
506
- * - If you receive a 400 error, the device code may be invalid or expired
507
- * - If you receive a 429 error, you're polling too frequently
508
- * - If you receive a 500 error, there may be an issue with the authentication service
509
- */
510
- post: {
511
- requestBody: {
512
- content: {
513
- 'application/json': components['schemas']['DeviceAuthRequest']
514
- }
515
- }
516
- responses: {
517
- /** @description Token returned or pending status */
518
- 200: {
519
- content: {
520
- 'application/json':
521
- | components['schemas']['DeviceAuthPendingResponse']
522
- | components['schemas']['DeviceAuthTokenResponse']
523
- }
524
- }
525
- /** @description Invalid device code or expired token */
526
- 400: {
527
- content: never
528
- }
529
- /** @description Polling too frequently */
530
- 429: {
531
- content: never
532
- }
533
- /** @description Server error during authentication */
534
- 500: {
535
- content: never
536
- }
537
- }
538
- }
539
- }
540
- '/v1/auth/refresh': {
541
- /**
542
- * Refresh access token
543
- * @description Refreshes an access token using a refresh token. This endpoint can be used to obtain a new
544
- * access token when the current one expires.
545
- *
546
- * ## Using the CLI
547
- *
548
- * The CLI tool handles token refresh automatically:
549
- * ```
550
- * # The CLI will refresh tokens as needed
551
- * npx berget api-keys list
552
- * ```
553
- */
554
- post: {
555
- requestBody: {
556
- content: {
557
- 'application/json': components['schemas']['RefreshTokenRequest']
558
- }
559
- }
560
- responses: {
561
- /** @description New access and refresh tokens */
562
- 200: {
563
- content: {
564
- 'application/json': components['schemas']['RefreshTokenResponse']
565
- }
566
- }
567
- /** @description Invalid or expired refresh token */
568
- 401: {
569
- content: never
570
- }
571
- }
572
- }
573
- }
574
- '/v1/auth/register-url': {
575
- /** Get Keycloak registration URL */
576
- get: {
577
- responses: {
578
- /** @description Registration URL returned */
579
- 200: {
580
- content: {
581
- 'application/json': {
582
- url?: string
583
- }
584
- }
585
- }
586
- }
587
- }
588
- }
589
- '/v1/auth/logout': {
590
- /**
591
- * Logout
592
- * @description Clears cookies and redirects to Keycloak logout
593
- */
594
- get: {
595
- parameters: {
596
- query?: {
597
- redirect_uri?: string
598
- }
599
- }
600
- responses: {
601
- /** @description Redirects to logout page */
602
- 302: {
603
- content: never
604
- }
605
- }
606
- }
607
- }
608
- '/v1/billing/usage': {
609
- /**
610
- * Get current usage
611
- * @description Retrieves current billing period usage metrics and costs. Shows detailed breakdown of API calls, compute resources, and other billable items. This helps you understand your current billing status.
612
- */
613
- get: {
614
- responses: {
615
- /** @description Current usage metrics */
616
- 200: {
617
- content: {
618
- 'application/json': components['schemas']['Usage']
619
- }
620
- }
621
- }
622
- }
623
- }
624
- '/v1/billing/invoices': {
625
- /**
626
- * List invoices
627
- * @description Retrieves all invoices for the authenticated user
628
- */
629
- get: {
630
- responses: {
631
- /** @description List of invoices */
632
- 200: {
633
- content: {
634
- 'application/json': {
635
- invoices?: components['schemas']['Invoice'][]
636
- }
637
- }
638
- }
639
- }
640
- }
641
- }
642
- '/v1/billing/invoices/{id}': {
643
- /**
644
- * Get invoice details
645
- * @description Retrieves details for a specific invoice
646
- */
647
- get: {
648
- parameters: {
649
- path: {
650
- id: string
651
- }
652
- }
653
- responses: {
654
- /** @description Invoice details */
655
- 200: {
656
- content: {
657
- 'application/json': components['schemas']['Invoice']
658
- }
659
- }
660
- }
661
- }
662
- }
663
- '/v1/billing/payment-methods': {
664
- /**
665
- * List payment methods
666
- * @description Retrieves all payment methods for the authenticated user
667
- */
668
- get: {
669
- responses: {
670
- /** @description List of payment methods */
671
- 200: {
672
- content: {
673
- 'application/json': {
674
- paymentMethods?: components['schemas']['PaymentMethod'][]
675
- }
676
- }
677
- }
678
- }
679
- }
680
- /**
681
- * Add payment method
682
- * @description Adds a new payment method for the authenticated user
683
- */
684
- post: {
685
- requestBody: {
686
- content: {
687
- 'application/json': components['schemas']['CreatePaymentMethod']
688
- }
689
- }
690
- responses: {
691
- /** @description Payment method added */
692
- 201: {
693
- content: {
694
- 'application/json': components['schemas']['PaymentMethod']
695
- }
696
- }
697
- }
698
- }
699
- }
700
- '/v1/billing/payment-methods/{id}': {
701
- /**
702
- * Remove payment method
703
- * @description Removes a payment method for the authenticated user
704
- */
705
- delete: {
706
- parameters: {
707
- path: {
708
- id: string
709
- }
710
- }
711
- responses: {
712
- /** @description Payment method removed */
713
- 204: {
714
- content: never
715
- }
716
- }
717
- }
718
- }
719
- '/v1/billing/subscription': {
720
- /**
721
- * Update subscription
722
- * @description Updates the subscription plan for the authenticated user
723
- */
724
- put: {
725
- requestBody: {
726
- content: {
727
- 'application/json': components['schemas']['UpdateSubscription']
728
- }
729
- }
730
- responses: {
731
- /** @description Subscription updated */
732
- 200: {
733
- content: never
734
- }
735
- }
736
- }
737
- }
738
- '/v1/chat/completions': {
739
- /**
740
- * Create a chat completion
741
- * @description Creates a model response for the given chat conversation.
742
- *
743
- * This endpoint is compatible with OpenAI's chat completions API, making it easy to switch between providers.
744
- *
745
- * ## Quick Start
746
- *
747
- * 1. Get an API key from the dashboard or `/v1/api-keys` endpoint
748
- * 2. Make a request with your messages:
749
- *
750
- * ```json
751
- * {
752
- * "model": "berget-70b-instruct",
753
- * "messages": [
754
- * {"role": "system", "content": "You are a helpful assistant."},
755
- * {"role": "user", "content": "Hello!"}
756
- * ],
757
- * "temperature": 0.7
758
- * }
759
- * ```
760
- *
761
- * 3. Process the response which contains the assistant's reply
762
- *
763
- * ## Streaming
764
- *
765
- * To receive a streaming response, set `stream: true` in your request:
766
- *
767
- * ```json
768
- * {
769
- * "model": "berget-70b-instruct",
770
- * "messages": [
771
- * {"role": "system", "content": "You are a helpful assistant."},
772
- * {"role": "user", "content": "Write a short story."}
773
- * ],
774
- * "stream": true
775
- * }
776
- * ```
777
- *
778
- * The response will be a stream of server-sent events (SSE), with each event containing a chunk of the response.
779
- */
780
- post: {
781
- requestBody: {
782
- content: {
783
- 'application/json': components['schemas']['ChatCompletionRequest']
784
- }
785
- }
786
- responses: {
787
- /** @description Successful completion */
788
- 200: {
789
- content: {
790
- 'application/json': components['schemas']['ChatCompletionResponse']
791
- }
792
- }
793
- /** @description Invalid request */
794
- 400: {
795
- content: never
796
- }
797
- /** @description Unauthorized */
798
- 401: {
799
- content: never
800
- }
801
- }
802
- }
803
- }
804
- '/v1/clusters': {
805
- /**
806
- * List all clusters
807
- * @description Retrieves a list of all Kubernetes clusters in the customer's namespace
808
- */
809
- get: {
810
- responses: {
811
- /** @description List of clusters */
812
- 200: {
813
- content: {
814
- 'application/json': components['schemas']['ClusterList']
815
- }
816
- }
817
- /** @description Unauthorized */
818
- 401: {
819
- content: never
820
- }
821
- /** @description Server error */
822
- 500: {
823
- content: never
824
- }
825
- }
826
- }
827
- }
828
- '/v1/clusters/usage': {
829
- /**
830
- * Get cluster usage
831
- * @description Retrieves resource usage and cost data across all Kubernetes clusters for the current billing period
832
- */
833
- get: {
834
- responses: {
835
- /** @description Cluster usage data */
836
- 200: {
837
- content: {
838
- 'application/json': components['schemas']['ClustersUsageResponse']
839
- }
840
- }
841
- /** @description Unauthorized */
842
- 401: {
843
- content: never
844
- }
845
- /** @description Server error */
846
- 500: {
847
- content: never
848
- }
849
- }
850
- }
851
- }
852
- '/v1/clusters/{clusterId}/usage': {
853
- /**
854
- * Get detailed usage for a specific cluster
855
- * @description Retrieves detailed resource usage and cost data for a specific Kubernetes cluster
856
- */
857
- get: {
858
- parameters: {
859
- path: {
860
- /** @description The cluster identifier */
861
- clusterId: string
862
- }
863
- }
864
- responses: {
865
- /** @description Detailed cluster usage data */
866
- 200: {
867
- content: {
868
- 'application/json': components['schemas']['ClusterDetailedUsage']
869
- }
870
- }
871
- /** @description Unauthorized */
872
- 401: {
873
- content: never
874
- }
875
- /** @description Cluster not found */
876
- 404: {
877
- content: never
878
- }
879
- /** @description Server error */
880
- 500: {
881
- content: never
882
- }
883
- }
884
- }
885
- }
886
- '/v1/models': {
887
- /**
888
- * List available models
889
- * @description Retrieves a list of all available AI models with their specifications, capabilities, and pricing information. Use this endpoint to discover which models are available for your chat completion API calls.
890
- */
891
- get: {
892
- responses: {
893
- /** @description List of available models */
894
- 200: {
895
- content: {
896
- 'application/json': components['schemas']['ModelList']
897
- }
898
- }
899
- /** @description Server error */
900
- 500: {
901
- content: never
902
- }
903
- }
904
- }
905
- }
906
- '/v1/models/{modelId}': {
907
- /**
908
- * Retrieve model information
909
- * @description Get detailed information about a specific model
910
- */
911
- get: {
912
- parameters: {
913
- path: {
914
- modelId: string
915
- }
916
- }
917
- responses: {
918
- /** @description Model details */
919
- 200: {
920
- content: {
921
- 'application/json': components['schemas']['Model']
922
- }
923
- }
924
- /** @description Model not found */
925
- 404: {
926
- content: never
927
- }
928
- /** @description Server error */
929
- 500: {
930
- content: never
931
- }
932
- }
933
- }
934
- }
935
- '/v1/usage/tokens': {
936
- /**
937
- * Get token usage
938
- * @description Retrieves token usage data across all models for the current billing period. This helps you track your API usage and associated costs.
939
- */
940
- get: {
941
- responses: {
942
- /** @description Token usage data */
943
- 200: {
944
- content: {
945
- 'application/json': components['schemas']['TokenUsageResponse']
946
- }
947
- }
948
- /** @description Unauthorized */
949
- 401: {
950
- content: never
951
- }
952
- /** @description Server error */
953
- 500: {
954
- content: never
955
- }
956
- }
957
- }
958
- }
959
- '/v1/usage/tokens/{modelId}': {
960
- /**
961
- * Get token usage for a specific model
962
- * @description Retrieves token usage data for a specific model in the current billing period
963
- */
964
- get: {
965
- parameters: {
966
- path: {
967
- /** @description The model identifier */
968
- modelId: string
969
- }
970
- }
971
- responses: {
972
- /** @description Model token usage data */
973
- 200: {
974
- content: {
975
- 'application/json': components['schemas']['ModelTokenUsageResponse']
976
- }
977
- }
978
- /** @description Unauthorized */
979
- 401: {
980
- content: never
981
- }
982
- /** @description Model not found */
983
- 404: {
984
- content: never
985
- }
986
- /** @description Server error */
987
- 500: {
988
- content: never
989
- }
990
- }
991
- }
992
- }
993
- '/v1/users': {
994
- /**
995
- * List team members
996
- * @description Retrieves a list of all users in your organization
997
- */
998
- get: {
999
- responses: {
1000
- /** @description List of team members */
1001
- 200: {
1002
- content: {
1003
- 'application/json': components['schemas']['UserProfile'][]
1004
- }
1005
- }
1006
- /** @description Unauthorized */
1007
- 401: {
1008
- content: {
1009
- 'application/json': components['schemas']['ErrorResponse']
1010
- }
1011
- }
1012
- /** @description Server error */
1013
- 500: {
1014
- content: {
1015
- 'application/json': components['schemas']['ErrorResponse']
1016
- }
1017
- }
1018
- }
1019
- }
1020
- }
1021
- '/v1/users/me': {
1022
- /**
1023
- * Get current user profile
1024
- * @description Retrieves the profile of the currently authenticated user
1025
- */
1026
- get: {
1027
- responses: {
1028
- /** @description User profile */
1029
- 200: {
1030
- content: {
1031
- 'application/json': components['schemas']['UserProfile']
1032
- }
1033
- }
1034
- /** @description Unauthorized */
1035
- 401: {
1036
- content: {
1037
- 'application/json': components['schemas']['ErrorResponse']
1038
- }
1039
- }
1040
- }
1041
- }
1042
- }
1043
- '/v1/users/{id}': {
1044
- /**
1045
- * Get user details
1046
- * @description Retrieves details for a specific user
1047
- */
1048
- get: {
1049
- parameters: {
1050
- path: {
1051
- id: string
1052
- }
1053
- }
1054
- responses: {
1055
- /** @description User details */
1056
- 200: {
1057
- content: {
1058
- 'application/json': components['schemas']['UserProfile']
1059
- }
1060
- }
1061
- /** @description Unauthorized */
1062
- 401: {
1063
- content: {
1064
- 'application/json': components['schemas']['ErrorResponse']
1065
- }
1066
- }
1067
- /** @description User not found */
1068
- 404: {
1069
- content: {
1070
- 'application/json': components['schemas']['ErrorResponse']
1071
- }
1072
- }
1073
- }
1074
- }
1075
- /**
1076
- * Update user
1077
- * @description Updates an existing user
1078
- */
1079
- put: {
1080
- parameters: {
1081
- path: {
1082
- id: string
1083
- }
1084
- }
1085
- requestBody: {
1086
- content: {
1087
- 'application/json': components['schemas']['UpdateUser']
1088
- }
1089
- }
1090
- responses: {
1091
- /** @description User updated */
1092
- 200: {
1093
- content: {
1094
- 'application/json': components['schemas']['UserProfile']
1095
- }
1096
- }
1097
- /** @description Invalid request */
1098
- 400: {
1099
- content: {
1100
- 'application/json': components['schemas']['ErrorResponse']
1101
- }
1102
- }
1103
- /** @description Unauthorized */
1104
- 401: {
1105
- content: {
1106
- 'application/json': components['schemas']['ErrorResponse']
1107
- }
1108
- }
1109
- /** @description Forbidden */
1110
- 403: {
1111
- content: {
1112
- 'application/json': components['schemas']['ErrorResponse']
1113
- }
1114
- }
1115
- }
1116
- }
1117
- /**
1118
- * Delete user
1119
- * @description Deletes your own user account
1120
- */
1121
- delete: {
1122
- parameters: {
1123
- path: {
1124
- id: string
1125
- }
1126
- }
1127
- responses: {
1128
- /** @description User deleted */
1129
- 204: {
1130
- content: never
1131
- }
1132
- /** @description Unauthorized */
1133
- 401: {
1134
- content: {
1135
- 'application/json': components['schemas']['ErrorResponse']
1136
- }
1137
- }
1138
- /** @description Cannot delete other users */
1139
- 403: {
1140
- content: {
1141
- 'application/json': components['schemas']['ErrorResponse']
1142
- }
1143
- }
1144
- }
1145
- }
1146
- }
1147
- '/v1/users/invite': {
1148
- /**
1149
- * Invite team member
1150
- * @description Invites a new team member to join your organization. They will receive an email with instructions to set up their account.
1151
- */
1152
- post: {
1153
- requestBody: {
1154
- content: {
1155
- 'application/json': components['schemas']['InviteUser']
1156
- }
1157
- }
1158
- responses: {
1159
- /** @description Invitation sent successfully */
1160
- 200: {
1161
- content: never
1162
- }
1163
- /** @description Unauthorized */
1164
- 401: {
1165
- content: never
1166
- }
1167
- /** @description Forbidden - insufficient permissions */
1168
- 403: {
1169
- content: never
1170
- }
1171
- }
1172
- }
1173
- }
1174
- }
1175
-
1176
- export type webhooks = Record<string, never>
1177
-
6
+ export type $defs = Record<string, never>;
1178
7
  export interface components {
8
+ headers: never;
9
+ parameters: {};
10
+ pathItems: never;
11
+ requestBodies: never;
12
+ responses: never;
1179
13
  schemas: {
1180
14
  ApiKey: {
1181
- /** @description Unique identifier for the API key */
1182
- id: number
1183
- /** @description Name of the API key */
1184
- name: string
1185
- /** @description Description of the API key */
1186
- description: string | null
1187
15
  /** @description Whether the API key is active */
1188
- active: boolean
16
+ active: boolean;
1189
17
  /**
1190
18
  * Format: date-time
1191
19
  * @description Creation timestamp
1192
20
  */
1193
- created: string
1194
- /**
1195
- * Format: date-time
1196
- * @description Last modification timestamp
1197
- */
1198
- modified: string
1199
- /**
1200
- * Format: date-time
1201
- * @description Last usage timestamp
1202
- */
1203
- lastUsed: string | null
1204
- /** @description API key prefix (for display purposes) */
1205
- prefix: string
1206
- }
1207
- ApiKeyResponse: {
1208
- /** @description Unique identifier for the API key */
1209
- id: number
1210
- /** @description Name of the API key */
1211
- name: string
21
+ created: string;
1212
22
  /** @description Description of the API key */
1213
- description: string | null
1214
- /** @description Whether the API key is active */
1215
- active: boolean
1216
- /**
1217
- * Format: date-time
1218
- * @description Creation timestamp
1219
- */
1220
- created: string
1221
- /**
1222
- * Format: date-time
1223
- * @description Last modification timestamp
1224
- */
1225
- modified: string
23
+ description: null | string;
24
+ /** @description Unique identifier for the API key */
25
+ id: number;
1226
26
  /**
1227
27
  * Format: date-time
1228
28
  * @description Last usage timestamp
1229
- */
1230
- lastUsed: string | null
1231
- /** @description API key prefix (for display purposes) */
1232
- prefix: string
1233
- }
1234
- CreateApiKey: {
1235
- /** @description Name of the API key */
1236
- name: string
1237
- /** @description Description of the API key */
1238
- description?: string
1239
- }
1240
- CreateApiKeyResponse: {
1241
- /** @description Unique identifier for the API key */
1242
- id: number
1243
- /** @description Name of the API key */
1244
- name: string
1245
- /** @description Description of the API key */
1246
- description: string | null
1247
- /** @description The API key - only returned once at creation */
1248
- key: string
29
+ */
30
+ lastUsed: null | string;
1249
31
  /**
1250
32
  * Format: date-time
1251
- * @description Creation timestamp
33
+ * @description Last modification timestamp
1252
34
  */
1253
- created: string
1254
- }
1255
- ApiKeyUsageEntry: {
1256
- /** @description Date in YYYY-MM-DD format */
1257
- date: string
1258
- /** @description Number of requests on this date */
1259
- count: number
1260
- }
35
+ modified: string;
36
+ /** @description Name of the API key */
37
+ name: string;
38
+ /** @description API key prefix (for display purposes) */
39
+ prefix: string;
40
+ };
41
+ ApiKeyListResponse: components['schemas']['ApiKey'][];
1261
42
  ApiKeyModelUsage: {
1262
43
  /** @description Model identifier */
1263
- id: string
44
+ id: string;
1264
45
  /** @description Model display name */
1265
- name: string
46
+ name: string;
1266
47
  /** @description Total number of requests to this model */
1267
- requests: number
48
+ requests: number;
1268
49
  /** @description Token usage statistics */
1269
50
  tokens: {
1270
51
  /** @description Total input tokens */
1271
- input: number
52
+ input: number;
1272
53
  /** @description Total output tokens */
1273
- output: number
54
+ output: number;
1274
55
  /** @description Total tokens (input + output) */
1275
- total: number
1276
- }
1277
- }
56
+ total: number;
57
+ };
58
+ };
59
+ ApiKeyResponse: {
60
+ /** @description Whether the API key is active */
61
+ active: boolean;
62
+ /**
63
+ * Format: date-time
64
+ * @description Creation timestamp
65
+ */
66
+ created: string;
67
+ /** @description Description of the API key */
68
+ description: null | string;
69
+ /** @description Unique identifier for the API key */
70
+ id: number;
71
+ /**
72
+ * Format: date-time
73
+ * @description Last usage timestamp
74
+ */
75
+ lastUsed: null | string;
76
+ /**
77
+ * Format: date-time
78
+ * @description Last modification timestamp
79
+ */
80
+ modified: string;
81
+ /** @description Name of the API key */
82
+ name: string;
83
+ /** @description API key prefix (for display purposes) */
84
+ prefix: string;
85
+ };
86
+ ApiKeyUsageEntry: {
87
+ /** @description Number of requests on this date */
88
+ count: number;
89
+ /** @description Date in YYYY-MM-DD format */
90
+ date: string;
91
+ };
1278
92
  ApiKeyUsageResponse: {
1279
93
  /** @description API key ID */
1280
- id: number
1281
- /** @description API key name */
1282
- name: string
1283
- /** @description Request statistics */
1284
- requests: {
1285
- /** @description Total number of requests */
1286
- total: number
1287
- /** @description Daily request counts */
1288
- daily: components['schemas']['ApiKeyUsageEntry'][]
1289
- }
94
+ id: number;
1290
95
  /** @description Usage statistics per model */
1291
- models: components['schemas']['ApiKeyModelUsage'][]
96
+ models: components['schemas']['ApiKeyModelUsage'][];
97
+ /** @description API key name */
98
+ name: string;
1292
99
  /** @description Time period for the usage data */
1293
100
  period: {
1294
- /** @description Start date of the period (YYYY-MM-DD) */
1295
- start: string
1296
101
  /** @description End date of the period (YYYY-MM-DD) */
1297
- end: string
1298
- }
1299
- }
1300
- ApiKeyListResponse: components['schemas']['ApiKey'][]
102
+ end: string;
103
+ /** @description Start date of the period (YYYY-MM-DD) */
104
+ start: string;
105
+ };
106
+ /** @description Request statistics */
107
+ requests: {
108
+ /** @description Daily request counts */
109
+ daily: components['schemas']['ApiKeyUsageEntry'][];
110
+ /** @description Total number of requests */
111
+ total: number;
112
+ };
113
+ };
114
+ AppInstallation: {
115
+ /** @description App template ID */
116
+ appId: string;
117
+ /** @description Applied configuration */
118
+ configuration: {
119
+ [key: string]: boolean | number | string;
120
+ };
121
+ /** @description Creation timestamp */
122
+ created: string;
123
+ /** @description Installation ID */
124
+ id: string;
125
+ /** @description Status message or error */
126
+ message?: string;
127
+ /** @description App name */
128
+ name: string;
129
+ /** @description Kubernetes namespace */
130
+ namespace: string;
131
+ /**
132
+ * @description Installation status
133
+ * @enum {string}
134
+ */
135
+ status: 'failed' | 'installing' | 'pending' | 'running';
136
+ /** @description Access URL if available */
137
+ url?: string;
138
+ };
139
+ AppInstallationList: {
140
+ data: {
141
+ /** @description App template ID */
142
+ appId: string;
143
+ /** @description Applied configuration */
144
+ configuration: {
145
+ [key: string]: boolean | number | string;
146
+ };
147
+ /** @description Creation timestamp */
148
+ created: string;
149
+ /** @description Installation ID */
150
+ id: string;
151
+ /** @description Status message or error */
152
+ message?: string;
153
+ /** @description App name */
154
+ name: string;
155
+ /** @description Kubernetes namespace */
156
+ namespace: string;
157
+ /**
158
+ * @description Installation status
159
+ * @enum {string}
160
+ */
161
+ status: 'failed' | 'installing' | 'pending' | 'running';
162
+ /** @description Access URL if available */
163
+ url?: string;
164
+ }[];
165
+ /** @enum {string} */
166
+ object: 'list';
167
+ };
168
+ AppInstallRequest: {
169
+ /** @description ID of the app to install */
170
+ appId: string;
171
+ /** @description Configuration values */
172
+ configuration: {
173
+ [key: string]: boolean | number | string;
174
+ };
175
+ /** @description Kubernetes namespace to install into */
176
+ namespace: string;
177
+ };
1301
178
  AppTemplate: {
1302
- /** @description Unique identifier for the app */
1303
- id: string
1304
- /** @description Display name of the app */
1305
- name: string
1306
179
  /** @description Category the app belongs to */
1307
- category: string
1308
- /** @description Short description of the app */
1309
- description: string
1310
- /** @description Number of installations */
1311
- installs: string
1312
- /** @description User rating */
1313
- rating: number
1314
- /** @description Icon identifier */
1315
- icon: string
1316
- /** @description List of key features */
1317
- features: string[]
1318
- /** @description Resource requirements */
1319
- requirements: {
1320
- /** @description Required CPU cores */
1321
- cpu: number
1322
- /** @description Required memory in GB */
1323
- memory: number
1324
- /** @description Required storage in GB */
1325
- storage: number
1326
- }
180
+ category: string;
1327
181
  /** @description Configuration options */
1328
182
  configuration: OneOf<
1329
183
  [
1330
184
  {
185
+ /** @description Default value if any */
186
+ default?: string;
1331
187
  /** @description Configuration field name */
1332
- name: string
188
+ name: string;
189
+ /** @description Whether this field is required */
190
+ required: boolean;
1333
191
  /**
1334
192
  * @description String input type
1335
193
  * @enum {string}
1336
194
  */
1337
- type: 'string'
1338
- /** @description Whether this field is required */
1339
- required: boolean
1340
- /** @description Default value if any */
1341
- default?: string
195
+ type: 'string';
1342
196
  },
1343
197
  {
198
+ /** @description Default value if any */
199
+ default?: number;
1344
200
  /** @description Configuration field name */
1345
- name: string
201
+ name: string;
202
+ /** @description Whether this field is required */
203
+ required: boolean;
1346
204
  /**
1347
205
  * @description Number input type
1348
206
  * @enum {string}
1349
207
  */
1350
- type: 'number'
1351
- /** @description Whether this field is required */
1352
- required: boolean
1353
- /** @description Default value if any */
1354
- default?: number
208
+ type: 'number';
1355
209
  },
1356
210
  {
211
+ /** @description Default value if any */
212
+ default?: boolean;
1357
213
  /** @description Configuration field name */
1358
- name: string
214
+ name: string;
215
+ /** @description Whether this field is required */
216
+ required: boolean;
1359
217
  /**
1360
218
  * @description Boolean toggle type
1361
219
  * @enum {string}
1362
220
  */
1363
- type: 'boolean'
1364
- /** @description Whether this field is required */
1365
- required: boolean
1366
- /** @description Default value if any */
1367
- default?: boolean
221
+ type: 'boolean';
1368
222
  },
1369
223
  {
224
+ /** @description Default selected option */
225
+ default?: string;
1370
226
  /** @description Configuration field name */
1371
- name: string
227
+ name: string;
228
+ /** @description Available options to select from */
229
+ options: string[];
230
+ /** @description Whether this field is required */
231
+ required: boolean;
1372
232
  /**
1373
233
  * @description Dropdown select type
1374
234
  * @enum {string}
1375
235
  */
1376
- type: 'select'
1377
- /** @description Whether this field is required */
1378
- required: boolean
1379
- /** @description Default selected option */
1380
- default?: string
1381
- /** @description Available options to select from */
1382
- options: string[]
236
+ type: 'select';
1383
237
  },
1384
238
  {
239
+ /** @description Default value if any */
240
+ default?: string;
1385
241
  /** @description Configuration field name */
1386
- name: string
242
+ name: string;
243
+ /** @description Whether this field is required */
244
+ required: boolean;
1387
245
  /**
1388
246
  * @description Password input type
1389
247
  * @enum {string}
1390
248
  */
1391
- type: 'password'
1392
- /** @description Whether this field is required */
1393
- required: boolean
1394
- /** @description Default value if any */
1395
- default?: string
249
+ type: 'password';
1396
250
  },
1397
251
  ]
1398
- >[]
252
+ >[];
253
+ /** @description Short description of the app */
254
+ description: string;
255
+ /** @description List of key features */
256
+ features: string[];
257
+ /** @description Icon identifier */
258
+ icon: string;
259
+ /** @description Unique identifier for the app */
260
+ id: string;
1399
261
  /** @description Ingress configuration if applicable */
1400
262
  ingress?: {
1401
263
  /** @description Whether ingress is enabled for this app */
1402
- enabled: boolean
264
+ enabled: boolean;
1403
265
  /** @description Hostname pattern for the ingress */
1404
- hostname: string
266
+ hostname: string;
1405
267
  /** @description Path for the ingress */
1406
- path: string
268
+ path: string;
1407
269
  /** @description Whether TLS is enabled */
1408
- tls: boolean
1409
- }
1410
- }
270
+ tls: boolean;
271
+ };
272
+ /** @description Number of installations */
273
+ installs: string;
274
+ /** @description Display name of the app */
275
+ name: string;
276
+ /** @description User rating */
277
+ rating: number;
278
+ /** @description Resource requirements */
279
+ requirements: {
280
+ /** @description Required CPU cores */
281
+ cpu: number;
282
+ /** @description Required memory in GB */
283
+ memory: number;
284
+ /** @description Required storage in GB */
285
+ storage: number;
286
+ };
287
+ };
1411
288
  AppTemplateList: {
1412
289
  data: {
1413
- /** @description Unique identifier for the app */
1414
- id: string
1415
- /** @description Display name of the app */
1416
- name: string
1417
290
  /** @description Category the app belongs to */
1418
- category: string
1419
- /** @description Short description of the app */
1420
- description: string
1421
- /** @description Number of installations */
1422
- installs: string
1423
- /** @description User rating */
1424
- rating: number
1425
- /** @description Icon identifier */
1426
- icon: string
1427
- /** @description List of key features */
1428
- features: string[]
1429
- /** @description Resource requirements */
1430
- requirements: {
1431
- /** @description Required CPU cores */
1432
- cpu: number
1433
- /** @description Required memory in GB */
1434
- memory: number
1435
- /** @description Required storage in GB */
1436
- storage: number
1437
- }
291
+ category: string;
1438
292
  /** @description Configuration options */
1439
293
  configuration: OneOf<
1440
294
  [
1441
295
  {
296
+ /** @description Default value if any */
297
+ default?: string;
1442
298
  /** @description Configuration field name */
1443
- name: string
299
+ name: string;
300
+ /** @description Whether this field is required */
301
+ required: boolean;
1444
302
  /**
1445
303
  * @description String input type
1446
304
  * @enum {string}
1447
305
  */
1448
- type: 'string'
1449
- /** @description Whether this field is required */
1450
- required: boolean
1451
- /** @description Default value if any */
1452
- default?: string
306
+ type: 'string';
1453
307
  },
1454
308
  {
309
+ /** @description Default value if any */
310
+ default?: number;
1455
311
  /** @description Configuration field name */
1456
- name: string
312
+ name: string;
313
+ /** @description Whether this field is required */
314
+ required: boolean;
1457
315
  /**
1458
316
  * @description Number input type
1459
317
  * @enum {string}
1460
318
  */
1461
- type: 'number'
1462
- /** @description Whether this field is required */
1463
- required: boolean
1464
- /** @description Default value if any */
1465
- default?: number
319
+ type: 'number';
1466
320
  },
1467
321
  {
322
+ /** @description Default value if any */
323
+ default?: boolean;
1468
324
  /** @description Configuration field name */
1469
- name: string
325
+ name: string;
326
+ /** @description Whether this field is required */
327
+ required: boolean;
1470
328
  /**
1471
329
  * @description Boolean toggle type
1472
330
  * @enum {string}
1473
331
  */
1474
- type: 'boolean'
1475
- /** @description Whether this field is required */
1476
- required: boolean
1477
- /** @description Default value if any */
1478
- default?: boolean
332
+ type: 'boolean';
1479
333
  },
1480
334
  {
335
+ /** @description Default selected option */
336
+ default?: string;
1481
337
  /** @description Configuration field name */
1482
- name: string
338
+ name: string;
339
+ /** @description Available options to select from */
340
+ options: string[];
341
+ /** @description Whether this field is required */
342
+ required: boolean;
1483
343
  /**
1484
344
  * @description Dropdown select type
1485
345
  * @enum {string}
1486
346
  */
1487
- type: 'select'
1488
- /** @description Whether this field is required */
1489
- required: boolean
1490
- /** @description Default selected option */
1491
- default?: string
1492
- /** @description Available options to select from */
1493
- options: string[]
347
+ type: 'select';
1494
348
  },
1495
349
  {
350
+ /** @description Default value if any */
351
+ default?: string;
1496
352
  /** @description Configuration field name */
1497
- name: string
353
+ name: string;
354
+ /** @description Whether this field is required */
355
+ required: boolean;
1498
356
  /**
1499
357
  * @description Password input type
1500
358
  * @enum {string}
1501
359
  */
1502
- type: 'password'
1503
- /** @description Whether this field is required */
1504
- required: boolean
1505
- /** @description Default value if any */
1506
- default?: string
360
+ type: 'password';
1507
361
  },
1508
362
  ]
1509
- >[]
363
+ >[];
364
+ /** @description Short description of the app */
365
+ description: string;
366
+ /** @description List of key features */
367
+ features: string[];
368
+ /** @description Icon identifier */
369
+ icon: string;
370
+ /** @description Unique identifier for the app */
371
+ id: string;
1510
372
  /** @description Ingress configuration if applicable */
1511
373
  ingress?: {
1512
374
  /** @description Whether ingress is enabled for this app */
1513
- enabled: boolean
375
+ enabled: boolean;
1514
376
  /** @description Hostname pattern for the ingress */
1515
- hostname: string
377
+ hostname: string;
1516
378
  /** @description Path for the ingress */
1517
- path: string
379
+ path: string;
1518
380
  /** @description Whether TLS is enabled */
1519
- tls: boolean
1520
- }
1521
- }[]
1522
- /** @enum {string} */
1523
- object: 'list'
1524
- }
1525
- AppInstallRequest: {
1526
- /** @description ID of the app to install */
1527
- appId: string
1528
- /** @description Kubernetes namespace to install into */
1529
- namespace: string
1530
- /** @description Configuration values */
1531
- configuration: {
1532
- [key: string]: string | number | boolean
1533
- }
1534
- }
1535
- AppInstallation: {
1536
- /** @description Installation ID */
1537
- id: string
1538
- /** @description App template ID */
1539
- appId: string
1540
- /** @description App name */
1541
- name: string
1542
- /** @description Kubernetes namespace */
1543
- namespace: string
1544
- /**
1545
- * @description Installation status
1546
- * @enum {string}
1547
- */
1548
- status: 'pending' | 'installing' | 'running' | 'failed'
1549
- /** @description Creation timestamp */
1550
- created: string
1551
- /** @description Status message or error */
1552
- message?: string
1553
- /** @description Access URL if available */
1554
- url?: string
1555
- /** @description Applied configuration */
1556
- configuration: {
1557
- [key: string]: string | number | boolean
1558
- }
1559
- }
1560
- AppInstallationList: {
1561
- data: {
1562
- /** @description Installation ID */
1563
- id: string
1564
- /** @description App template ID */
1565
- appId: string
1566
- /** @description App name */
1567
- name: string
1568
- /** @description Kubernetes namespace */
1569
- namespace: string
1570
- /**
1571
- * @description Installation status
1572
- * @enum {string}
1573
- */
1574
- status: 'pending' | 'installing' | 'running' | 'failed'
1575
- /** @description Creation timestamp */
1576
- created: string
1577
- /** @description Status message or error */
1578
- message?: string
1579
- /** @description Access URL if available */
1580
- url?: string
1581
- /** @description Applied configuration */
1582
- configuration: {
1583
- [key: string]: string | number | boolean
1584
- }
1585
- }[]
1586
- /** @enum {string} */
1587
- object: 'list'
1588
- }
1589
- AuthToken: {
1590
- accessToken: string
1591
- expiresIn: number
1592
- user?: {
1593
- id: string
1594
- name: string
1595
- /** Format: email */
1596
- email: string
1597
- }
1598
- }
1599
- User: {
1600
- id: string
1601
- login: string
1602
- name: string | null
1603
- /** Format: email */
1604
- email: string | null
1605
- /** Format: uri */
1606
- avatarUrl: string
1607
- }
1608
- RefreshTokenRequest: {
1609
- /** @description The refresh token to use */
1610
- refresh_token: string
1611
- /** @description Whether this is a device token */
1612
- is_device_token?: boolean
1613
- }
1614
- RefreshTokenResponse: {
1615
- /** @description The new access token */
1616
- token: string
1617
- /** @description The new refresh token */
1618
- refresh_token: string
1619
- /** @description Seconds until the access token expires */
1620
- expires_in: number
1621
- /** @description Seconds until the refresh token expires */
1622
- refresh_expires_in: number
1623
- }
1624
- DeviceAuthRequest: {
1625
- /** @description The device code obtained from the device authorization request */
1626
- device_code: string
1627
- }
1628
- DeviceAuthInitResponse: {
1629
- /** @description Code used by the device to poll for authentication status */
1630
- device_code: string
1631
- /** @description Code displayed to the user for authentication */
1632
- user_code: string
1633
- /** @description URL where the user should enter the user_code */
1634
- verification_url: string
1635
- /** @description Expiration time in seconds */
1636
- expires_in: number
1637
- /** @description Polling interval in seconds */
1638
- interval: number
1639
- }
1640
- DeviceAuthPendingResponse: {
1641
- /**
1642
- * @description Authentication is still pending
1643
- * @enum {string}
1644
- */
1645
- status: 'pending'
1646
- }
1647
- DeviceAuthTokenResponse: {
1648
- /** @description Access token */
1649
- token: string
1650
- /** @description Refresh token */
1651
- refresh_token: string
1652
- /** @description Access token expiration time in seconds */
1653
- expires_in: number
1654
- /** @description Refresh token expiration time in seconds */
1655
- refresh_expires_in: number
1656
- }
1657
- Usage: {
1658
- current_period: {
1659
- /** Format: date-time */
1660
- start_date: string
1661
- /** Format: date-time */
1662
- end_date: string
1663
- }
1664
- metrics: {
1665
- name: string
1666
- value: number
1667
- unit: string
1668
- cost: number
1669
- currency: string
1670
- }[]
1671
- total: {
1672
- amount: number
1673
- currency: string
1674
- }
1675
- }
1676
- Invoice: {
1677
- id: string
1678
- number: string
1679
- /** Format: date-time */
1680
- issuingDate: string
1681
- /** @enum {string} */
1682
- paymentStatus: 'pending' | 'succeeded' | 'failed'
1683
- amount: number
1684
- currency: string
1685
- customerId: string
1686
- customer: {
1687
- id: string
1688
- name: string
1689
- /** Format: email */
1690
- email: string
1691
- /** Format: date-time */
1692
- createdAt: string
1693
- }
1694
- }
1695
- PaymentMethod: {
1696
- id: string
1697
- /** @enum {string} */
1698
- type: 'card' | 'sepa'
1699
- last4: string
1700
- expMonth?: number
1701
- expYear?: number
1702
- brand?: string
1703
- isDefault: boolean
1704
- }
1705
- CreatePaymentMethod: {
1706
- /** @enum {string} */
1707
- type: 'card' | 'sepa'
1708
- token: string
1709
- setDefault?: boolean
1710
- }
1711
- UpdateSubscription: {
1712
- planId: string
1713
- quantity?: number
1714
- }
1715
- ChatMessage: {
1716
- /**
1717
- * @default user
1718
- * @enum {string}
1719
- */
1720
- role?: 'system' | 'user' | 'assistant'
1721
- content: string
1722
- }
381
+ tls: boolean;
382
+ };
383
+ /** @description Number of installations */
384
+ installs: string;
385
+ /** @description Display name of the app */
386
+ name: string;
387
+ /** @description User rating */
388
+ rating: number;
389
+ /** @description Resource requirements */
390
+ requirements: {
391
+ /** @description Required CPU cores */
392
+ cpu: number;
393
+ /** @description Required memory in GB */
394
+ memory: number;
395
+ /** @description Required storage in GB */
396
+ storage: number;
397
+ };
398
+ }[];
399
+ /** @enum {string} */
400
+ object: 'list';
401
+ };
402
+ AuthToken: {
403
+ accessToken: string;
404
+ expiresIn: number;
405
+ user?: {
406
+ /** Format: email */
407
+ email: string;
408
+ id: string;
409
+ name: string;
410
+ };
411
+ };
1723
412
  ChatCompletionRequest: {
1724
- model: string
1725
- messages: components['schemas']['ChatMessage'][]
1726
- temperature?: number
1727
413
  /** @default 4096 */
1728
- max_tokens?: number
414
+ max_tokens?: number;
415
+ messages: components['schemas']['ChatMessage'][];
416
+ model: string;
1729
417
  /** @default false */
1730
- stream?: boolean
418
+ stream?: boolean;
419
+ temperature?: number;
1731
420
  /** @default 1 */
1732
- top_p?: number
1733
- }
421
+ top_p?: number;
422
+ };
1734
423
  ChatCompletionResponse: {
1735
- /** @description Unique identifier for this completion */
1736
- id: string
1737
- /** @enum {string} */
1738
- object: 'chat.completion'
1739
- /** @description Unix timestamp of when the completion was created */
1740
- created: number
1741
- /** @description The model used for completion */
1742
- model: string
1743
424
  choices: {
425
+ /** @enum {string} */
426
+ finish_reason: 'content_filter' | 'length' | 'stop';
427
+ index: number;
1744
428
  message: {
1745
- /** @enum {string} */
1746
- role: 'assistant'
1747
429
  /** @description The model's response */
1748
- content: string
1749
- }
1750
- /** @enum {string} */
1751
- finish_reason: 'stop' | 'length' | 'content_filter'
1752
- index: number
1753
- }[]
430
+ content: string;
431
+ /** @enum {string} */
432
+ role: 'assistant';
433
+ };
434
+ }[];
435
+ /** @description Unix timestamp of when the completion was created */
436
+ created: number;
437
+ /** @description Unique identifier for this completion */
438
+ id: string;
439
+ /** @description The model used for completion */
440
+ model: string;
441
+ /** @enum {string} */
442
+ object: 'chat.completion';
1754
443
  usage: {
1755
- prompt_tokens: number
1756
- completion_tokens: number
1757
- total_tokens: number
1758
- }
1759
- }
444
+ completion_tokens: number;
445
+ prompt_tokens: number;
446
+ total_tokens: number;
447
+ };
448
+ };
449
+ ChatMessage: {
450
+ content: string;
451
+ /**
452
+ * @default user
453
+ * @enum {string}
454
+ */
455
+ role?: 'assistant' | 'system' | 'user';
456
+ };
1760
457
  Cluster: {
458
+ /**
459
+ * Format: date-time
460
+ * @description Creation timestamp
461
+ */
462
+ created: string;
1761
463
  /** @description Unique identifier for the cluster */
1762
- id: string
464
+ id: string;
1763
465
  /** @description Display name of the cluster */
1764
- name: string
466
+ name: string;
467
+ /** @description Number of nodes in the cluster */
468
+ nodes: number;
1765
469
  /** @description Cloud provider (AWS, GCP, Azure, etc.) */
1766
- provider: string
470
+ provider: string;
1767
471
  /** @description Cloud region where the cluster is deployed */
1768
- region: string
1769
- /** @description Kubernetes version */
1770
- version: string
1771
- /** @description Number of nodes in the cluster */
1772
- nodes: number
472
+ region: string;
1773
473
  /**
1774
474
  * @description Current status of the cluster
1775
475
  * @enum {string}
1776
476
  */
1777
- status: 'healthy' | 'degraded' | 'unhealthy' | 'unknown'
1778
- /**
1779
- * Format: date-time
1780
- * @description Creation timestamp
1781
- */
1782
- created: string
1783
- }
1784
- ClusterList: {
1785
- data: components['schemas']['Cluster'][]
1786
- /** @enum {string} */
1787
- object: 'list'
1788
- }
1789
- ResourceMetric: {
1790
- /** @description Total allocated resources */
1791
- allocated: number
1792
- /** @description Currently used resources */
1793
- used: number
1794
- /** @description Available resources */
1795
- available: number
1796
- /** @description Unit of measurement (e.g., cores, GB) */
1797
- unit: string
1798
- }
477
+ status: 'degraded' | 'healthy' | 'unhealthy' | 'unknown';
478
+ /** @description Kubernetes version */
479
+ version: string;
480
+ };
1799
481
  /** @description Cost breakdown */
1800
482
  ClusterCost: {
1801
483
  /** @description Cost for CPU resources */
1802
- cpu: number
484
+ cpu: number;
485
+ /** @description Currency code (e.g., USD, EUR) */
486
+ currency: string;
1803
487
  /** @description Cost for memory resources */
1804
- memory: number
1805
- /** @description Cost for storage resources */
1806
- storage: number
488
+ memory: number;
1807
489
  /** @description Cost for network resources */
1808
- network: number
490
+ network: number;
491
+ /** @description Cost for storage resources */
492
+ storage: number;
1809
493
  /** @description Total cost */
1810
- total: number
1811
- /** @description Currency code (e.g., USD, EUR) */
1812
- currency: string
1813
- }
1814
- ClusterUsage: {
1815
- /** @description Unique cluster identifier */
1816
- id: string
1817
- /** @description Cluster name */
1818
- name: string
1819
- /** @description Resource usage metrics */
1820
- resources: {
1821
- cpu: components['schemas']['ResourceMetric']
1822
- memory: components['schemas']['ResourceMetric']
1823
- storage: components['schemas']['ResourceMetric']
1824
- }
1825
- cost: components['schemas']['ClusterCost']
1826
- /** @description Number of nodes in the cluster */
1827
- nodes: number
1828
- /** @description Current cluster status */
1829
- status: string
1830
- }
1831
- ResourceMetricWithTrend: components['schemas']['ResourceMetric'] & {
1832
- /** @description Historical usage trend data */
1833
- usage_trend: {
1834
- /** @description Date in YYYY-MM-DD format */
1835
- date: string
1836
- /** @description Resource usage value for this date */
1837
- value: number
1838
- }[]
1839
- }
1840
- DailyCost: {
1841
- /** @description Date in YYYY-MM-DD format */
1842
- date: string
1843
- /** @description CPU cost for this day */
1844
- cpu: number
1845
- /** @description Memory cost for this day */
1846
- memory: number
1847
- /** @description Storage cost for this day */
1848
- storage: number
1849
- /** @description Network cost for this day */
1850
- network: number
1851
- /** @description Total cost for this day */
1852
- total: number
1853
- }
494
+ total: number;
495
+ };
1854
496
  /** @description Detailed cost breakdown with daily data */
1855
497
  ClusterCostWithDaily: components['schemas']['ClusterCost'] & {
1856
498
  /** @description Daily cost breakdown */
1857
- daily: components['schemas']['DailyCost'][]
1858
- }
499
+ daily: components['schemas']['DailyCost'][];
500
+ };
1859
501
  ClusterDetailedUsage: {
502
+ cost: components['schemas']['ClusterCostWithDaily'];
1860
503
  /** @description Unique cluster identifier */
1861
- id: string
504
+ id: string;
1862
505
  /** @description Cluster name */
1863
- name: string
1864
- /** @description Detailed resource usage metrics with trends */
1865
- resources: {
1866
- cpu: components['schemas']['ResourceMetricWithTrend']
1867
- memory: components['schemas']['ResourceMetricWithTrend']
1868
- storage: components['schemas']['ResourceMetricWithTrend']
1869
- }
1870
- cost: components['schemas']['ClusterCostWithDaily']
506
+ name: string;
1871
507
  /** @description Number of nodes in the cluster */
1872
- nodes: number
1873
- /** @description Current cluster status */
1874
- status: string
508
+ nodes: number;
1875
509
  /** @description Time period for the usage data */
1876
510
  period: {
1877
- /** @description Start date of the period (YYYY-MM-DD) */
1878
- start: string
1879
511
  /** @description End date of the period (YYYY-MM-DD) */
1880
- end: string
1881
- }
1882
- }
512
+ end: string;
513
+ /** @description Start date of the period (YYYY-MM-DD) */
514
+ start: string;
515
+ };
516
+ /** @description Detailed resource usage metrics with trends */
517
+ resources: {
518
+ cpu: components['schemas']['ResourceMetricWithTrend'];
519
+ memory: components['schemas']['ResourceMetricWithTrend'];
520
+ storage: components['schemas']['ResourceMetricWithTrend'];
521
+ };
522
+ /** @description Current cluster status */
523
+ status: string;
524
+ };
525
+ ClusterList: {
526
+ data: components['schemas']['Cluster'][];
527
+ /** @enum {string} */
528
+ object: 'list';
529
+ };
1883
530
  ClustersUsageResponse: {
1884
531
  /** @description List of clusters with usage data */
1885
- clusters: components['schemas']['ClusterUsage'][]
532
+ clusters: components['schemas']['ClusterUsage'][];
1886
533
  /** @description Time period for the usage data */
1887
534
  period: {
1888
- /** @description Start date of the period (YYYY-MM-DD) */
1889
- start: string
1890
535
  /** @description End date of the period (YYYY-MM-DD) */
1891
- end: string
1892
- }
536
+ end: string;
537
+ /** @description Start date of the period (YYYY-MM-DD) */
538
+ start: string;
539
+ };
1893
540
  /** @description Aggregated totals */
1894
541
  total: {
1895
542
  /** @description Total cost breakdown across all clusters */
1896
543
  cost: {
1897
544
  /** @description Total CPU cost across all clusters */
1898
- cpu: number
545
+ cpu: number;
546
+ /** @description Currency code (e.g., USD, EUR) */
547
+ currency: string;
1899
548
  /** @description Total memory cost across all clusters */
1900
- memory: number
1901
- /** @description Total storage cost across all clusters */
1902
- storage: number
549
+ memory: number;
1903
550
  /** @description Total network cost across all clusters */
1904
- network: number
551
+ network: number;
552
+ /** @description Total storage cost across all clusters */
553
+ storage: number;
1905
554
  /** @description Total cost across all clusters */
1906
- total: number
1907
- /** @description Currency code (e.g., USD, EUR) */
1908
- currency: string
1909
- }
1910
- }
1911
- }
555
+ total: number;
556
+ };
557
+ };
558
+ };
559
+ ClusterUsage: {
560
+ cost: components['schemas']['ClusterCost'];
561
+ /** @description Unique cluster identifier */
562
+ id: string;
563
+ /** @description Cluster name */
564
+ name: string;
565
+ /** @description Number of nodes in the cluster */
566
+ nodes: number;
567
+ /** @description Resource usage metrics */
568
+ resources: {
569
+ cpu: components['schemas']['ResourceMetric'];
570
+ memory: components['schemas']['ResourceMetric'];
571
+ storage: components['schemas']['ResourceMetric'];
572
+ };
573
+ /** @description Current cluster status */
574
+ status: string;
575
+ };
576
+ CreateApiKey: {
577
+ /** @description Description of the API key */
578
+ description?: string;
579
+ /** @description Name of the API key */
580
+ name: string;
581
+ };
582
+ CreateApiKeyResponse: {
583
+ /**
584
+ * Format: date-time
585
+ * @description Creation timestamp
586
+ */
587
+ created: string;
588
+ /** @description Description of the API key */
589
+ description: null | string;
590
+ /** @description Unique identifier for the API key */
591
+ id: number;
592
+ /** @description The API key - only returned once at creation */
593
+ key: string;
594
+ /** @description Name of the API key */
595
+ name: string;
596
+ };
597
+ CreatePaymentMethod: {
598
+ setDefault?: boolean;
599
+ token: string;
600
+ /** @enum {string} */
601
+ type: 'card' | 'sepa';
602
+ };
603
+ CreateUser: {
604
+ company_id: number;
605
+ /** Format: email */
606
+ email: string;
607
+ name: string;
608
+ phone: null | string;
609
+ /** @enum {string} */
610
+ role: 'admin' | 'member';
611
+ settings?: {
612
+ language?: string;
613
+ notifications: boolean;
614
+ /** @enum {string} */
615
+ theme?: 'dark' | 'light' | 'system';
616
+ timezone: string;
617
+ };
618
+ };
619
+ DailyCost: {
620
+ /** @description CPU cost for this day */
621
+ cpu: number;
622
+ /** @description Date in YYYY-MM-DD format */
623
+ date: string;
624
+ /** @description Memory cost for this day */
625
+ memory: number;
626
+ /** @description Network cost for this day */
627
+ network: number;
628
+ /** @description Storage cost for this day */
629
+ storage: number;
630
+ /** @description Total cost for this day */
631
+ total: number;
632
+ };
633
+ DailyTokenUsage: {
634
+ cost: components['schemas']['TokenCost'];
635
+ /** @description Usage date in YYYY-MM-DD format */
636
+ date: string;
637
+ /** @description Number of input tokens used */
638
+ input_tokens: number;
639
+ /** @description Model identifier */
640
+ model?: string;
641
+ /** @description Number of output tokens generated */
642
+ output_tokens: number;
643
+ /** @description Total tokens (input + output) */
644
+ total_tokens: number;
645
+ };
646
+ DeviceAuthInitResponse: {
647
+ /** @description Code used by the device to poll for authentication status */
648
+ device_code: string;
649
+ /** @description Expiration time in seconds */
650
+ expires_in: number;
651
+ /** @description Polling interval in seconds */
652
+ interval: number;
653
+ /** @description Code displayed to the user for authentication */
654
+ user_code: string;
655
+ /** @description URL where the user should enter the user_code */
656
+ verification_url: string;
657
+ };
658
+ DeviceAuthPendingResponse: {
659
+ /**
660
+ * @description Authentication is still pending
661
+ * @enum {string}
662
+ */
663
+ status: 'pending';
664
+ };
665
+ DeviceAuthRequest: {
666
+ /** @description The device code obtained from the device authorization request */
667
+ device_code: string;
668
+ };
669
+ DeviceAuthTokenResponse: {
670
+ /** @description Access token expiration time in seconds */
671
+ expires_in: number;
672
+ /** @description Refresh token expiration time in seconds */
673
+ refresh_expires_in: number;
674
+ /** @description Refresh token */
675
+ refresh_token: string;
676
+ /** @description Access token */
677
+ token: string;
678
+ };
679
+ ErrorResponse: {
680
+ code?: string;
681
+ details?: unknown;
682
+ error: string;
683
+ };
684
+ HealthCheck: {
685
+ environment: string;
686
+ npmVersion: string;
687
+ status: string;
688
+ timestamp: string;
689
+ version: string;
690
+ };
691
+ InviteUser: {
692
+ /** @description Company ID to invite the user to (defaults to current user's company) */
693
+ companyId?: number;
694
+ /**
695
+ * Format: email
696
+ * @description Email address of the person to invite
697
+ */
698
+ email: string;
699
+ /**
700
+ * @description Role to assign to the new team member
701
+ * @enum {string}
702
+ */
703
+ role: 'admin' | 'member';
704
+ };
705
+ Invoice: {
706
+ amount: number;
707
+ currency: string;
708
+ customer: {
709
+ /** Format: date-time */
710
+ createdAt: string;
711
+ /** Format: email */
712
+ email: string;
713
+ id: string;
714
+ name: string;
715
+ };
716
+ customerId: string;
717
+ id: string;
718
+ /** Format: date-time */
719
+ issuingDate: string;
720
+ number: string;
721
+ /** @enum {string} */
722
+ paymentStatus: 'failed' | 'pending' | 'succeeded';
723
+ };
1912
724
  Model: {
725
+ /** @description Whether the model is active */
726
+ active: boolean;
727
+ /** @description Description of the model */
728
+ description: string;
1913
729
  /** @description Unique identifier for the model */
1914
- id: string
730
+ id: string;
1915
731
  /** @description Name of the model */
1916
- name: string
1917
- /** @description Description of the model */
1918
- description: string
1919
- /** @description Whether the model is active */
1920
- active: boolean
1921
- }
1922
- ModelList: components['schemas']['Model'][]
732
+ name: string;
733
+ };
734
+ ModelList: components['schemas']['Model'][];
735
+ ModelTokenUsageResponse: {
736
+ /** @description Model identifier */
737
+ model: string;
738
+ period: components['schemas']['TokenUsagePeriod'];
739
+ total: components['schemas']['TokenUsageTotal'];
740
+ /** @description Daily token usage data */
741
+ usage: components['schemas']['DailyTokenUsage'][];
742
+ };
743
+ PaymentMethod: {
744
+ brand?: string;
745
+ expMonth?: number;
746
+ expYear?: number;
747
+ id: string;
748
+ isDefault: boolean;
749
+ last4: string;
750
+ /** @enum {string} */
751
+ type: 'card' | 'sepa';
752
+ };
753
+ RefreshTokenRequest: {
754
+ /** @description Whether this is a device token */
755
+ is_device_token?: boolean;
756
+ /** @description The refresh token to use */
757
+ refresh_token: string;
758
+ };
759
+ RefreshTokenResponse: {
760
+ /** @description Seconds until the access token expires */
761
+ expires_in: number;
762
+ /** @description Seconds until the refresh token expires */
763
+ refresh_expires_in: number;
764
+ /** @description The new refresh token */
765
+ refresh_token: string;
766
+ /** @description The new access token */
767
+ token: string;
768
+ };
769
+ ResourceMetric: {
770
+ /** @description Total allocated resources */
771
+ allocated: number;
772
+ /** @description Available resources */
773
+ available: number;
774
+ /** @description Unit of measurement (e.g., cores, GB) */
775
+ unit: string;
776
+ /** @description Currently used resources */
777
+ used: number;
778
+ };
779
+ ResourceMetricWithTrend: components['schemas']['ResourceMetric'] & {
780
+ /** @description Historical usage trend data */
781
+ usage_trend: {
782
+ /** @description Date in YYYY-MM-DD format */
783
+ date: string;
784
+ /** @description Resource usage value for this date */
785
+ value: number;
786
+ }[];
787
+ };
1923
788
  /** @description Cost information for this usage */
1924
789
  TokenCost: {
1925
790
  /** @description Cost amount */
1926
- amount: number
791
+ amount: number;
1927
792
  /** @description Currency code (e.g., USD, EUR) */
1928
- currency: string
1929
- }
1930
- DailyTokenUsage: {
1931
- /** @description Usage date in YYYY-MM-DD format */
1932
- date: string
1933
- /** @description Model identifier */
1934
- model?: string
1935
- /** @description Number of input tokens used */
1936
- input_tokens: number
1937
- /** @description Number of output tokens generated */
1938
- output_tokens: number
1939
- /** @description Total tokens (input + output) */
1940
- total_tokens: number
1941
- cost: components['schemas']['TokenCost']
1942
- }
1943
- /** @description Aggregated usage totals */
1944
- TokenUsageTotal: {
1945
- /** @description Total input tokens for the period */
1946
- input_tokens: number
1947
- /** @description Total output tokens for the period */
1948
- output_tokens: number
1949
- /** @description Total tokens for the period */
1950
- total_tokens: number
1951
- cost: components['schemas']['TokenCost']
1952
- }
793
+ currency: string;
794
+ };
1953
795
  /** @description Time period for the usage data */
1954
796
  TokenUsagePeriod: {
1955
- /** @description Start date of the period (YYYY-MM-DD) */
1956
- start: string
1957
797
  /** @description End date of the period (YYYY-MM-DD) */
1958
- end: string
1959
- }
798
+ end: string;
799
+ /** @description Start date of the period (YYYY-MM-DD) */
800
+ start: string;
801
+ };
1960
802
  TokenUsageResponse: {
803
+ period: components['schemas']['TokenUsagePeriod'];
804
+ total: components['schemas']['TokenUsageTotal'];
1961
805
  /** @description Daily token usage data */
1962
- usage: components['schemas']['DailyTokenUsage'][]
1963
- total: components['schemas']['TokenUsageTotal']
1964
- period: components['schemas']['TokenUsagePeriod']
1965
- }
1966
- ModelTokenUsageResponse: {
1967
- /** @description Model identifier */
1968
- model: string
1969
- /** @description Daily token usage data */
1970
- usage: components['schemas']['DailyTokenUsage'][]
1971
- total: components['schemas']['TokenUsageTotal']
1972
- period: components['schemas']['TokenUsagePeriod']
1973
- }
806
+ usage: components['schemas']['DailyTokenUsage'][];
807
+ };
808
+ /** @description Aggregated usage totals */
809
+ TokenUsageTotal: {
810
+ cost: components['schemas']['TokenCost'];
811
+ /** @description Total input tokens for the period */
812
+ input_tokens: number;
813
+ /** @description Total output tokens for the period */
814
+ output_tokens: number;
815
+ /** @description Total tokens for the period */
816
+ total_tokens: number;
817
+ };
818
+ UpdateSubscription: {
819
+ planId: string;
820
+ quantity?: number;
821
+ };
822
+ UpdateUser: {
823
+ /** Format: email */
824
+ email?: string;
825
+ name?: string;
826
+ phone?: null | string;
827
+ settings?: {
828
+ language?: string;
829
+ notifications: boolean;
830
+ /** @enum {string} */
831
+ theme?: 'dark' | 'light' | 'system';
832
+ timezone: string;
833
+ };
834
+ };
835
+ Usage: {
836
+ current_period: {
837
+ /** Format: date-time */
838
+ end_date: string;
839
+ /** Format: date-time */
840
+ start_date: string;
841
+ };
842
+ metrics: {
843
+ cost: number;
844
+ currency: string;
845
+ name: string;
846
+ unit: string;
847
+ value: number;
848
+ }[];
849
+ total: {
850
+ amount: number;
851
+ currency: string;
852
+ };
853
+ };
854
+ User: {
855
+ /** Format: uri */
856
+ avatarUrl: string;
857
+ /** Format: email */
858
+ email: null | string;
859
+ id: string;
860
+ login: string;
861
+ name: null | string;
862
+ };
1974
863
  /** @description Complete user profile including company details */
1975
864
  UserProfile: {
1976
- /** @description Unique identifier for the user */
1977
- id: string
865
+ /** @description Whether the user account is active */
866
+ active: boolean | null;
867
+ /** @description Associated company details */
868
+ company?: {
869
+ /** @description City */
870
+ city: null | string;
871
+ /** @description Company country information */
872
+ country: null | {
873
+ /** @description ISO country code */
874
+ code: string;
875
+ /** @description Country ID */
876
+ id: number;
877
+ /** @description Country name */
878
+ name: string;
879
+ };
880
+ /**
881
+ * Format: email
882
+ * @description Company email address
883
+ */
884
+ email: string;
885
+ /** @description Company unique identifier */
886
+ id: number;
887
+ /** @description Legal company name */
888
+ name: string;
889
+ /** @description Company phone number */
890
+ phone: null | string;
891
+ /** @description Street address */
892
+ street: null | string;
893
+ /** @description VAT identification number */
894
+ vat: string;
895
+ };
896
+ /** @description ID of the company the user belongs to */
897
+ company_id: number;
898
+ /**
899
+ * Format: date-time
900
+ * @description When the user was created
901
+ */
902
+ createdAt: null | string;
1978
903
  /**
1979
904
  * Format: email
1980
905
  * @description User's email address
1981
906
  */
1982
- email: string
907
+ email: string;
908
+ /** @description Unique identifier for the user */
909
+ id: string;
910
+ /** @description Username for login */
911
+ login: string;
1983
912
  /** @description Full name of the user */
1984
- name: string
913
+ name: string;
1985
914
  /** @description Contact phone number */
1986
- phone: string | null
1987
- /** @description ID of the company the user belongs to */
1988
- company_id: number
1989
- /** @description Username for login */
1990
- login: string
1991
- /**
1992
- * @description User role determining permissions
1993
- * @enum {string}
1994
- */
1995
- role: 'admin' | 'member'
1996
- /** @description Whether the user account is active */
1997
- active: boolean | null
1998
- /**
1999
- * Format: date-time
2000
- * @description When the user was created
2001
- */
2002
- createdAt: string | null
915
+ phone: null | string;
2003
916
  /**
2004
- * Format: date-time
2005
- * @description Last update timestamp
917
+ * @description User role determining permissions
918
+ * @enum {string}
2006
919
  */
2007
- updatedAt: string | null
920
+ role: 'admin' | 'member';
2008
921
  /** @description User preferences and settings */
2009
922
  settings?: {
2010
- /** @description Email notification preferences */
2011
- notifications: boolean
2012
- /** @description User's preferred timezone */
2013
- timezone: string
2014
923
  /** @description Preferred interface language */
2015
- language?: string
924
+ language?: string;
925
+ /** @description Email notification preferences */
926
+ notifications: boolean;
2016
927
  /**
2017
928
  * @description UI theme preference
2018
929
  * @enum {string}
2019
930
  */
2020
- theme?: 'light' | 'dark' | 'system'
2021
- }
2022
- /** @description Associated company details */
2023
- company?: {
2024
- /** @description Company unique identifier */
2025
- id: number
2026
- /** @description Legal company name */
2027
- name: string
2028
- /** @description VAT identification number */
2029
- vat: string
2030
- /**
2031
- * Format: email
2032
- * @description Company email address
2033
- */
2034
- email: string
2035
- /** @description Company phone number */
2036
- phone: string | null
2037
- /** @description Street address */
2038
- street: string | null
2039
- /** @description City */
2040
- city: string | null
2041
- /** @description Company country information */
2042
- country: {
2043
- /** @description Country ID */
2044
- id: number
2045
- /** @description Country name */
2046
- name: string
2047
- /** @description ISO country code */
2048
- code: string
2049
- } | null
2050
- }
2051
- }
2052
- CreateUser: {
2053
- name: string
2054
- /** Format: email */
2055
- email: string
2056
- phone: string | null
2057
- company_id: number
2058
- /** @enum {string} */
2059
- role: 'admin' | 'member'
2060
- settings?: {
2061
- notifications: boolean
2062
- timezone: string
2063
- language?: string
2064
- /** @enum {string} */
2065
- theme?: 'light' | 'dark' | 'system'
2066
- }
2067
- }
2068
- UpdateUser: {
2069
- name?: string
2070
- /** Format: email */
2071
- email?: string
2072
- phone?: string | null
2073
- settings?: {
2074
- notifications: boolean
2075
- timezone: string
2076
- language?: string
2077
- /** @enum {string} */
2078
- theme?: 'light' | 'dark' | 'system'
2079
- }
2080
- }
2081
- InviteUser: {
2082
- /**
2083
- * Format: email
2084
- * @description Email address of the person to invite
2085
- */
2086
- email: string
931
+ theme?: 'dark' | 'light' | 'system';
932
+ /** @description User's preferred timezone */
933
+ timezone: string;
934
+ };
2087
935
  /**
2088
- * @description Role to assign to the new team member
2089
- * @enum {string}
936
+ * Format: date-time
937
+ * @description Last update timestamp
2090
938
  */
2091
- role: 'admin' | 'member'
2092
- /** @description Company ID to invite the user to (defaults to current user's company) */
2093
- companyId?: number
2094
- }
2095
- ErrorResponse: {
2096
- error: string
2097
- code?: string
2098
- details?: unknown
2099
- }
2100
- HealthCheck: {
2101
- status: string
2102
- timestamp: string
2103
- version: string
2104
- npmVersion: string
2105
- environment: string
2106
- }
2107
- }
2108
- responses: never
2109
- parameters: {}
2110
- requestBodies: never
2111
- headers: never
2112
- pathItems: never
939
+ updatedAt: null | string;
940
+ };
941
+ };
942
+ }
943
+ export type external = Record<string, never>;
944
+
945
+ export type operations = Record<string, never>;
946
+
947
+ export interface paths {
948
+ '/v1/api-keys': {
949
+ /**
950
+ * List all API keys
951
+ * @description Lists all API keys for the authenticated user's organization.
952
+ *
953
+ * ## Using the CLI
954
+ *
955
+ * You can also manage API keys using our CLI tool:
956
+ * ```
957
+ * # Login first (if you haven't already)
958
+ * npx berget auth login
959
+ *
960
+ * # List all API keys
961
+ * npx berget api-keys list
962
+ *
963
+ * # Create a new API key
964
+ * npx berget api-keys create --name my-api-key
965
+ * ```
966
+ */
967
+ get: {
968
+ responses: {
969
+ /** @description List of API keys */
970
+ 200: {
971
+ content: {
972
+ 'application/json': components['schemas']['ApiKeyListResponse'];
973
+ };
974
+ };
975
+ /** @description Unauthorized */
976
+ 401: {
977
+ content: never;
978
+ };
979
+ /** @description Server error */
980
+ 500: {
981
+ content: never;
982
+ };
983
+ };
984
+ };
985
+ /**
986
+ * Create a new API key
987
+ * @description Creates a new API key for the authenticated user's organization. The full API key is only returned once at creation time.
988
+ *
989
+ * ## Using the CLI
990
+ *
991
+ * Creating an API key is easier with our CLI tool:
992
+ * ```
993
+ * # Login first (if you haven't already)
994
+ * npx berget auth login
995
+ *
996
+ * # Create a new API key
997
+ * npx berget api-keys create --name my-api-key
998
+ * ```
999
+ */
1000
+ post: {
1001
+ requestBody: {
1002
+ content: {
1003
+ 'application/json': components['schemas']['CreateApiKey'];
1004
+ };
1005
+ };
1006
+ responses: {
1007
+ /** @description API key created successfully */
1008
+ 201: {
1009
+ content: {
1010
+ 'application/json': components['schemas']['CreateApiKeyResponse'];
1011
+ };
1012
+ };
1013
+ /** @description Unauthorized */
1014
+ 401: {
1015
+ content: never;
1016
+ };
1017
+ /** @description Server error */
1018
+ 500: {
1019
+ content: never;
1020
+ };
1021
+ };
1022
+ };
1023
+ };
1024
+ '/v1/api-keys/{id}': {
1025
+ /**
1026
+ * Delete an API key
1027
+ * @description Permanently deletes an API key
1028
+ */
1029
+ delete: {
1030
+ parameters: {
1031
+ path: {
1032
+ /** @description API key ID */
1033
+ id: string;
1034
+ };
1035
+ };
1036
+ responses: {
1037
+ /** @description API key deleted successfully */
1038
+ 204: {
1039
+ content: never;
1040
+ };
1041
+ /** @description Unauthorized */
1042
+ 401: {
1043
+ content: never;
1044
+ };
1045
+ /** @description API key not found */
1046
+ 404: {
1047
+ content: never;
1048
+ };
1049
+ /** @description Server error */
1050
+ 500: {
1051
+ content: never;
1052
+ };
1053
+ };
1054
+ };
1055
+ };
1056
+ '/v1/api-keys/{id}/rotate': {
1057
+ /**
1058
+ * Rotate an API key
1059
+ * @description Rotates an API key by invalidating the old key and generating a new one. The new key is returned in the response and is only shown once.
1060
+ *
1061
+ * ## Using the CLI
1062
+ *
1063
+ * You can also rotate API keys using our CLI tool:
1064
+ * ```
1065
+ * # Login first (if you haven't already)
1066
+ * npx berget auth login
1067
+ *
1068
+ * # Rotate an API key
1069
+ * npx berget api-keys rotate --id <key-id>
1070
+ * ```
1071
+ *
1072
+ * ## Security Note
1073
+ *
1074
+ * When you rotate an API key, the old key becomes invalid immediately. Make sure to update any applications using the key.
1075
+ */
1076
+ put: {
1077
+ parameters: {
1078
+ path: {
1079
+ /** @description API key ID */
1080
+ id: string;
1081
+ };
1082
+ };
1083
+ responses: {
1084
+ /** @description API key rotated successfully */
1085
+ 200: {
1086
+ content: {
1087
+ 'application/json': components['schemas']['CreateApiKeyResponse'];
1088
+ };
1089
+ };
1090
+ /** @description Unauthorized */
1091
+ 401: {
1092
+ content: never;
1093
+ };
1094
+ /** @description API key not found */
1095
+ 404: {
1096
+ content: never;
1097
+ };
1098
+ /** @description Server error */
1099
+ 500: {
1100
+ content: never;
1101
+ };
1102
+ };
1103
+ };
1104
+ };
1105
+ '/v1/api-keys/{id}/usage': {
1106
+ /**
1107
+ * Get API key usage statistics
1108
+ * @description Returns usage statistics for a specific API key including request count, daily breakdown, model-specific usage, and token consumption.
1109
+ *
1110
+ * ## Using the CLI
1111
+ *
1112
+ * You can also view API key usage using our CLI tool:
1113
+ * ```
1114
+ * # Login first (if you haven't already)
1115
+ * npx berget auth login
1116
+ *
1117
+ * # View usage for a specific API key
1118
+ * npx berget api-keys usage --id <key-id>
1119
+ *
1120
+ * # View usage for all API keys
1121
+ * npx berget usage
1122
+ * ```
1123
+ */
1124
+ get: {
1125
+ parameters: {
1126
+ path: {
1127
+ /** @description API key ID */
1128
+ id: string;
1129
+ };
1130
+ query?: {
1131
+ /** @description End date in YYYY-MM-DD format */
1132
+ end_date?: string;
1133
+ /** @description Start date in YYYY-MM-DD format */
1134
+ start_date?: string;
1135
+ };
1136
+ };
1137
+ responses: {
1138
+ /** @description API key usage statistics */
1139
+ 200: {
1140
+ content: {
1141
+ 'application/json': components['schemas']['ApiKeyUsageResponse'];
1142
+ };
1143
+ };
1144
+ /** @description Unauthorized */
1145
+ 401: {
1146
+ content: never;
1147
+ };
1148
+ /** @description API key not found */
1149
+ 404: {
1150
+ content: never;
1151
+ };
1152
+ /** @description Server error */
1153
+ 500: {
1154
+ content: never;
1155
+ };
1156
+ };
1157
+ };
1158
+ };
1159
+ '/v1/apps/installations': {
1160
+ /**
1161
+ * List app installations
1162
+ * @description Retrieves a list of all installed applications in your clusters
1163
+ */
1164
+ get: {
1165
+ responses: {
1166
+ /** @description List of app installations */
1167
+ 200: {
1168
+ content: {
1169
+ 'application/json': components['schemas']['AppInstallationList'];
1170
+ };
1171
+ };
1172
+ /** @description Unauthorized */
1173
+ 401: {
1174
+ content: never;
1175
+ };
1176
+ /** @description Server error */
1177
+ 500: {
1178
+ content: never;
1179
+ };
1180
+ };
1181
+ };
1182
+ /**
1183
+ * Install an app
1184
+ * @description Installs an application from a template into your cluster
1185
+ */
1186
+ post: {
1187
+ requestBody: {
1188
+ content: {
1189
+ 'application/json': components['schemas']['AppInstallRequest'];
1190
+ };
1191
+ };
1192
+ responses: {
1193
+ /** @description App installation initiated */
1194
+ 201: {
1195
+ content: {
1196
+ 'application/json': components['schemas']['AppInstallation'];
1197
+ };
1198
+ };
1199
+ /** @description Invalid request */
1200
+ 400: {
1201
+ content: never;
1202
+ };
1203
+ /** @description Unauthorized */
1204
+ 401: {
1205
+ content: never;
1206
+ };
1207
+ /** @description App template not found */
1208
+ 404: {
1209
+ content: never;
1210
+ };
1211
+ /** @description Server error */
1212
+ 500: {
1213
+ content: never;
1214
+ };
1215
+ };
1216
+ };
1217
+ };
1218
+ '/v1/apps/installations/{installationId}': {
1219
+ /**
1220
+ * Uninstall an app
1221
+ * @description Removes an installed application from your cluster
1222
+ */
1223
+ delete: {
1224
+ parameters: {
1225
+ path: {
1226
+ /** @description Installation ID */
1227
+ installationId: string;
1228
+ };
1229
+ };
1230
+ responses: {
1231
+ /** @description App uninstallation initiated */
1232
+ 204: {
1233
+ content: never;
1234
+ };
1235
+ /** @description Unauthorized */
1236
+ 401: {
1237
+ content: never;
1238
+ };
1239
+ /** @description Installation not found */
1240
+ 404: {
1241
+ content: never;
1242
+ };
1243
+ /** @description Server error */
1244
+ 500: {
1245
+ content: never;
1246
+ };
1247
+ };
1248
+ };
1249
+ /**
1250
+ * Get installation details
1251
+ * @description Retrieves detailed information about a specific app installation
1252
+ */
1253
+ get: {
1254
+ parameters: {
1255
+ path: {
1256
+ /** @description Installation ID */
1257
+ installationId: string;
1258
+ };
1259
+ };
1260
+ responses: {
1261
+ /** @description Installation details */
1262
+ 200: {
1263
+ content: {
1264
+ 'application/json': components['schemas']['AppInstallation'];
1265
+ };
1266
+ };
1267
+ /** @description Unauthorized */
1268
+ 401: {
1269
+ content: never;
1270
+ };
1271
+ /** @description Installation not found */
1272
+ 404: {
1273
+ content: never;
1274
+ };
1275
+ /** @description Server error */
1276
+ 500: {
1277
+ content: never;
1278
+ };
1279
+ };
1280
+ };
1281
+ };
1282
+ '/v1/apps/templates': {
1283
+ /**
1284
+ * List app templates
1285
+ * @description Retrieves a list of all available application templates that can be installed in your cluster
1286
+ */
1287
+ get: {
1288
+ responses: {
1289
+ /** @description List of app templates */
1290
+ 200: {
1291
+ content: {
1292
+ 'application/json': components['schemas']['AppTemplateList'];
1293
+ };
1294
+ };
1295
+ /** @description Unauthorized */
1296
+ 401: {
1297
+ content: never;
1298
+ };
1299
+ /** @description Server error */
1300
+ 500: {
1301
+ content: never;
1302
+ };
1303
+ };
1304
+ };
1305
+ };
1306
+ '/v1/apps/templates/{appId}': {
1307
+ /**
1308
+ * Get app template details
1309
+ * @description Retrieves detailed information about a specific app template
1310
+ */
1311
+ get: {
1312
+ parameters: {
1313
+ path: {
1314
+ /** @description App template ID */
1315
+ appId: string;
1316
+ };
1317
+ };
1318
+ responses: {
1319
+ /** @description App template details */
1320
+ 200: {
1321
+ content: {
1322
+ 'application/json': components['schemas']['AppTemplate'];
1323
+ };
1324
+ };
1325
+ /** @description Unauthorized */
1326
+ 401: {
1327
+ content: never;
1328
+ };
1329
+ /** @description App template not found */
1330
+ 404: {
1331
+ content: never;
1332
+ };
1333
+ /** @description Server error */
1334
+ 500: {
1335
+ content: never;
1336
+ };
1337
+ };
1338
+ };
1339
+ };
1340
+ '/v1/auth/callback': {
1341
+ /**
1342
+ * OAuth callback
1343
+ * @description Handles Keycloak login callback and exchanges token
1344
+ */
1345
+ get: {
1346
+ parameters: {
1347
+ query: {
1348
+ code: string;
1349
+ state: string;
1350
+ };
1351
+ };
1352
+ responses: {
1353
+ /** @description Redirects to frontend */
1354
+ 302: {
1355
+ content: never;
1356
+ };
1357
+ };
1358
+ };
1359
+ };
1360
+ '/v1/auth/device': {
1361
+ /**
1362
+ * Initiate device authorization flow
1363
+ * @description Initiates the device authorization flow, returning a device code and user verification URL.
1364
+ *
1365
+ * ## Using the CLI
1366
+ *
1367
+ * The recommended way to authenticate is through our CLI tool:
1368
+ * ```
1369
+ * npx berget auth login
1370
+ * ```
1371
+ *
1372
+ * This handles the device flow automatically and provides a better user experience.
1373
+ */
1374
+ post: {
1375
+ responses: {
1376
+ /** @description Device authorization initiated */
1377
+ 200: {
1378
+ content: {
1379
+ 'application/json': components['schemas']['DeviceAuthInitResponse'];
1380
+ };
1381
+ };
1382
+ };
1383
+ };
1384
+ };
1385
+ '/v1/auth/device/token': {
1386
+ /**
1387
+ * Poll for device token
1388
+ * @description Polls for the status of a device authorization flow. The client should poll this endpoint
1389
+ * until it receives a token or an error.
1390
+ *
1391
+ * ## Using the CLI
1392
+ *
1393
+ * The recommended way to authenticate is through our CLI tool:
1394
+ * ```
1395
+ * npx berget auth login
1396
+ * ```
1397
+ *
1398
+ * This handles the polling automatically and provides a better user experience.
1399
+ *
1400
+ * ## Troubleshooting
1401
+ *
1402
+ * - If you receive a 400 error, the device code may be invalid or expired
1403
+ * - If you receive a 429 error, you're polling too frequently
1404
+ * - If you receive a 500 error, there may be an issue with the authentication service
1405
+ */
1406
+ post: {
1407
+ requestBody: {
1408
+ content: {
1409
+ 'application/json': components['schemas']['DeviceAuthRequest'];
1410
+ };
1411
+ };
1412
+ responses: {
1413
+ /** @description Token returned or pending status */
1414
+ 200: {
1415
+ content: {
1416
+ 'application/json':
1417
+ | components['schemas']['DeviceAuthPendingResponse']
1418
+ | components['schemas']['DeviceAuthTokenResponse'];
1419
+ };
1420
+ };
1421
+ /** @description Invalid device code or expired token */
1422
+ 400: {
1423
+ content: never;
1424
+ };
1425
+ /** @description Polling too frequently */
1426
+ 429: {
1427
+ content: never;
1428
+ };
1429
+ /** @description Server error during authentication */
1430
+ 500: {
1431
+ content: never;
1432
+ };
1433
+ };
1434
+ };
1435
+ };
1436
+ '/v1/auth/login': {
1437
+ /**
1438
+ * OAuth login
1439
+ * @description Initiates OAuth login flow via Keycloak.
1440
+ *
1441
+ * ## CLI Authentication
1442
+ *
1443
+ * For a simpler experience, you can use our CLI tool to authenticate:
1444
+ * ```
1445
+ * npx berget auth login
1446
+ * ```
1447
+ *
1448
+ * After logging in, you can create an API key with:
1449
+ * ```
1450
+ * npx berget api-keys create --name my-api-key
1451
+ * ```
1452
+ */
1453
+ get: {
1454
+ parameters: {
1455
+ query?: {
1456
+ /** @description URL to redirect to after successful login */
1457
+ redirect_uri?: string;
1458
+ /** @description How to return the token after successful login (default is redirect) */
1459
+ response_type?: 'json' | 'redirect';
1460
+ };
1461
+ };
1462
+ responses: {
1463
+ /** @description Redirects to Keycloak for login */
1464
+ 302: {
1465
+ content: never;
1466
+ };
1467
+ };
1468
+ };
1469
+ };
1470
+ '/v1/auth/logout': {
1471
+ /**
1472
+ * Logout
1473
+ * @description Clears cookies and redirects to Keycloak logout
1474
+ */
1475
+ get: {
1476
+ parameters: {
1477
+ query?: {
1478
+ redirect_uri?: string;
1479
+ };
1480
+ };
1481
+ responses: {
1482
+ /** @description Redirects to logout page */
1483
+ 302: {
1484
+ content: never;
1485
+ };
1486
+ };
1487
+ };
1488
+ };
1489
+ '/v1/auth/refresh': {
1490
+ /**
1491
+ * Refresh access token
1492
+ * @description Refreshes an access token using a refresh token. This endpoint can be used to obtain a new
1493
+ * access token when the current one expires.
1494
+ *
1495
+ * ## Using the CLI
1496
+ *
1497
+ * The CLI tool handles token refresh automatically:
1498
+ * ```
1499
+ * # The CLI will refresh tokens as needed
1500
+ * npx berget api-keys list
1501
+ * ```
1502
+ */
1503
+ post: {
1504
+ requestBody: {
1505
+ content: {
1506
+ 'application/json': components['schemas']['RefreshTokenRequest'];
1507
+ };
1508
+ };
1509
+ responses: {
1510
+ /** @description New access and refresh tokens */
1511
+ 200: {
1512
+ content: {
1513
+ 'application/json': components['schemas']['RefreshTokenResponse'];
1514
+ };
1515
+ };
1516
+ /** @description Invalid or expired refresh token */
1517
+ 401: {
1518
+ content: never;
1519
+ };
1520
+ };
1521
+ };
1522
+ };
1523
+ '/v1/auth/register-url': {
1524
+ /** Get Keycloak registration URL */
1525
+ get: {
1526
+ responses: {
1527
+ /** @description Registration URL returned */
1528
+ 200: {
1529
+ content: {
1530
+ 'application/json': {
1531
+ url?: string;
1532
+ };
1533
+ };
1534
+ };
1535
+ };
1536
+ };
1537
+ };
1538
+ '/v1/billing/invoices': {
1539
+ /**
1540
+ * List invoices
1541
+ * @description Retrieves all invoices for the authenticated user
1542
+ */
1543
+ get: {
1544
+ responses: {
1545
+ /** @description List of invoices */
1546
+ 200: {
1547
+ content: {
1548
+ 'application/json': {
1549
+ invoices?: components['schemas']['Invoice'][];
1550
+ };
1551
+ };
1552
+ };
1553
+ };
1554
+ };
1555
+ };
1556
+ '/v1/billing/invoices/{id}': {
1557
+ /**
1558
+ * Get invoice details
1559
+ * @description Retrieves details for a specific invoice
1560
+ */
1561
+ get: {
1562
+ parameters: {
1563
+ path: {
1564
+ id: string;
1565
+ };
1566
+ };
1567
+ responses: {
1568
+ /** @description Invoice details */
1569
+ 200: {
1570
+ content: {
1571
+ 'application/json': components['schemas']['Invoice'];
1572
+ };
1573
+ };
1574
+ };
1575
+ };
1576
+ };
1577
+ '/v1/billing/payment-methods': {
1578
+ /**
1579
+ * List payment methods
1580
+ * @description Retrieves all payment methods for the authenticated user
1581
+ */
1582
+ get: {
1583
+ responses: {
1584
+ /** @description List of payment methods */
1585
+ 200: {
1586
+ content: {
1587
+ 'application/json': {
1588
+ paymentMethods?: components['schemas']['PaymentMethod'][];
1589
+ };
1590
+ };
1591
+ };
1592
+ };
1593
+ };
1594
+ /**
1595
+ * Add payment method
1596
+ * @description Adds a new payment method for the authenticated user
1597
+ */
1598
+ post: {
1599
+ requestBody: {
1600
+ content: {
1601
+ 'application/json': components['schemas']['CreatePaymentMethod'];
1602
+ };
1603
+ };
1604
+ responses: {
1605
+ /** @description Payment method added */
1606
+ 201: {
1607
+ content: {
1608
+ 'application/json': components['schemas']['PaymentMethod'];
1609
+ };
1610
+ };
1611
+ };
1612
+ };
1613
+ };
1614
+ '/v1/billing/payment-methods/{id}': {
1615
+ /**
1616
+ * Remove payment method
1617
+ * @description Removes a payment method for the authenticated user
1618
+ */
1619
+ delete: {
1620
+ parameters: {
1621
+ path: {
1622
+ id: string;
1623
+ };
1624
+ };
1625
+ responses: {
1626
+ /** @description Payment method removed */
1627
+ 204: {
1628
+ content: never;
1629
+ };
1630
+ };
1631
+ };
1632
+ };
1633
+ '/v1/billing/subscription': {
1634
+ /**
1635
+ * Update subscription
1636
+ * @description Updates the subscription plan for the authenticated user
1637
+ */
1638
+ put: {
1639
+ requestBody: {
1640
+ content: {
1641
+ 'application/json': components['schemas']['UpdateSubscription'];
1642
+ };
1643
+ };
1644
+ responses: {
1645
+ /** @description Subscription updated */
1646
+ 200: {
1647
+ content: never;
1648
+ };
1649
+ };
1650
+ };
1651
+ };
1652
+ '/v1/billing/usage': {
1653
+ /**
1654
+ * Get current usage
1655
+ * @description Retrieves current billing period usage metrics and costs. Shows detailed breakdown of API calls, compute resources, and other billable items. This helps you understand your current billing status.
1656
+ */
1657
+ get: {
1658
+ responses: {
1659
+ /** @description Current usage metrics */
1660
+ 200: {
1661
+ content: {
1662
+ 'application/json': components['schemas']['Usage'];
1663
+ };
1664
+ };
1665
+ };
1666
+ };
1667
+ };
1668
+ '/v1/chat/completions': {
1669
+ /**
1670
+ * Create a chat completion
1671
+ * @description Creates a model response for the given chat conversation.
1672
+ *
1673
+ * This endpoint is compatible with OpenAI's chat completions API, making it easy to switch between providers.
1674
+ *
1675
+ * ## Quick Start
1676
+ *
1677
+ * 1. Get an API key from the dashboard or `/v1/api-keys` endpoint
1678
+ * 2. Make a request with your messages:
1679
+ *
1680
+ * ```json
1681
+ * {
1682
+ * "model": "berget-70b-instruct",
1683
+ * "messages": [
1684
+ * {"role": "system", "content": "You are a helpful assistant."},
1685
+ * {"role": "user", "content": "Hello!"}
1686
+ * ],
1687
+ * "temperature": 0.7
1688
+ * }
1689
+ * ```
1690
+ *
1691
+ * 3. Process the response which contains the assistant's reply
1692
+ *
1693
+ * ## Streaming
1694
+ *
1695
+ * To receive a streaming response, set `stream: true` in your request:
1696
+ *
1697
+ * ```json
1698
+ * {
1699
+ * "model": "berget-70b-instruct",
1700
+ * "messages": [
1701
+ * {"role": "system", "content": "You are a helpful assistant."},
1702
+ * {"role": "user", "content": "Write a short story."}
1703
+ * ],
1704
+ * "stream": true
1705
+ * }
1706
+ * ```
1707
+ *
1708
+ * The response will be a stream of server-sent events (SSE), with each event containing a chunk of the response.
1709
+ */
1710
+ post: {
1711
+ requestBody: {
1712
+ content: {
1713
+ 'application/json': components['schemas']['ChatCompletionRequest'];
1714
+ };
1715
+ };
1716
+ responses: {
1717
+ /** @description Successful completion */
1718
+ 200: {
1719
+ content: {
1720
+ 'application/json': components['schemas']['ChatCompletionResponse'];
1721
+ };
1722
+ };
1723
+ /** @description Invalid request */
1724
+ 400: {
1725
+ content: never;
1726
+ };
1727
+ /** @description Unauthorized */
1728
+ 401: {
1729
+ content: never;
1730
+ };
1731
+ };
1732
+ };
1733
+ };
1734
+ '/v1/clusters': {
1735
+ /**
1736
+ * List all clusters
1737
+ * @description Retrieves a list of all Kubernetes clusters in the customer's namespace
1738
+ */
1739
+ get: {
1740
+ responses: {
1741
+ /** @description List of clusters */
1742
+ 200: {
1743
+ content: {
1744
+ 'application/json': components['schemas']['ClusterList'];
1745
+ };
1746
+ };
1747
+ /** @description Unauthorized */
1748
+ 401: {
1749
+ content: never;
1750
+ };
1751
+ /** @description Server error */
1752
+ 500: {
1753
+ content: never;
1754
+ };
1755
+ };
1756
+ };
1757
+ };
1758
+ '/v1/clusters/usage': {
1759
+ /**
1760
+ * Get cluster usage
1761
+ * @description Retrieves resource usage and cost data across all Kubernetes clusters for the current billing period
1762
+ */
1763
+ get: {
1764
+ responses: {
1765
+ /** @description Cluster usage data */
1766
+ 200: {
1767
+ content: {
1768
+ 'application/json': components['schemas']['ClustersUsageResponse'];
1769
+ };
1770
+ };
1771
+ /** @description Unauthorized */
1772
+ 401: {
1773
+ content: never;
1774
+ };
1775
+ /** @description Server error */
1776
+ 500: {
1777
+ content: never;
1778
+ };
1779
+ };
1780
+ };
1781
+ };
1782
+ '/v1/clusters/{clusterId}/usage': {
1783
+ /**
1784
+ * Get detailed usage for a specific cluster
1785
+ * @description Retrieves detailed resource usage and cost data for a specific Kubernetes cluster
1786
+ */
1787
+ get: {
1788
+ parameters: {
1789
+ path: {
1790
+ /** @description The cluster identifier */
1791
+ clusterId: string;
1792
+ };
1793
+ };
1794
+ responses: {
1795
+ /** @description Detailed cluster usage data */
1796
+ 200: {
1797
+ content: {
1798
+ 'application/json': components['schemas']['ClusterDetailedUsage'];
1799
+ };
1800
+ };
1801
+ /** @description Unauthorized */
1802
+ 401: {
1803
+ content: never;
1804
+ };
1805
+ /** @description Cluster not found */
1806
+ 404: {
1807
+ content: never;
1808
+ };
1809
+ /** @description Server error */
1810
+ 500: {
1811
+ content: never;
1812
+ };
1813
+ };
1814
+ };
1815
+ };
1816
+ '/v1/models': {
1817
+ /**
1818
+ * List available models
1819
+ * @description Retrieves a list of all available AI models with their specifications, capabilities, and pricing information. Use this endpoint to discover which models are available for your chat completion API calls.
1820
+ */
1821
+ get: {
1822
+ responses: {
1823
+ /** @description List of available models */
1824
+ 200: {
1825
+ content: {
1826
+ 'application/json': components['schemas']['ModelList'];
1827
+ };
1828
+ };
1829
+ /** @description Server error */
1830
+ 500: {
1831
+ content: never;
1832
+ };
1833
+ };
1834
+ };
1835
+ };
1836
+ '/v1/models/{modelId}': {
1837
+ /**
1838
+ * Retrieve model information
1839
+ * @description Get detailed information about a specific model
1840
+ */
1841
+ get: {
1842
+ parameters: {
1843
+ path: {
1844
+ modelId: string;
1845
+ };
1846
+ };
1847
+ responses: {
1848
+ /** @description Model details */
1849
+ 200: {
1850
+ content: {
1851
+ 'application/json': components['schemas']['Model'];
1852
+ };
1853
+ };
1854
+ /** @description Model not found */
1855
+ 404: {
1856
+ content: never;
1857
+ };
1858
+ /** @description Server error */
1859
+ 500: {
1860
+ content: never;
1861
+ };
1862
+ };
1863
+ };
1864
+ };
1865
+ '/v1/usage/tokens': {
1866
+ /**
1867
+ * Get token usage
1868
+ * @description Retrieves token usage data across all models for the current billing period. This helps you track your API usage and associated costs.
1869
+ */
1870
+ get: {
1871
+ responses: {
1872
+ /** @description Token usage data */
1873
+ 200: {
1874
+ content: {
1875
+ 'application/json': components['schemas']['TokenUsageResponse'];
1876
+ };
1877
+ };
1878
+ /** @description Unauthorized */
1879
+ 401: {
1880
+ content: never;
1881
+ };
1882
+ /** @description Server error */
1883
+ 500: {
1884
+ content: never;
1885
+ };
1886
+ };
1887
+ };
1888
+ };
1889
+ '/v1/usage/tokens/{modelId}': {
1890
+ /**
1891
+ * Get token usage for a specific model
1892
+ * @description Retrieves token usage data for a specific model in the current billing period
1893
+ */
1894
+ get: {
1895
+ parameters: {
1896
+ path: {
1897
+ /** @description The model identifier */
1898
+ modelId: string;
1899
+ };
1900
+ };
1901
+ responses: {
1902
+ /** @description Model token usage data */
1903
+ 200: {
1904
+ content: {
1905
+ 'application/json': components['schemas']['ModelTokenUsageResponse'];
1906
+ };
1907
+ };
1908
+ /** @description Unauthorized */
1909
+ 401: {
1910
+ content: never;
1911
+ };
1912
+ /** @description Model not found */
1913
+ 404: {
1914
+ content: never;
1915
+ };
1916
+ /** @description Server error */
1917
+ 500: {
1918
+ content: never;
1919
+ };
1920
+ };
1921
+ };
1922
+ };
1923
+ '/v1/users': {
1924
+ /**
1925
+ * List team members
1926
+ * @description Retrieves a list of all users in your organization
1927
+ */
1928
+ get: {
1929
+ responses: {
1930
+ /** @description List of team members */
1931
+ 200: {
1932
+ content: {
1933
+ 'application/json': components['schemas']['UserProfile'][];
1934
+ };
1935
+ };
1936
+ /** @description Unauthorized */
1937
+ 401: {
1938
+ content: {
1939
+ 'application/json': components['schemas']['ErrorResponse'];
1940
+ };
1941
+ };
1942
+ /** @description Server error */
1943
+ 500: {
1944
+ content: {
1945
+ 'application/json': components['schemas']['ErrorResponse'];
1946
+ };
1947
+ };
1948
+ };
1949
+ };
1950
+ };
1951
+ '/v1/users/invite': {
1952
+ /**
1953
+ * Invite team member
1954
+ * @description Invites a new team member to join your organization. They will receive an email with instructions to set up their account.
1955
+ */
1956
+ post: {
1957
+ requestBody: {
1958
+ content: {
1959
+ 'application/json': components['schemas']['InviteUser'];
1960
+ };
1961
+ };
1962
+ responses: {
1963
+ /** @description Invitation sent successfully */
1964
+ 200: {
1965
+ content: never;
1966
+ };
1967
+ /** @description Unauthorized */
1968
+ 401: {
1969
+ content: never;
1970
+ };
1971
+ /** @description Forbidden - insufficient permissions */
1972
+ 403: {
1973
+ content: never;
1974
+ };
1975
+ };
1976
+ };
1977
+ };
1978
+ '/v1/users/me': {
1979
+ /**
1980
+ * Get current user profile
1981
+ * @description Retrieves the profile of the currently authenticated user
1982
+ */
1983
+ get: {
1984
+ responses: {
1985
+ /** @description User profile */
1986
+ 200: {
1987
+ content: {
1988
+ 'application/json': components['schemas']['UserProfile'];
1989
+ };
1990
+ };
1991
+ /** @description Unauthorized */
1992
+ 401: {
1993
+ content: {
1994
+ 'application/json': components['schemas']['ErrorResponse'];
1995
+ };
1996
+ };
1997
+ };
1998
+ };
1999
+ };
2000
+ '/v1/users/{id}': {
2001
+ /**
2002
+ * Delete user
2003
+ * @description Deletes your own user account
2004
+ */
2005
+ delete: {
2006
+ parameters: {
2007
+ path: {
2008
+ id: string;
2009
+ };
2010
+ };
2011
+ responses: {
2012
+ /** @description User deleted */
2013
+ 204: {
2014
+ content: never;
2015
+ };
2016
+ /** @description Unauthorized */
2017
+ 401: {
2018
+ content: {
2019
+ 'application/json': components['schemas']['ErrorResponse'];
2020
+ };
2021
+ };
2022
+ /** @description Cannot delete other users */
2023
+ 403: {
2024
+ content: {
2025
+ 'application/json': components['schemas']['ErrorResponse'];
2026
+ };
2027
+ };
2028
+ };
2029
+ };
2030
+ /**
2031
+ * Get user details
2032
+ * @description Retrieves details for a specific user
2033
+ */
2034
+ get: {
2035
+ parameters: {
2036
+ path: {
2037
+ id: string;
2038
+ };
2039
+ };
2040
+ responses: {
2041
+ /** @description User details */
2042
+ 200: {
2043
+ content: {
2044
+ 'application/json': components['schemas']['UserProfile'];
2045
+ };
2046
+ };
2047
+ /** @description Unauthorized */
2048
+ 401: {
2049
+ content: {
2050
+ 'application/json': components['schemas']['ErrorResponse'];
2051
+ };
2052
+ };
2053
+ /** @description User not found */
2054
+ 404: {
2055
+ content: {
2056
+ 'application/json': components['schemas']['ErrorResponse'];
2057
+ };
2058
+ };
2059
+ };
2060
+ };
2061
+ /**
2062
+ * Update user
2063
+ * @description Updates an existing user
2064
+ */
2065
+ put: {
2066
+ parameters: {
2067
+ path: {
2068
+ id: string;
2069
+ };
2070
+ };
2071
+ requestBody: {
2072
+ content: {
2073
+ 'application/json': components['schemas']['UpdateUser'];
2074
+ };
2075
+ };
2076
+ responses: {
2077
+ /** @description User updated */
2078
+ 200: {
2079
+ content: {
2080
+ 'application/json': components['schemas']['UserProfile'];
2081
+ };
2082
+ };
2083
+ /** @description Invalid request */
2084
+ 400: {
2085
+ content: {
2086
+ 'application/json': components['schemas']['ErrorResponse'];
2087
+ };
2088
+ };
2089
+ /** @description Unauthorized */
2090
+ 401: {
2091
+ content: {
2092
+ 'application/json': components['schemas']['ErrorResponse'];
2093
+ };
2094
+ };
2095
+ /** @description Forbidden */
2096
+ 403: {
2097
+ content: {
2098
+ 'application/json': components['schemas']['ErrorResponse'];
2099
+ };
2100
+ };
2101
+ };
2102
+ };
2103
+ };
2113
2104
  }
2114
2105
 
2115
- export type $defs = Record<string, never>
2106
+ export type webhooks = Record<string, never>;
2107
+
2108
+ type OneOf<T extends any[]> = T extends [infer Only]
2109
+ ? Only
2110
+ : T extends [infer A, infer B, ...infer Rest]
2111
+ ? OneOf<[XOR<A, B>, ...Rest]>
2112
+ : never;
2116
2113
 
2117
- export type external = Record<string, never>
2114
+ /** OneOf type helpers */
2115
+ type Without<T, U> = { [P in Exclude<keyof T, keyof U>]?: never };
2118
2116
 
2119
- export type operations = Record<string, never>
2117
+ type XOR<T, U> = T | U extends object ? (T & Without<U, T>) | (U & Without<T, U>) : T | U;