berget 2.2.7 → 2.2.9

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