@gpuai/sdk 0.5.4 → 0.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (202) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/EndpointsApi.d.ts +150 -0
  4. package/dist/apis/EndpointsApi.js +379 -0
  5. package/dist/apis/InstancesApi.d.ts +15 -0
  6. package/dist/apis/InstancesApi.js +45 -0
  7. package/dist/apis/JobsApi.d.ts +172 -0
  8. package/dist/apis/JobsApi.js +444 -0
  9. package/dist/apis/OperationsApi.d.ts +17 -0
  10. package/dist/apis/OperationsApi.js +48 -0
  11. package/dist/apis/SecretsApi.d.ts +123 -0
  12. package/dist/apis/SecretsApi.js +328 -0
  13. package/dist/apis/index.d.ts +3 -0
  14. package/dist/apis/index.js +3 -0
  15. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  16. package/dist/esm/apis/EndpointsApi.js +375 -0
  17. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  18. package/dist/esm/apis/InstancesApi.js +45 -0
  19. package/dist/esm/apis/JobsApi.d.ts +172 -0
  20. package/dist/esm/apis/JobsApi.js +440 -0
  21. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  22. package/dist/esm/apis/OperationsApi.js +48 -0
  23. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  24. package/dist/esm/apis/SecretsApi.js +324 -0
  25. package/dist/esm/apis/index.d.ts +3 -0
  26. package/dist/esm/apis/index.js +3 -0
  27. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  28. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  29. package/dist/esm/models/Endpoint.d.ts +147 -0
  30. package/dist/esm/models/Endpoint.js +121 -0
  31. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  32. package/dist/esm/models/EndpointCreate.js +63 -0
  33. package/dist/esm/models/EndpointList.d.ts +33 -0
  34. package/dist/esm/models/EndpointList.js +44 -0
  35. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  36. package/dist/esm/models/EndpointMachine.js +84 -0
  37. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  38. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  39. package/dist/esm/models/Job.d.ts +352 -0
  40. package/dist/esm/models/Job.js +254 -0
  41. package/dist/esm/models/JobAttempt.d.ts +176 -0
  42. package/dist/esm/models/JobAttempt.js +147 -0
  43. package/dist/esm/models/JobCreate.d.ts +153 -0
  44. package/dist/esm/models/JobCreate.js +84 -0
  45. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  46. package/dist/esm/models/JobGpuTypes.js +48 -0
  47. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  48. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  49. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  50. package/dist/esm/models/JobLogChunk.js +55 -0
  51. package/dist/esm/models/JobLogs.d.ts +39 -0
  52. package/dist/esm/models/JobLogs.js +48 -0
  53. package/dist/esm/models/JobPage.d.ts +39 -0
  54. package/dist/esm/models/JobPage.js +48 -0
  55. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  56. package/dist/esm/models/JobSharingHint.js +51 -0
  57. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  58. package/dist/esm/models/JobTelemetry.js +56 -0
  59. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  60. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  61. package/dist/esm/models/JobTrial.d.ts +79 -0
  62. package/dist/esm/models/JobTrial.js +73 -0
  63. package/dist/esm/models/Operation.d.ts +6 -0
  64. package/dist/esm/models/Operation.js +2 -0
  65. package/dist/esm/models/Secret.d.ts +62 -0
  66. package/dist/esm/models/Secret.js +63 -0
  67. package/dist/esm/models/SecretCreate.d.ts +44 -0
  68. package/dist/esm/models/SecretCreate.js +49 -0
  69. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  70. package/dist/esm/models/SecretImportItem.js +47 -0
  71. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  72. package/dist/esm/models/SecretImportRequest.js +46 -0
  73. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  74. package/dist/esm/models/SecretImportResult.js +51 -0
  75. package/dist/esm/models/SecretList.d.ts +33 -0
  76. package/dist/esm/models/SecretList.js +44 -0
  77. package/dist/esm/models/SecretPut.d.ts +38 -0
  78. package/dist/esm/models/SecretPut.js +45 -0
  79. package/dist/esm/models/index.d.ts +25 -0
  80. package/dist/esm/models/index.js +25 -0
  81. package/dist/esm/runtime.js +1 -1
  82. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  83. package/dist/models/DedicatedIPOffer.js +94 -0
  84. package/dist/models/Endpoint.d.ts +147 -0
  85. package/dist/models/Endpoint.js +129 -0
  86. package/dist/models/EndpointCreate.d.ts +80 -0
  87. package/dist/models/EndpointCreate.js +70 -0
  88. package/dist/models/EndpointList.d.ts +33 -0
  89. package/dist/models/EndpointList.js +51 -0
  90. package/dist/models/EndpointMachine.d.ts +90 -0
  91. package/dist/models/EndpointMachine.js +92 -0
  92. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  93. package/dist/models/EndpointReplicaCounts.js +54 -0
  94. package/dist/models/Job.d.ts +352 -0
  95. package/dist/models/Job.js +262 -0
  96. package/dist/models/JobAttempt.d.ts +176 -0
  97. package/dist/models/JobAttempt.js +155 -0
  98. package/dist/models/JobCreate.d.ts +153 -0
  99. package/dist/models/JobCreate.js +92 -0
  100. package/dist/models/JobGpuTypes.d.ts +39 -0
  101. package/dist/models/JobGpuTypes.js +55 -0
  102. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  103. package/dist/models/JobGpuTypesDataInner.js +66 -0
  104. package/dist/models/JobLogChunk.d.ts +50 -0
  105. package/dist/models/JobLogChunk.js +62 -0
  106. package/dist/models/JobLogs.d.ts +39 -0
  107. package/dist/models/JobLogs.js +55 -0
  108. package/dist/models/JobPage.d.ts +39 -0
  109. package/dist/models/JobPage.js +55 -0
  110. package/dist/models/JobSharingHint.d.ts +46 -0
  111. package/dist/models/JobSharingHint.js +58 -0
  112. package/dist/models/JobTelemetry.d.ts +51 -0
  113. package/dist/models/JobTelemetry.js +63 -0
  114. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  115. package/dist/models/JobTelemetryPoint.js +66 -0
  116. package/dist/models/JobTrial.d.ts +79 -0
  117. package/dist/models/JobTrial.js +81 -0
  118. package/dist/models/Operation.d.ts +6 -0
  119. package/dist/models/Operation.js +2 -0
  120. package/dist/models/Secret.d.ts +62 -0
  121. package/dist/models/Secret.js +70 -0
  122. package/dist/models/SecretCreate.d.ts +44 -0
  123. package/dist/models/SecretCreate.js +56 -0
  124. package/dist/models/SecretImportItem.d.ts +38 -0
  125. package/dist/models/SecretImportItem.js +54 -0
  126. package/dist/models/SecretImportRequest.d.ts +39 -0
  127. package/dist/models/SecretImportRequest.js +53 -0
  128. package/dist/models/SecretImportResult.d.ts +44 -0
  129. package/dist/models/SecretImportResult.js +58 -0
  130. package/dist/models/SecretList.d.ts +33 -0
  131. package/dist/models/SecretList.js +51 -0
  132. package/dist/models/SecretPut.d.ts +38 -0
  133. package/dist/models/SecretPut.js +52 -0
  134. package/dist/models/index.d.ts +25 -0
  135. package/dist/models/index.js +25 -0
  136. package/dist/runtime.js +1 -1
  137. package/docs/DedicatedIPOffer.md +56 -0
  138. package/docs/Endpoint.md +68 -0
  139. package/docs/EndpointCreate.md +50 -0
  140. package/docs/EndpointList.md +34 -0
  141. package/docs/EndpointMachine.md +50 -0
  142. package/docs/EndpointReplicaCounts.md +36 -0
  143. package/docs/EndpointsApi.md +544 -0
  144. package/docs/InstancesApi.md +68 -1
  145. package/docs/Job.md +125 -0
  146. package/docs/JobAttempt.md +69 -0
  147. package/docs/JobCreate.md +66 -0
  148. package/docs/JobGpuTypes.md +36 -0
  149. package/docs/JobGpuTypesDataInner.md +42 -0
  150. package/docs/JobLogChunk.md +40 -0
  151. package/docs/JobLogs.md +36 -0
  152. package/docs/JobPage.md +36 -0
  153. package/docs/JobSharingHint.md +39 -0
  154. package/docs/JobTelemetry.md +40 -0
  155. package/docs/JobTelemetryPoint.md +42 -0
  156. package/docs/JobTrial.md +46 -0
  157. package/docs/JobsApi.md +609 -0
  158. package/docs/Operation.md +2 -0
  159. package/docs/OperationsApi.md +76 -0
  160. package/docs/Secret.md +45 -0
  161. package/docs/SecretCreate.md +38 -0
  162. package/docs/SecretImportItem.md +36 -0
  163. package/docs/SecretImportRequest.md +36 -0
  164. package/docs/SecretImportResult.md +38 -0
  165. package/docs/SecretList.md +34 -0
  166. package/docs/SecretPut.md +36 -0
  167. package/docs/SecretsApi.md +450 -0
  168. package/package.json +1 -1
  169. package/src/apis/EndpointsApi.ts +481 -0
  170. package/src/apis/InstancesApi.ts +52 -0
  171. package/src/apis/JobsApi.ts +551 -0
  172. package/src/apis/OperationsApi.ts +59 -0
  173. package/src/apis/SecretsApi.ts +413 -0
  174. package/src/apis/index.ts +3 -0
  175. package/src/models/DedicatedIPOffer.ts +165 -0
  176. package/src/models/Endpoint.ts +247 -0
  177. package/src/models/EndpointCreate.ts +132 -0
  178. package/src/models/EndpointList.ts +74 -0
  179. package/src/models/EndpointMachine.ts +151 -0
  180. package/src/models/EndpointReplicaCounts.ts +75 -0
  181. package/src/models/Job.ts +538 -0
  182. package/src/models/JobAttempt.ts +267 -0
  183. package/src/models/JobCreate.ts +221 -0
  184. package/src/models/JobGpuTypes.ts +83 -0
  185. package/src/models/JobGpuTypesDataInner.ts +104 -0
  186. package/src/models/JobLogChunk.ts +93 -0
  187. package/src/models/JobLogs.ts +83 -0
  188. package/src/models/JobPage.ts +83 -0
  189. package/src/models/JobSharingHint.ts +86 -0
  190. package/src/models/JobTelemetry.ts +101 -0
  191. package/src/models/JobTelemetryPoint.ts +102 -0
  192. package/src/models/JobTrial.ts +132 -0
  193. package/src/models/Operation.ts +8 -0
  194. package/src/models/Secret.ts +111 -0
  195. package/src/models/SecretCreate.ts +83 -0
  196. package/src/models/SecretImportItem.ts +75 -0
  197. package/src/models/SecretImportRequest.ts +82 -0
  198. package/src/models/SecretImportResult.ts +84 -0
  199. package/src/models/SecretList.ts +74 -0
  200. package/src/models/SecretPut.ts +74 -0
  201. package/src/models/index.ts +25 -0
  202. package/src/runtime.ts +1 -1
