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.
- package/.github/workflows/publish.yml +6 -6
- package/.github/workflows/test.yml +1 -1
- package/.prettierrc +5 -3
- package/dist/index.js +24 -25
- package/dist/package.json +7 -3
- package/dist/src/agents/app.js +8 -8
- package/dist/src/agents/backend.js +3 -3
- package/dist/src/agents/devops.js +8 -8
- package/dist/src/agents/frontend.js +3 -3
- package/dist/src/agents/fullstack.js +3 -3
- package/dist/src/agents/index.js +18 -18
- package/dist/src/agents/quality.js +8 -8
- package/dist/src/agents/security.js +8 -8
- package/dist/src/client.js +115 -127
- package/dist/src/commands/api-keys.js +181 -202
- package/dist/src/commands/auth.js +16 -25
- package/dist/src/commands/autocomplete.js +8 -8
- package/dist/src/commands/billing.js +10 -19
- package/dist/src/commands/chat.js +139 -170
- package/dist/src/commands/clusters.js +21 -30
- package/dist/src/commands/code/__tests__/auth-sync.test.js +189 -186
- package/dist/src/commands/code/__tests__/fake-api-key-service.js +3 -13
- package/dist/src/commands/code/__tests__/fake-auth-service.js +21 -29
- package/dist/src/commands/code/__tests__/fake-command-runner.js +22 -33
- package/dist/src/commands/code/__tests__/fake-file-store.js +19 -41
- package/dist/src/commands/code/__tests__/fake-prompter.js +81 -97
- package/dist/src/commands/code/__tests__/setup-flow.test.js +295 -295
- package/dist/src/commands/code/adapters/clack-prompter.js +15 -32
- package/dist/src/commands/code/adapters/fs-file-store.js +25 -44
- package/dist/src/commands/code/adapters/spawn-command-runner.js +27 -41
- package/dist/src/commands/code/auth-sync.js +215 -228
- package/dist/src/commands/code/errors.js +15 -12
- package/dist/src/commands/code/setup.js +390 -425
- package/dist/src/commands/code.js +279 -294
- package/dist/src/commands/index.js +5 -5
- package/dist/src/commands/models.js +16 -25
- package/dist/src/commands/users.js +9 -18
- package/dist/src/constants/command-structure.js +138 -138
- package/dist/src/services/api-key-service.js +132 -152
- package/dist/src/services/auth-service.js +81 -95
- package/dist/src/services/browser-auth.js +121 -131
- package/dist/src/services/chat-service.js +369 -386
- package/dist/src/services/cluster-service.js +47 -62
- package/dist/src/services/collaborator-service.js +9 -21
- package/dist/src/services/flux-service.js +13 -25
- package/dist/src/services/helm-service.js +9 -21
- package/dist/src/services/kubectl-service.js +15 -29
- package/dist/src/utils/config-checker.js +8 -8
- package/dist/src/utils/config-loader.js +109 -109
- package/dist/src/utils/default-api-key.js +129 -139
- package/dist/src/utils/env-manager.js +55 -66
- package/dist/src/utils/error-handler.js +62 -62
- package/dist/src/utils/logger.js +74 -67
- package/dist/src/utils/markdown-renderer.js +28 -28
- package/dist/src/utils/opencode-validator.js +67 -69
- package/dist/src/utils/token-manager.js +67 -65
- package/dist/tests/commands/chat.test.js +30 -39
- package/dist/tests/commands/code.test.js +186 -195
- package/dist/tests/utils/config-loader.test.js +107 -107
- package/dist/tests/utils/env-manager.test.js +81 -90
- package/dist/tests/utils/opencode-validator.test.js +42 -41
- package/dist/vitest.config.js +1 -1
- package/eslint.config.mjs +65 -30
- package/index.ts +30 -31
- package/package.json +7 -3
- package/src/agents/app.ts +9 -9
- package/src/agents/backend.ts +4 -4
- package/src/agents/devops.ts +9 -9
- package/src/agents/frontend.ts +4 -4
- package/src/agents/fullstack.ts +4 -4
- package/src/agents/index.ts +27 -25
- package/src/agents/quality.ts +9 -9
- package/src/agents/security.ts +9 -9
- package/src/agents/types.ts +10 -10
- package/src/client.ts +85 -77
- package/src/commands/api-keys.ts +180 -185
- package/src/commands/auth.ts +15 -14
- package/src/commands/autocomplete.ts +10 -10
- package/src/commands/billing.ts +13 -12
- package/src/commands/chat.ts +145 -142
- package/src/commands/clusters.ts +20 -19
- package/src/commands/code/__tests__/auth-sync.test.ts +176 -175
- package/src/commands/code/__tests__/fake-api-key-service.ts +2 -2
- package/src/commands/code/__tests__/fake-auth-service.ts +18 -18
- package/src/commands/code/__tests__/fake-command-runner.ts +28 -22
- package/src/commands/code/__tests__/fake-file-store.ts +15 -15
- package/src/commands/code/__tests__/fake-prompter.ts +86 -85
- package/src/commands/code/__tests__/setup-flow.test.ts +253 -251
- package/src/commands/code/adapters/clack-prompter.ts +32 -30
- package/src/commands/code/adapters/fs-file-store.ts +18 -17
- package/src/commands/code/adapters/spawn-command-runner.ts +20 -15
- package/src/commands/code/auth-sync.ts +210 -210
- package/src/commands/code/errors.ts +11 -11
- package/src/commands/code/ports/auth-services.ts +7 -7
- package/src/commands/code/ports/command-runner.ts +2 -2
- package/src/commands/code/ports/file-store.ts +3 -3
- package/src/commands/code/ports/prompter.ts +13 -13
- package/src/commands/code/setup.ts +408 -406
- package/src/commands/code.ts +288 -287
- package/src/commands/index.ts +11 -10
- package/src/commands/models.ts +19 -18
- package/src/commands/users.ts +11 -10
- package/src/constants/command-structure.ts +159 -159
- package/src/services/api-key-service.ts +85 -85
- package/src/services/auth-service.ts +55 -54
- package/src/services/browser-auth.ts +62 -62
- package/src/services/chat-service.ts +170 -171
- package/src/services/cluster-service.ts +28 -28
- package/src/services/collaborator-service.ts +6 -6
- package/src/services/flux-service.ts +17 -17
- package/src/services/helm-service.ts +11 -11
- package/src/services/kubectl-service.ts +12 -12
- package/src/types/api.d.ts +1933 -1933
- package/src/types/json.d.ts +1 -1
- package/src/utils/config-checker.ts +7 -7
- package/src/utils/config-loader.ts +130 -129
- package/src/utils/default-api-key.ts +81 -80
- package/src/utils/env-manager.ts +37 -37
- package/src/utils/error-handler.ts +64 -64
- package/src/utils/logger.ts +72 -66
- package/src/utils/markdown-renderer.ts +28 -28
- package/src/utils/opencode-validator.ts +72 -71
- package/src/utils/token-manager.ts +69 -68
- package/tests/commands/chat.test.ts +32 -31
- package/tests/commands/code.test.ts +182 -181
- package/tests/utils/config-loader.test.ts +111 -110
- package/tests/utils/env-manager.test.ts +83 -79
- package/tests/utils/opencode-validator.test.ts +43 -42
- package/tsconfig.json +2 -1
- package/vitest.config.ts +2 -2
package/src/types/api.d.ts
CHANGED
|
@@ -3,2115 +3,2115 @@
|
|
|
3
3
|
* Do not make direct changes to the file.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
:
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
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
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
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
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
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
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
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
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
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
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
/** @description
|
|
213
|
-
|
|
214
|
-
|
|
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
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
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
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
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
|
-
|
|
435
|
-
/** @description
|
|
436
|
-
|
|
437
|
-
|
|
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
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
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
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
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
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
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
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
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
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
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
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
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
|
-
|
|
607
|
-
|
|
608
|
-
|
|
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
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
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
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
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
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
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
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
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
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
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
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
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
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
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
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
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
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
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
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
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
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
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
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
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
|
-
|
|
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
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
/** @
|
|
941
|
-
|
|
942
|
-
|
|
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
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
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
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
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
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
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
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
/** @description
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
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
|
-
|
|
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
|
-
*
|
|
1044
|
-
* @description
|
|
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
|
|
969
|
+
/** @description List of API keys */
|
|
1054
970
|
200: {
|
|
1055
971
|
content: {
|
|
1056
|
-
|
|
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
|
|
1066
|
-
|
|
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
|
-
*
|
|
1075
|
-
* @description
|
|
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
|
-
|
|
1078
|
-
parameters: {
|
|
1079
|
-
path: {
|
|
1080
|
-
id: string;
|
|
1081
|
-
};
|
|
1082
|
-
};
|
|
1000
|
+
post: {
|
|
1083
1001
|
requestBody: {
|
|
1084
1002
|
content: {
|
|
1085
|
-
|
|
1003
|
+
'application/json': components['schemas']['CreateApiKey'];
|
|
1086
1004
|
};
|
|
1087
1005
|
};
|
|
1088
1006
|
responses: {
|
|
1089
|
-
/** @description
|
|
1090
|
-
|
|
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
|
-
|
|
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
|
|
1108
|
-
|
|
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
|
|
1117
|
-
* @description
|
|
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
|
|
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
|
|
1137
|
-
|
|
1138
|
-
content:
|
|
1139
|
-
|
|
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
|
-
|
|
1056
|
+
'/v1/api-keys/{id}/rotate': {
|
|
1146
1057
|
/**
|
|
1147
|
-
*
|
|
1148
|
-
* @description
|
|
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
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1076
|
+
put: {
|
|
1077
|
+
parameters: {
|
|
1078
|
+
path: {
|
|
1079
|
+
/** @description API key ID */
|
|
1080
|
+
id: string;
|
|
1154
1081
|
};
|
|
1155
1082
|
};
|
|
1156
1083
|
responses: {
|
|
1157
|
-
/** @description
|
|
1084
|
+
/** @description API key rotated successfully */
|
|
1158
1085
|
200: {
|
|
1159
|
-
content:
|
|
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
|
|
1166
|
-
|
|
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
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
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
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
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
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
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
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
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
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1455
|
-
|
|
1456
|
-
|
|
1457
|
-
|
|
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
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
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
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
/** @description
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
/** @description
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
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
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1602
|
-
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
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
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
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
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
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
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
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
|
-
|
|
1675
|
-
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
|
|
1681
|
-
|
|
1682
|
-
|
|
1683
|
-
|
|
1684
|
-
|
|
1685
|
-
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
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
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
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
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
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
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
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
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
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
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
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
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
|
|
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
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
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
|
-
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1791
|
-
|
|
1792
|
-
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
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
|
-
/**
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
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
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
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
|
-
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
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
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
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
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
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
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
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
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
/** @description
|
|
1878
|
-
|
|
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
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
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
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
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
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1926
|
-
|
|
1927
|
-
|
|
1928
|
-
|
|
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
|
-
|
|
1959
|
-
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
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
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
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
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
|
|
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
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
/** @description
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
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
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
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
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
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
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
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
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
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
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
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
|
|
2106
|
+
export type webhooks = Record<string, never>;
|
|
2114
2107
|
|
|
2115
|
-
|
|
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
|
-
|
|
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;
|