@@ -0,0 +1,328 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
16
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
17
+ return new (P || (P = Promise))(function (resolve, reject) {
18
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
19
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
20
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
21
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
22
+ });
23
+ };
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.SecretsApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const Secret_1 = require("../models/Secret");
28
+ const SecretCreate_1 = require("../models/SecretCreate");
29
+ const SecretImportRequest_1 = require("../models/SecretImportRequest");
30
+ const SecretImportResult_1 = require("../models/SecretImportResult");
31
+ const SecretList_1 = require("../models/SecretList");
32
+ const SecretPut_1 = require("../models/SecretPut");
33
+ /**
34
+ *
35
+ */
36
+ class SecretsApi extends runtime.BaseAPI {
37
+ /**
38
+ * Creates request options for createSecret without sending the request
39
+ */
40
+ createSecretRequestOpts(requestParameters) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ if (requestParameters['secretCreate'] == null) {
43
+ throw new runtime.RequiredError('secretCreate', 'Required parameter "secretCreate" was null or undefined when calling createSecret().');
44
+ }
45
+ const queryParameters = {};
46
+ const headerParameters = {};
47
+ headerParameters['Content-Type'] = 'application/json';
48
+ if (this.configuration && this.configuration.accessToken) {
49
+ const token = this.configuration.accessToken;
50
+ const tokenString = yield token("bearerAuth", []);
51
+ if (tokenString) {
52
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
53
+ }
54
+ }
55
+ let urlPath = `/secrets`;
56
+ return {
57
+ path: urlPath,
58
+ method: 'POST',
59
+ headers: headerParameters,
60
+ query: queryParameters,
61
+ body: (0, SecretCreate_1.SecretCreateToJSON)(requestParameters['secretCreate']),
62
+ };
63
+ });
64
+ }
65
+ /**
66
+ * Stores a new secret. The value crosses the wire on create, update and import only, is envelope encrypted at rest, and is never returned. The name is the environment variable the value is delivered as: a letter or underscore, then letters, digits and underscores, 128 characters at most; names starting with GPUAI_ and names the machine itself needs (PATH, HOME, LD_PRELOAD and similar) are refused. Values are at most 32 KB. Returns 409 `name_taken` when the name exists (use PUT to replace a value) and 422 `validation_failed` for a bad name or value. Every create, update, delete and use is recorded in the organization\'s audit log, without the value. Requires the `instances:write` scope.
67
+ * Create a secret
68
+ */
69
+ createSecretRaw(requestParameters, initOverrides) {
70
+ return __awaiter(this, void 0, void 0, function* () {
71
+ const requestOptions = yield this.createSecretRequestOpts(requestParameters);
72
+ const response = yield this.request(requestOptions, initOverrides);
73
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Secret_1.SecretFromJSON)(jsonValue));
74
+ });
75
+ }
76
+ /**
77
+ * Stores a new secret. The value crosses the wire on create, update and import only, is envelope encrypted at rest, and is never returned. The name is the environment variable the value is delivered as: a letter or underscore, then letters, digits and underscores, 128 characters at most; names starting with GPUAI_ and names the machine itself needs (PATH, HOME, LD_PRELOAD and similar) are refused. Values are at most 32 KB. Returns 409 `name_taken` when the name exists (use PUT to replace a value) and 422 `validation_failed` for a bad name or value. Every create, update, delete and use is recorded in the organization\'s audit log, without the value. Requires the `instances:write` scope.
78
+ * Create a secret
79
+ */
80
+ createSecret(requestParameters, initOverrides) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const response = yield this.createSecretRaw(requestParameters, initOverrides);
83
+ return yield response.value();
84
+ });
85
+ }
86
+ /**
87
+ * Creates request options for deleteSecret without sending the request
88
+ */
89
+ deleteSecretRequestOpts(requestParameters) {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ if (requestParameters['name'] == null) {
92
+ throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling deleteSecret().');
93
+ }
94
+ const queryParameters = {};
95
+ const headerParameters = {};
96
+ if (this.configuration && this.configuration.accessToken) {
97
+ const token = this.configuration.accessToken;
98
+ const tokenString = yield token("bearerAuth", []);
99
+ if (tokenString) {
100
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
101
+ }
102
+ }
103
+ let urlPath = `/secrets/{name}`;
104
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
105
+ return {
106
+ path: urlPath,
107
+ method: 'DELETE',
108
+ headers: headerParameters,
109
+ query: queryParameters,
110
+ };
111
+ });
112
+ }
113
+ /**
114
+ * Deletes the secret. Machines already running keep the value they were given; nothing started later can receive it, and a function version or job that still names it fails its next run. Requires the `instances:write` scope.
115
+ * Delete a secret
116
+ */
117
+ deleteSecretRaw(requestParameters, initOverrides) {
118
+ return __awaiter(this, void 0, void 0, function* () {
119
+ const requestOptions = yield this.deleteSecretRequestOpts(requestParameters);
120
+ const response = yield this.request(requestOptions, initOverrides);
121
+ return new runtime.VoidApiResponse(response);
122
+ });
123
+ }
124
+ /**
125
+ * Deletes the secret. Machines already running keep the value they were given; nothing started later can receive it, and a function version or job that still names it fails its next run. Requires the `instances:write` scope.
126
+ * Delete a secret
127
+ */
128
+ deleteSecret(requestParameters, initOverrides) {
129
+ return __awaiter(this, void 0, void 0, function* () {
130
+ yield this.deleteSecretRaw(requestParameters, initOverrides);
131
+ });
132
+ }
133
+ /**
134
+ * Creates request options for getSecret without sending the request
135
+ */
136
+ getSecretRequestOpts(requestParameters) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ if (requestParameters['name'] == null) {
139
+ throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling getSecret().');
140
+ }
141
+ const queryParameters = {};
142
+ const headerParameters = {};
143
+ if (this.configuration && this.configuration.accessToken) {
144
+ const token = this.configuration.accessToken;
145
+ const tokenString = yield token("bearerAuth", []);
146
+ if (tokenString) {
147
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
148
+ }
149
+ }
150
+ let urlPath = `/secrets/{name}`;
151
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
152
+ return {
153
+ path: urlPath,
154
+ method: 'GET',
155
+ headers: headerParameters,
156
+ query: queryParameters,
157
+ };
158
+ });
159
+ }
160
+ /**
161
+ * Returns one secret\'s metadata. The value is never returned. Requires the `instances:read` scope. 404 `not_found` when the organization has no secret with this name.
162
+ * Get a secret\'s metadata
163
+ */
164
+ getSecretRaw(requestParameters, initOverrides) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ const requestOptions = yield this.getSecretRequestOpts(requestParameters);
167
+ const response = yield this.request(requestOptions, initOverrides);
168
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Secret_1.SecretFromJSON)(jsonValue));
169
+ });
170
+ }
171
+ /**
172
+ * Returns one secret\'s metadata. The value is never returned. Requires the `instances:read` scope. 404 `not_found` when the organization has no secret with this name.
173
+ * Get a secret\'s metadata
174
+ */
175
+ getSecret(requestParameters, initOverrides) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ const response = yield this.getSecretRaw(requestParameters, initOverrides);
178
+ return yield response.value();
179
+ });
180
+ }
181
+ /**
182
+ * Creates request options for importSecrets without sending the request
183
+ */
184
+ importSecretsRequestOpts(requestParameters) {
185
+ return __awaiter(this, void 0, void 0, function* () {
186
+ if (requestParameters['secretImportRequest'] == null) {
187
+ throw new runtime.RequiredError('secretImportRequest', 'Required parameter "secretImportRequest" was null or undefined when calling importSecrets().');
188
+ }
189
+ const queryParameters = {};
190
+ const headerParameters = {};
191
+ headerParameters['Content-Type'] = 'application/json';
192
+ if (this.configuration && this.configuration.accessToken) {
193
+ const token = this.configuration.accessToken;
194
+ const tokenString = yield token("bearerAuth", []);
195
+ if (tokenString) {
196
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
197
+ }
198
+ }
199
+ let urlPath = `/secrets/import`;
200
+ return {
201
+ path: urlPath,
202
+ method: 'POST',
203
+ headers: headerParameters,
204
+ query: queryParameters,
205
+ body: (0, SecretImportRequest_1.SecretImportRequestToJSON)(requestParameters['secretImportRequest']),
206
+ };
207
+ });
208
+ }
209
+ /**
210
+ * Creates or updates many secrets at once, for example the output of `infisical export` or a .env file parsed by the client (the `gpu secrets import` command parses dotenv and Infisical JSON locally and sends this request). Every item is validated before any is written. With `overwrite` false, existing secrets are left untouched and listed under `skipped`. At most 200 items. Requires the `instances:write` scope.
211
+ * Import secrets
212
+ */
213
+ importSecretsRaw(requestParameters, initOverrides) {
214
+ return __awaiter(this, void 0, void 0, function* () {
215
+ const requestOptions = yield this.importSecretsRequestOpts(requestParameters);
216
+ const response = yield this.request(requestOptions, initOverrides);
217
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SecretImportResult_1.SecretImportResultFromJSON)(jsonValue));
218
+ });
219
+ }
220
+ /**
221
+ * Creates or updates many secrets at once, for example the output of `infisical export` or a .env file parsed by the client (the `gpu secrets import` command parses dotenv and Infisical JSON locally and sends this request). Every item is validated before any is written. With `overwrite` false, existing secrets are left untouched and listed under `skipped`. At most 200 items. Requires the `instances:write` scope.
222
+ * Import secrets
223
+ */
224
+ importSecrets(requestParameters, initOverrides) {
225
+ return __awaiter(this, void 0, void 0, function* () {
226
+ const response = yield this.importSecretsRaw(requestParameters, initOverrides);
227
+ return yield response.value();
228
+ });
229
+ }
230
+ /**
231
+ * Creates request options for listSecrets without sending the request
232
+ */
233
+ listSecretsRequestOpts() {
234
+ return __awaiter(this, void 0, void 0, function* () {
235
+ const queryParameters = {};
236
+ const headerParameters = {};
237
+ if (this.configuration && this.configuration.accessToken) {
238
+ const token = this.configuration.accessToken;
239
+ const tokenString = yield token("bearerAuth", []);
240
+ if (tokenString) {
241
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
242
+ }
243
+ }
244
+ let urlPath = `/secrets`;
245
+ return {
246
+ path: urlPath,
247
+ method: 'GET',
248
+ headers: headerParameters,
249
+ query: queryParameters,
250
+ };
251
+ });
252
+ }
253
+ /**
254
+ * Lists the organization\'s secrets by name with their metadata. Values are never returned by any read. Requires the `instances:read` scope. Returns 503 `secrets_unavailable` when secrets are switched on but no encryption key is configured, and 404 when the feature is off.
255
+ * List secrets
256
+ */
257
+ listSecretsRaw(initOverrides) {
258
+ return __awaiter(this, void 0, void 0, function* () {
259
+ const requestOptions = yield this.listSecretsRequestOpts();
260
+ const response = yield this.request(requestOptions, initOverrides);
261
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, SecretList_1.SecretListFromJSON)(jsonValue));
262
+ });
263
+ }
264
+ /**
265
+ * Lists the organization\'s secrets by name with their metadata. Values are never returned by any read. Requires the `instances:read` scope. Returns 503 `secrets_unavailable` when secrets are switched on but no encryption key is configured, and 404 when the feature is off.
266
+ * List secrets
267
+ */
268
+ listSecrets(initOverrides) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ const response = yield this.listSecretsRaw(initOverrides);
271
+ return yield response.value();
272
+ });
273
+ }
274
+ /**
275
+ * Creates request options for putSecret without sending the request
276
+ */
277
+ putSecretRequestOpts(requestParameters) {
278
+ return __awaiter(this, void 0, void 0, function* () {
279
+ if (requestParameters['name'] == null) {
280
+ throw new runtime.RequiredError('name', 'Required parameter "name" was null or undefined when calling putSecret().');
281
+ }
282
+ if (requestParameters['secretPut'] == null) {
283
+ throw new runtime.RequiredError('secretPut', 'Required parameter "secretPut" was null or undefined when calling putSecret().');
284
+ }
285
+ const queryParameters = {};
286
+ const headerParameters = {};
287
+ headerParameters['Content-Type'] = 'application/json';
288
+ if (this.configuration && this.configuration.accessToken) {
289
+ const token = this.configuration.accessToken;
290
+ const tokenString = yield token("bearerAuth", []);
291
+ if (tokenString) {
292
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
293
+ }
294
+ }
295
+ let urlPath = `/secrets/{name}`;
296
+ urlPath = urlPath.replace('{name}', encodeURIComponent(String(requestParameters['name'])));
297
+ return {
298
+ path: urlPath,
299
+ method: 'PUT',
300
+ headers: headerParameters,
301
+ query: queryParameters,
302
+ body: (0, SecretPut_1.SecretPutToJSON)(requestParameters['secretPut']),
303
+ };
304
+ });
305
+ }
306
+ /**
307
+ * Sets the secret\'s value, creating the secret when it does not exist (201) or replacing the value and bumping its version when it does (200). Omit `description` to keep the current one. Machines already running keep the value they were given; launches and calls from now on get the new one. Requires the `instances:write` scope.
308
+ * Create or replace a secret
309
+ */
310
+ putSecretRaw(requestParameters, initOverrides) {
311
+ return __awaiter(this, void 0, void 0, function* () {
312
+ const requestOptions = yield this.putSecretRequestOpts(requestParameters);
313
+ const response = yield this.request(requestOptions, initOverrides);
314
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Secret_1.SecretFromJSON)(jsonValue));
315
+ });
316
+ }
317
+ /**
318
+ * Sets the secret\'s value, creating the secret when it does not exist (201) or replacing the value and bumping its version when it does (200). Omit `description` to keep the current one. Machines already running keep the value they were given; launches and calls from now on get the new one. Requires the `instances:write` scope.
319
+ * Create or replace a secret
320
+ */
321
+ putSecret(requestParameters, initOverrides) {
322
+ return __awaiter(this, void 0, void 0, function* () {
323
+ const response = yield this.putSecretRaw(requestParameters, initOverrides);
324
+ return yield response.value();
325
+ });
326
+ }
327
+ }
328
+ exports.SecretsApi = SecretsApi;
@@ -1,17 +1,20 @@
1
1
  export * from './AutolaunchApi';
2
2
  export * from './BillingApi';
3
3
  export * from './CommunityApi';
4
+ export * from './EndpointsApi';
4
5
  export * from './EnvironmentsApi';
5
6
  export * from './FineTuningApi';
6
7
  export * from './FunctionsApi';
7
8
  export * from './GpuTypesApi';
8
9
  export * from './InferenceApi';
9
10
  export * from './InstancesApi';
11
+ export * from './JobsApi';
10
12
  export * from './MarketApi';
11
13
  export * from './MetaApi';
12
14
  export * from './OperationsApi';
13
15
  export * from './PricingApi';
14
16
  export * from './RegistryCredentialsApi';
17
+ export * from './SecretsApi';
15
18
  export * from './SshKeysApi';
16
19
  export * from './TemplatesApi';
17
20
  export * from './UsageApi';
@@ -19,17 +19,20 @@ Object.defineProperty(exports, "__esModule", { value: true });
19
19
  __exportStar(require("./AutolaunchApi"), exports);
20
20
  __exportStar(require("./BillingApi"), exports);
21
21
  __exportStar(require("./CommunityApi"), exports);
22
+ __exportStar(require("./EndpointsApi"), exports);
22
23
  __exportStar(require("./EnvironmentsApi"), exports);
23
24
  __exportStar(require("./FineTuningApi"), exports);
24
25
  __exportStar(require("./FunctionsApi"), exports);
25
26
  __exportStar(require("./GpuTypesApi"), exports);
26
27
  __exportStar(require("./InferenceApi"), exports);
27
28
  __exportStar(require("./InstancesApi"), exports);
29
+ __exportStar(require("./JobsApi"), exports);
28
30
  __exportStar(require("./MarketApi"), exports);
29
31
  __exportStar(require("./MetaApi"), exports);
30
32
  __exportStar(require("./OperationsApi"), exports);
31
33
  __exportStar(require("./PricingApi"), exports);
32
34
  __exportStar(require("./RegistryCredentialsApi"), exports);
35
+ __exportStar(require("./SecretsApi"), exports);
33
36
  __exportStar(require("./SshKeysApi"), exports);
34
37
  __exportStar(require("./TemplatesApi"), exports);
35
38
  __exportStar(require("./UsageApi"), exports);
@@ -0,0 +1,150 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import * as runtime from '../runtime';
13
+ import { type ChatCompletionRequest } from '../models/ChatCompletionRequest';
14
+ import { type ChatCompletionResponse } from '../models/ChatCompletionResponse';
15
+ import { type Endpoint } from '../models/Endpoint';
16
+ import { type EndpointCreate } from '../models/EndpointCreate';
17
+ import { type EndpointList } from '../models/EndpointList';
18
+ export interface CreateEndpointRequest {
19
+ endpointCreate: EndpointCreate;
20
+ }
21
+ export interface CreateEndpointChatCompletionRequest {
22
+ id: string;
23
+ chatCompletionRequest: ChatCompletionRequest;
24
+ }
25
+ export interface CreateEndpointCompletionRequest {
26
+ id: string;
27
+ requestBody: {
28
+ [key: string]: any | null;
29
+ };
30
+ }
31
+ export interface DeleteEndpointRequest {
32
+ id: string;
33
+ }
34
+ export interface GetEndpointRequest {
35
+ id: string;
36
+ }
37
+ export interface ListEndpointModelsRequest {
38
+ id: string;
39
+ }
40
+ /**
41
+ *
42
+ */
43
+ export declare class EndpointsApi extends runtime.BaseAPI {
44
+ /**
45
+ * Creates request options for createEndpoint without sending the request
46
+ */
47
+ createEndpointRequestOpts(requestParameters: CreateEndpointRequest): Promise<runtime.RequestOpts>;
48
+ /**
49
+ * Creates an OpenAI-compatible endpoint serving a Hugging Face model with vLLM on the chosen GPU type. Nothing starts until the first request arrives, unless `min_replicas` keeps machines warm. Each machine is billed for the time it exists, like an instance, through the same balance. For a gated model, store a Hugging Face token as a secret and name it in `hf_token_secret`; it reaches the machines as HF_TOKEN. Returns 422 `validation_failed` for a bad field, 409 `name_taken` for a duplicate name, and 409 `limit_reached` at the per-organization cap. Requires the `functions:write` scope.
50
+ * Create a model endpoint
51
+ */
52
+ createEndpointRaw(requestParameters: CreateEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Endpoint>>;
53
+ /**
54
+ * Creates an OpenAI-compatible endpoint serving a Hugging Face model with vLLM on the chosen GPU type. Nothing starts until the first request arrives, unless `min_replicas` keeps machines warm. Each machine is billed for the time it exists, like an instance, through the same balance. For a gated model, store a Hugging Face token as a secret and name it in `hf_token_secret`; it reaches the machines as HF_TOKEN. Returns 422 `validation_failed` for a bad field, 409 `name_taken` for a duplicate name, and 409 `limit_reached` at the per-organization cap. Requires the `functions:write` scope.
55
+ * Create a model endpoint
56
+ */
57
+ createEndpoint(requestParameters: CreateEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Endpoint>;
58
+ /**
59
+ * Creates request options for createEndpointChatCompletion without sending the request
60
+ */
61
+ createEndpointChatCompletionRequestOpts(requestParameters: CreateEndpointChatCompletionRequest): Promise<runtime.RequestOpts>;
62
+ /**
63
+ * The OpenAI chat completions route of one endpoint: point an OpenAI client\'s base_url at the endpoint\'s `url` and use a GPU.ai API key with the `functions:write` scope. The request\'s `model` is replaced with the endpoint\'s model, so any value works. Set `\"stream\": true` for Server-Sent Events, passed through as vLLM produces them. When no machine is ready the request waits while one starts (a cold start takes minutes: machine, image and model download); if none is ready in time the answer is 503 `endpoint_starting` with Retry-After. 402 `insufficient_quota` when the balance is empty. Errors use the OpenAI error envelope.
64
+ * Chat completion on a model endpoint (OpenAI-compatible)
65
+ */
66
+ createEndpointChatCompletionRaw(requestParameters: CreateEndpointChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>>;
67
+ /**
68
+ * The OpenAI chat completions route of one endpoint: point an OpenAI client\'s base_url at the endpoint\'s `url` and use a GPU.ai API key with the `functions:write` scope. The request\'s `model` is replaced with the endpoint\'s model, so any value works. Set `\"stream\": true` for Server-Sent Events, passed through as vLLM produces them. When no machine is ready the request waits while one starts (a cold start takes minutes: machine, image and model download); if none is ready in time the answer is 503 `endpoint_starting` with Retry-After. 402 `insufficient_quota` when the balance is empty. Errors use the OpenAI error envelope.
69
+ * Chat completion on a model endpoint (OpenAI-compatible)
70
+ */
71
+ createEndpointChatCompletion(requestParameters: CreateEndpointChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse>;
72
+ /**
73
+ * Creates request options for createEndpointCompletion without sending the request
74
+ */
75
+ createEndpointCompletionRequestOpts(requestParameters: CreateEndpointCompletionRequest): Promise<runtime.RequestOpts>;
76
+ /**
77
+ * The OpenAI completions route of one endpoint, with the same auth, model rewrite, streaming, cold start and error behavior as chat completions.
78
+ * Text completion on a model endpoint (OpenAI-compatible)
79
+ */
80
+ createEndpointCompletionRaw(requestParameters: CreateEndpointCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{
81
+ [key: string]: any;
82
+ }>>;
83
+ /**
84
+ * The OpenAI completions route of one endpoint, with the same auth, model rewrite, streaming, cold start and error behavior as chat completions.
85
+ * Text completion on a model endpoint (OpenAI-compatible)
86
+ */
87
+ createEndpointCompletion(requestParameters: CreateEndpointCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
88
+ [key: string]: any;
89
+ }>;
90
+ /**
91
+ * Creates request options for deleteEndpoint without sending the request
92
+ */
93
+ deleteEndpointRequestOpts(requestParameters: DeleteEndpointRequest): Promise<runtime.RequestOpts>;
94
+ /**
95
+ * Deletes the endpoint. Its machines are released within seconds and stop billing when terminated. Requires the `functions:write` scope.
96
+ * Delete a model endpoint
97
+ */
98
+ deleteEndpointRaw(requestParameters: DeleteEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
99
+ /**
100
+ * Deletes the endpoint. Its machines are released within seconds and stop billing when terminated. Requires the `functions:write` scope.
101
+ * Delete a model endpoint
102
+ */
103
+ deleteEndpoint(requestParameters: DeleteEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
104
+ /**
105
+ * Creates request options for getEndpoint without sending the request
106
+ */
107
+ getEndpointRequestOpts(requestParameters: GetEndpointRequest): Promise<runtime.RequestOpts>;
108
+ /**
109
+ * Returns one endpoint with its recent machines (newest first), each with its price, ready and terminated times, and why it was released. Requires the `functions:read` scope.
110
+ * Get a model endpoint
111
+ */
112
+ getEndpointRaw(requestParameters: GetEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Endpoint>>;
113
+ /**
114
+ * Returns one endpoint with its recent machines (newest first), each with its price, ready and terminated times, and why it was released. Requires the `functions:read` scope.
115
+ * Get a model endpoint
116
+ */
117
+ getEndpoint(requestParameters: GetEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Endpoint>;
118
+ /**
119
+ * Creates request options for listEndpointModels without sending the request
120
+ */
121
+ listEndpointModelsRequestOpts(requestParameters: ListEndpointModelsRequest): Promise<runtime.RequestOpts>;
122
+ /**
123
+ * The OpenAI models route of one endpoint: the one model it serves. Can trigger a cold start like any other request.
124
+ * List the model an endpoint serves (OpenAI-compatible)
125
+ */
126
+ listEndpointModelsRaw(requestParameters: ListEndpointModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{
127
+ [key: string]: any;
128
+ }>>;
129
+ /**
130
+ * The OpenAI models route of one endpoint: the one model it serves. Can trigger a cold start like any other request.
131
+ * List the model an endpoint serves (OpenAI-compatible)
132
+ */
133
+ listEndpointModels(requestParameters: ListEndpointModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{
134
+ [key: string]: any;
135
+ }>;
136
+ /**
137
+ * Creates request options for listEndpoints without sending the request
138
+ */
139
+ listEndpointsRequestOpts(): Promise<runtime.RequestOpts>;
140
+ /**
141
+ * Lists the organization\'s live model endpoints with their status, URL and machine counts. Requires the `functions:read` scope.
142
+ * List model endpoints
143
+ */
144
+ listEndpointsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EndpointList>>;
145
+ /**
146
+ * Lists the organization\'s live model endpoints with their status, URL and machine counts. Requires the `functions:read` scope.
147
+ * List model endpoints
148
+ */
149
+ listEndpoints(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EndpointList>;
150
+ }