@gpuai/sdk 0.3.12 → 0.3.14

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 (132) hide show
  1. package/.openapi-generator/FILES +36 -0
  2. package/README.md +38 -9
  3. package/dist/apis/AutolaunchApi.d.ts +109 -0
  4. package/dist/apis/AutolaunchApi.js +286 -0
  5. package/dist/apis/InferenceApi.d.ts +19 -0
  6. package/dist/apis/InferenceApi.js +51 -0
  7. package/dist/apis/MarketApi.d.ts +56 -0
  8. package/dist/apis/MarketApi.js +112 -0
  9. package/dist/apis/WatchApi.d.ts +109 -0
  10. package/dist/apis/WatchApi.js +286 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +3 -0
  13. package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
  14. package/dist/esm/apis/AutolaunchApi.js +282 -0
  15. package/dist/esm/apis/InferenceApi.d.ts +19 -0
  16. package/dist/esm/apis/InferenceApi.js +51 -0
  17. package/dist/esm/apis/MarketApi.d.ts +56 -0
  18. package/dist/esm/apis/MarketApi.js +108 -0
  19. package/dist/esm/apis/WatchApi.d.ts +109 -0
  20. package/dist/esm/apis/WatchApi.js +282 -0
  21. package/dist/esm/apis/index.d.ts +3 -0
  22. package/dist/esm/apis/index.js +3 -0
  23. package/dist/esm/models/AutolaunchRule.d.ts +181 -0
  24. package/dist/esm/models/AutolaunchRule.js +142 -0
  25. package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
  26. package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
  27. package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
  28. package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
  29. package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
  30. package/dist/esm/models/AutolaunchRulePage.js +48 -0
  31. package/dist/esm/models/Embedding.d.ts +51 -0
  32. package/dist/esm/models/Embedding.js +59 -0
  33. package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
  34. package/dist/esm/models/EmbeddingsRequest.js +60 -0
  35. package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
  36. package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
  37. package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
  38. package/dist/esm/models/EmbeddingsResponse.js +65 -0
  39. package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
  40. package/dist/esm/models/EmbeddingsUsage.js +47 -0
  41. package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
  42. package/dist/esm/models/MarketHistoryPoint.js +55 -0
  43. package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
  44. package/dist/esm/models/MarketHistoryResponse.js +60 -0
  45. package/dist/esm/models/Problem.d.ts +1 -0
  46. package/dist/esm/models/Problem.js +1 -0
  47. package/dist/esm/models/WatchRule.d.ts +141 -0
  48. package/dist/esm/models/WatchRule.js +117 -0
  49. package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
  50. package/dist/esm/models/WatchRuleCreate.js +72 -0
  51. package/dist/esm/models/WatchRulePage.d.ts +39 -0
  52. package/dist/esm/models/WatchRulePage.js +48 -0
  53. package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
  54. package/dist/esm/models/WatchRuleUpdate.js +68 -0
  55. package/dist/esm/models/index.d.ts +15 -0
  56. package/dist/esm/models/index.js +15 -0
  57. package/dist/models/AutolaunchRule.d.ts +181 -0
  58. package/dist/models/AutolaunchRule.js +150 -0
  59. package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
  60. package/dist/models/AutolaunchRuleCreate.js +92 -0
  61. package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
  62. package/dist/models/AutolaunchRuleDisarm.js +50 -0
  63. package/dist/models/AutolaunchRulePage.d.ts +39 -0
  64. package/dist/models/AutolaunchRulePage.js +55 -0
  65. package/dist/models/Embedding.d.ts +51 -0
  66. package/dist/models/Embedding.js +67 -0
  67. package/dist/models/EmbeddingsRequest.d.ts +64 -0
  68. package/dist/models/EmbeddingsRequest.js +68 -0
  69. package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
  70. package/dist/models/EmbeddingsRequestInput.js +53 -0
  71. package/dist/models/EmbeddingsResponse.d.ts +59 -0
  72. package/dist/models/EmbeddingsResponse.js +73 -0
  73. package/dist/models/EmbeddingsUsage.d.ts +38 -0
  74. package/dist/models/EmbeddingsUsage.js +54 -0
  75. package/dist/models/MarketHistoryPoint.d.ts +59 -0
  76. package/dist/models/MarketHistoryPoint.js +62 -0
  77. package/dist/models/MarketHistoryResponse.d.ts +60 -0
  78. package/dist/models/MarketHistoryResponse.js +67 -0
  79. package/dist/models/Problem.d.ts +1 -0
  80. package/dist/models/Problem.js +1 -0
  81. package/dist/models/WatchRule.d.ts +141 -0
  82. package/dist/models/WatchRule.js +125 -0
  83. package/dist/models/WatchRuleCreate.d.ts +87 -0
  84. package/dist/models/WatchRuleCreate.js +80 -0
  85. package/dist/models/WatchRulePage.d.ts +39 -0
  86. package/dist/models/WatchRulePage.js +55 -0
  87. package/dist/models/WatchRuleUpdate.d.ts +86 -0
  88. package/dist/models/WatchRuleUpdate.js +76 -0
  89. package/dist/models/index.d.ts +15 -0
  90. package/dist/models/index.js +15 -0
  91. package/docs/AutolaunchApi.md +390 -0
  92. package/docs/AutolaunchRule.md +69 -0
  93. package/docs/AutolaunchRuleCreate.md +50 -0
  94. package/docs/AutolaunchRuleDisarm.md +35 -0
  95. package/docs/AutolaunchRulePage.md +36 -0
  96. package/docs/Embedding.md +38 -0
  97. package/docs/EmbeddingsRequest.md +42 -0
  98. package/docs/EmbeddingsRequestInput.md +33 -0
  99. package/docs/EmbeddingsResponse.md +40 -0
  100. package/docs/EmbeddingsUsage.md +37 -0
  101. package/docs/InferenceApi.md +83 -0
  102. package/docs/MarketApi.md +98 -0
  103. package/docs/MarketHistoryPoint.md +43 -0
  104. package/docs/MarketHistoryResponse.md +43 -0
  105. package/docs/WatchApi.md +389 -0
  106. package/docs/WatchRule.md +61 -0
  107. package/docs/WatchRuleCreate.md +46 -0
  108. package/docs/WatchRulePage.md +36 -0
  109. package/docs/WatchRuleUpdate.md +47 -0
  110. package/package.json +1 -1
  111. package/src/apis/AutolaunchApi.ts +360 -0
  112. package/src/apis/InferenceApi.ts +71 -0
  113. package/src/apis/MarketApi.ts +136 -0
  114. package/src/apis/WatchApi.ts +360 -0
  115. package/src/apis/index.ts +3 -0
  116. package/src/models/AutolaunchRule.ts +270 -0
  117. package/src/models/AutolaunchRuleCreate.ts +162 -0
  118. package/src/models/AutolaunchRuleDisarm.ts +68 -0
  119. package/src/models/AutolaunchRulePage.ts +83 -0
  120. package/src/models/Embedding.ts +96 -0
  121. package/src/models/EmbeddingsRequest.ts +117 -0
  122. package/src/models/EmbeddingsRequestInput.ts +59 -0
  123. package/src/models/EmbeddingsResponse.ts +120 -0
  124. package/src/models/EmbeddingsUsage.ts +75 -0
  125. package/src/models/MarketHistoryPoint.ts +103 -0
  126. package/src/models/MarketHistoryResponse.ts +113 -0
  127. package/src/models/Problem.ts +1 -0
  128. package/src/models/WatchRule.ts +219 -0
  129. package/src/models/WatchRuleCreate.ts +138 -0
  130. package/src/models/WatchRulePage.ts +83 -0
  131. package/src/models/WatchRuleUpdate.ts +135 -0
  132. package/src/models/index.ts +15 -0
@@ -0,0 +1,282 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { AutolaunchRuleFromJSON, } from '../models/AutolaunchRule';
25
+ import { AutolaunchRuleCreateToJSON, } from '../models/AutolaunchRuleCreate';
26
+ import { AutolaunchRuleDisarmToJSON, } from '../models/AutolaunchRuleDisarm';
27
+ import { AutolaunchRulePageFromJSON, } from '../models/AutolaunchRulePage';
28
+ /**
29
+ *
30
+ */
31
+ export class AutolaunchApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates request options for createAutolaunchRule without sending the request
34
+ */
35
+ createAutolaunchRuleRequestOpts(requestParameters) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['autolaunchRuleCreate'] == null) {
38
+ throw new runtime.RequiredError('autolaunchRuleCreate', 'Required parameter "autolaunchRuleCreate" was null or undefined when calling createAutolaunchRule().');
39
+ }
40
+ const queryParameters = {};
41
+ const headerParameters = {};
42
+ headerParameters['Content-Type'] = 'application/json';
43
+ if (requestParameters['idempotencyKey'] != null) {
44
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
45
+ }
46
+ if (this.configuration && this.configuration.accessToken) {
47
+ const token = this.configuration.accessToken;
48
+ const tokenString = yield token("bearerAuth", []);
49
+ if (tokenString) {
50
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
51
+ }
52
+ }
53
+ let urlPath = `/autolaunch-rules`;
54
+ return {
55
+ path: urlPath,
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ body: AutolaunchRuleCreateToJSON(requestParameters['autolaunchRuleCreate']),
60
+ };
61
+ });
62
+ }
63
+ /**
64
+ * Creates a standing, pre-approved purchase order. When the condition holds and the live price is at or under `max_price_per_hour`, the platform launches the frozen `spec` with no further confirmation from anyone — the customer is approving NOW for a purchase that happens LATER, while nobody is watching. SCOPE. Requires the `autolaunch:write` scope, which is granted only EXPLICITLY. It is deliberately NOT covered by `full_access`, `standard` or `read_only`: `instances:write` is real-time authority, exercised with someone present, whereas this is a standing, frozen authorization that fires days later unattended. Treating them as the same authority class would have handed unattended spend authority to every key ever issued, including keys minted long before this resource existed. Most existing keys therefore receive 403 here; the correct response is to mint a key whose scopes map includes `{\"autolaunch\": \"write\"}`, never to retry, to substitute a key, or to fall back to a watch rule. CONSENT. `acknowledged_max_total_usd` is REQUIRED and must equal `max_price_per_hour × max_runtime_hours` to within one cent. It is the API-level expression of \"a valid confirmation must come AFTER the price\": a caller that never computed the number cannot have shown it to anyone, and a caller that displayed a different number disagrees with what is about to be stored. Show the figure to the person approving the rule, then send it back. TWO PRICES, TWO UNITS. `threshold` is the TRIGGER, in dollars per GPU-hour — the same unit the market chart and watch rules speak in. `max_price_per_hour` is the CEILING, in dollars per hour for the WHOLE instance. A 4-GPU rule triggering under $4.00/GPU-hr typically carries a $16.00/hr ceiling. Conflating them scales the customer\'s spend authorization by their GPU count. FROZEN SPEC. `spec` is the full create-instance body the rule replays, validated at creation with the same validation a live create runs, so a spec that could never launch is refused while a human is present rather than at 3 a.m. `spec.offering_id` is REJECTED — offering identity churns between catalog polls, so a pin produces a rule that can never fire, which is the worst outcome here because the customer believes a purchase is armed. `spec.auto_terminate_hours` is overwritten from `max_runtime_hours` and must not be used to widen the bound. Organizations are limited to 10 active rules; the 422 names the limit. The organization spending limit still applies as a backstop at fire time — a launch must fit both its own ceiling and the org cap.
65
+ * Create an auto-launch rule (pre-approves a bounded, unattended spend)
66
+ */
67
+ createAutolaunchRuleRaw(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const requestOptions = yield this.createAutolaunchRuleRequestOpts(requestParameters);
70
+ const response = yield this.request(requestOptions, initOverrides);
71
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutolaunchRuleFromJSON(jsonValue));
72
+ });
73
+ }
74
+ /**
75
+ * Creates a standing, pre-approved purchase order. When the condition holds and the live price is at or under `max_price_per_hour`, the platform launches the frozen `spec` with no further confirmation from anyone — the customer is approving NOW for a purchase that happens LATER, while nobody is watching. SCOPE. Requires the `autolaunch:write` scope, which is granted only EXPLICITLY. It is deliberately NOT covered by `full_access`, `standard` or `read_only`: `instances:write` is real-time authority, exercised with someone present, whereas this is a standing, frozen authorization that fires days later unattended. Treating them as the same authority class would have handed unattended spend authority to every key ever issued, including keys minted long before this resource existed. Most existing keys therefore receive 403 here; the correct response is to mint a key whose scopes map includes `{\"autolaunch\": \"write\"}`, never to retry, to substitute a key, or to fall back to a watch rule. CONSENT. `acknowledged_max_total_usd` is REQUIRED and must equal `max_price_per_hour × max_runtime_hours` to within one cent. It is the API-level expression of \"a valid confirmation must come AFTER the price\": a caller that never computed the number cannot have shown it to anyone, and a caller that displayed a different number disagrees with what is about to be stored. Show the figure to the person approving the rule, then send it back. TWO PRICES, TWO UNITS. `threshold` is the TRIGGER, in dollars per GPU-hour — the same unit the market chart and watch rules speak in. `max_price_per_hour` is the CEILING, in dollars per hour for the WHOLE instance. A 4-GPU rule triggering under $4.00/GPU-hr typically carries a $16.00/hr ceiling. Conflating them scales the customer\'s spend authorization by their GPU count. FROZEN SPEC. `spec` is the full create-instance body the rule replays, validated at creation with the same validation a live create runs, so a spec that could never launch is refused while a human is present rather than at 3 a.m. `spec.offering_id` is REJECTED — offering identity churns between catalog polls, so a pin produces a rule that can never fire, which is the worst outcome here because the customer believes a purchase is armed. `spec.auto_terminate_hours` is overwritten from `max_runtime_hours` and must not be used to widen the bound. Organizations are limited to 10 active rules; the 422 names the limit. The organization spending limit still applies as a backstop at fire time — a launch must fit both its own ceiling and the org cap.
76
+ * Create an auto-launch rule (pre-approves a bounded, unattended spend)
77
+ */
78
+ createAutolaunchRule(requestParameters, initOverrides) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const response = yield this.createAutolaunchRuleRaw(requestParameters, initOverrides);
81
+ return yield response.value();
82
+ });
83
+ }
84
+ /**
85
+ * Creates request options for deleteAutolaunchRule without sending the request
86
+ */
87
+ deleteAutolaunchRuleRequestOpts(requestParameters) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ if (requestParameters['id'] == null) {
90
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAutolaunchRule().');
91
+ }
92
+ const queryParameters = {};
93
+ const headerParameters = {};
94
+ if (this.configuration && this.configuration.accessToken) {
95
+ const token = this.configuration.accessToken;
96
+ const tokenString = yield token("bearerAuth", []);
97
+ if (tokenString) {
98
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
99
+ }
100
+ }
101
+ let urlPath = `/autolaunch-rules/{id}`;
102
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
103
+ return {
104
+ path: urlPath,
105
+ method: 'DELETE',
106
+ headers: headerParameters,
107
+ query: queryParameters,
108
+ };
109
+ });
110
+ }
111
+ /**
112
+ * Deletes the rule and withdraws its pre-approved spend cap immediately. Requires only the `autolaunch:read` scope, for the same reason the disarm PATCH does. Deleting an already-deleted rule returns 404.
113
+ * Cancel an auto-launch rule
114
+ */
115
+ deleteAutolaunchRuleRaw(requestParameters, initOverrides) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const requestOptions = yield this.deleteAutolaunchRuleRequestOpts(requestParameters);
118
+ const response = yield this.request(requestOptions, initOverrides);
119
+ return new runtime.VoidApiResponse(response);
120
+ });
121
+ }
122
+ /**
123
+ * Deletes the rule and withdraws its pre-approved spend cap immediately. Requires only the `autolaunch:read` scope, for the same reason the disarm PATCH does. Deleting an already-deleted rule returns 404.
124
+ * Cancel an auto-launch rule
125
+ */
126
+ deleteAutolaunchRule(requestParameters, initOverrides) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ yield this.deleteAutolaunchRuleRaw(requestParameters, initOverrides);
129
+ });
130
+ }
131
+ /**
132
+ * Creates request options for disarmAutolaunchRule without sending the request
133
+ */
134
+ disarmAutolaunchRuleRequestOpts(requestParameters) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ if (requestParameters['id'] == null) {
137
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling disarmAutolaunchRule().');
138
+ }
139
+ if (requestParameters['autolaunchRuleDisarm'] == null) {
140
+ throw new runtime.RequiredError('autolaunchRuleDisarm', 'Required parameter "autolaunchRuleDisarm" was null or undefined when calling disarmAutolaunchRule().');
141
+ }
142
+ const queryParameters = {};
143
+ const headerParameters = {};
144
+ headerParameters['Content-Type'] = 'application/json';
145
+ if (this.configuration && this.configuration.accessToken) {
146
+ const token = this.configuration.accessToken;
147
+ const tokenString = yield token("bearerAuth", []);
148
+ if (tokenString) {
149
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
150
+ }
151
+ }
152
+ let urlPath = `/autolaunch-rules/{id}`;
153
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
154
+ return {
155
+ path: urlPath,
156
+ method: 'PATCH',
157
+ headers: headerParameters,
158
+ query: queryParameters,
159
+ body: AutolaunchRuleDisarmToJSON(requestParameters['autolaunchRuleDisarm']),
160
+ };
161
+ });
162
+ }
163
+ /**
164
+ * Disarms a rule. The body must be exactly `{\"enabled\": false}` and nothing else. Requires only the `autolaunch:read` scope — cancelling a standing spend authorization is deliberately never harder than holding one, so a key narrowed since it created a rule can still stop that rule. This is the entire update surface, and the absence is the design. Changing a ceiling, a runtime bound, the targeting or the frozen spec is a DIFFERENT bounded purchase, so it requires deleting the rule and creating a new one through the consent gate. Re-arming is refused too: a fired rule consumed its one shot, so `{\"enabled\": true}` would resurrect a purchase order that was already consented to and spent.
165
+ * Disarm an auto-launch rule
166
+ */
167
+ disarmAutolaunchRuleRaw(requestParameters, initOverrides) {
168
+ return __awaiter(this, void 0, void 0, function* () {
169
+ const requestOptions = yield this.disarmAutolaunchRuleRequestOpts(requestParameters);
170
+ const response = yield this.request(requestOptions, initOverrides);
171
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutolaunchRuleFromJSON(jsonValue));
172
+ });
173
+ }
174
+ /**
175
+ * Disarms a rule. The body must be exactly `{\"enabled\": false}` and nothing else. Requires only the `autolaunch:read` scope — cancelling a standing spend authorization is deliberately never harder than holding one, so a key narrowed since it created a rule can still stop that rule. This is the entire update surface, and the absence is the design. Changing a ceiling, a runtime bound, the targeting or the frozen spec is a DIFFERENT bounded purchase, so it requires deleting the rule and creating a new one through the consent gate. Re-arming is refused too: a fired rule consumed its one shot, so `{\"enabled\": true}` would resurrect a purchase order that was already consented to and spent.
176
+ * Disarm an auto-launch rule
177
+ */
178
+ disarmAutolaunchRule(requestParameters, initOverrides) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ const response = yield this.disarmAutolaunchRuleRaw(requestParameters, initOverrides);
181
+ return yield response.value();
182
+ });
183
+ }
184
+ /**
185
+ * Creates request options for getAutolaunchRule without sending the request
186
+ */
187
+ getAutolaunchRuleRequestOpts(requestParameters) {
188
+ return __awaiter(this, void 0, void 0, function* () {
189
+ if (requestParameters['id'] == null) {
190
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getAutolaunchRule().');
191
+ }
192
+ const queryParameters = {};
193
+ const headerParameters = {};
194
+ if (this.configuration && this.configuration.accessToken) {
195
+ const token = this.configuration.accessToken;
196
+ const tokenString = yield token("bearerAuth", []);
197
+ if (tokenString) {
198
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
199
+ }
200
+ }
201
+ let urlPath = `/autolaunch-rules/{id}`;
202
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
203
+ return {
204
+ path: urlPath,
205
+ method: 'GET',
206
+ headers: headerParameters,
207
+ query: queryParameters,
208
+ };
209
+ });
210
+ }
211
+ /**
212
+ * Fetches one auto-launch rule, including the frozen launch spec. Requires the `autolaunch:read` scope. A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
213
+ * Get an auto-launch rule
214
+ */
215
+ getAutolaunchRuleRaw(requestParameters, initOverrides) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const requestOptions = yield this.getAutolaunchRuleRequestOpts(requestParameters);
218
+ const response = yield this.request(requestOptions, initOverrides);
219
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutolaunchRuleFromJSON(jsonValue));
220
+ });
221
+ }
222
+ /**
223
+ * Fetches one auto-launch rule, including the frozen launch spec. Requires the `autolaunch:read` scope. A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
224
+ * Get an auto-launch rule
225
+ */
226
+ getAutolaunchRule(requestParameters, initOverrides) {
227
+ return __awaiter(this, void 0, void 0, function* () {
228
+ const response = yield this.getAutolaunchRuleRaw(requestParameters, initOverrides);
229
+ return yield response.value();
230
+ });
231
+ }
232
+ /**
233
+ * Creates request options for listAutolaunchRules without sending the request
234
+ */
235
+ listAutolaunchRulesRequestOpts(requestParameters) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ const queryParameters = {};
238
+ if (requestParameters['cursor'] != null) {
239
+ queryParameters['cursor'] = requestParameters['cursor'];
240
+ }
241
+ if (requestParameters['limit'] != null) {
242
+ queryParameters['limit'] = requestParameters['limit'];
243
+ }
244
+ const headerParameters = {};
245
+ if (this.configuration && this.configuration.accessToken) {
246
+ const token = this.configuration.accessToken;
247
+ const tokenString = yield token("bearerAuth", []);
248
+ if (tokenString) {
249
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
250
+ }
251
+ }
252
+ let urlPath = `/autolaunch-rules`;
253
+ return {
254
+ path: urlPath,
255
+ method: 'GET',
256
+ headers: headerParameters,
257
+ query: queryParameters,
258
+ };
259
+ });
260
+ }
261
+ /**
262
+ * Lists this organization\'s auto-launch rules. Requires the `autolaunch:read` scope, which `standard` and `full_access` keys carry. Rules belonging to other organizations are never returned, and rules created through the dashboard are included — the list is the organization\'s, not the key\'s.
263
+ * List auto-launch rules
264
+ */
265
+ listAutolaunchRulesRaw(requestParameters, initOverrides) {
266
+ return __awaiter(this, void 0, void 0, function* () {
267
+ const requestOptions = yield this.listAutolaunchRulesRequestOpts(requestParameters);
268
+ const response = yield this.request(requestOptions, initOverrides);
269
+ return new runtime.JSONApiResponse(response, (jsonValue) => AutolaunchRulePageFromJSON(jsonValue));
270
+ });
271
+ }
272
+ /**
273
+ * Lists this organization\'s auto-launch rules. Requires the `autolaunch:read` scope, which `standard` and `full_access` keys carry. Rules belonging to other organizations are never returned, and rules created through the dashboard are included — the list is the organization\'s, not the key\'s.
274
+ * List auto-launch rules
275
+ */
276
+ listAutolaunchRules() {
277
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
278
+ const response = yield this.listAutolaunchRulesRaw(requestParameters, initOverrides);
279
+ return yield response.value();
280
+ });
281
+ }
282
+ }
@@ -12,6 +12,8 @@
12
12
  import * as runtime from '../runtime';
13
13
  import { type ChatCompletionRequest } from '../models/ChatCompletionRequest';
14
14
  import { type ChatCompletionResponse } from '../models/ChatCompletionResponse';
15
+ import { type EmbeddingsRequest } from '../models/EmbeddingsRequest';
16
+ import { type EmbeddingsResponse } from '../models/EmbeddingsResponse';
15
17
  import { type ImagesGenerationsRequest } from '../models/ImagesGenerationsRequest';
16
18
  import { type ImagesResponse } from '../models/ImagesResponse';
17
19
  import { type Model } from '../models/Model';
@@ -25,6 +27,9 @@ export interface CancelVideoRequest {
25
27
  export interface CreateChatCompletionRequest {
26
28
  chatCompletionRequest: ChatCompletionRequest;
27
29
  }
30
+ export interface CreateEmbeddingsRequest {
31
+ embeddingsRequest: EmbeddingsRequest;
32
+ }
28
33
  export interface CreateImageRequest {
29
34
  imagesGenerationsRequest: ImagesGenerationsRequest;
30
35
  idempotencyKey?: string;
@@ -77,6 +82,20 @@ export declare class InferenceApi extends runtime.BaseAPI {
77
82
  * Create a chat completion (OpenAI-compatible)
78
83
  */
79
84
  createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse>;
85
+ /**
86
+ * Creates request options for createEmbeddings without sending the request
87
+ */
88
+ createEmbeddingsRequestOpts(requestParameters: CreateEmbeddingsRequest): Promise<runtime.RequestOpts>;
89
+ /**
90
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
91
+ * Create embeddings (OpenAI-compatible)
92
+ */
93
+ createEmbeddingsRaw(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmbeddingsResponse>>;
94
+ /**
95
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
96
+ * Create embeddings (OpenAI-compatible)
97
+ */
98
+ createEmbeddings(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmbeddingsResponse>;
80
99
  /**
81
100
  * Creates request options for createImage without sending the request
82
101
  */
@@ -23,6 +23,8 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
23
23
  import * as runtime from '../runtime';
24
24
  import { ChatCompletionRequestToJSON, } from '../models/ChatCompletionRequest';
25
25
  import { ChatCompletionResponseFromJSON, } from '../models/ChatCompletionResponse';
26
+ import { EmbeddingsRequestToJSON, } from '../models/EmbeddingsRequest';
27
+ import { EmbeddingsResponseFromJSON, } from '../models/EmbeddingsResponse';
26
28
  import { ImagesGenerationsRequestToJSON, } from '../models/ImagesGenerationsRequest';
27
29
  import { ImagesResponseFromJSON, } from '../models/ImagesResponse';
28
30
  import { ModelFromJSON, } from '../models/Model';
@@ -127,6 +129,55 @@ export class InferenceApi extends runtime.BaseAPI {
127
129
  return yield response.value();
128
130
  });
129
131
  }
132
+ /**
133
+ * Creates request options for createEmbeddings without sending the request
134
+ */
135
+ createEmbeddingsRequestOpts(requestParameters) {
136
+ return __awaiter(this, void 0, void 0, function* () {
137
+ if (requestParameters['embeddingsRequest'] == null) {
138
+ throw new runtime.RequiredError('embeddingsRequest', 'Required parameter "embeddingsRequest" was null or undefined when calling createEmbeddings().');
139
+ }
140
+ const queryParameters = {};
141
+ const headerParameters = {};
142
+ headerParameters['Content-Type'] = 'application/json';
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 = `/embeddings`;
151
+ return {
152
+ path: urlPath,
153
+ method: 'POST',
154
+ headers: headerParameters,
155
+ query: queryParameters,
156
+ body: EmbeddingsRequestToJSON(requestParameters['embeddingsRequest']),
157
+ };
158
+ });
159
+ }
160
+ /**
161
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
162
+ * Create embeddings (OpenAI-compatible)
163
+ */
164
+ createEmbeddingsRaw(requestParameters, initOverrides) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ const requestOptions = yield this.createEmbeddingsRequestOpts(requestParameters);
167
+ const response = yield this.request(requestOptions, initOverrides);
168
+ return new runtime.JSONApiResponse(response, (jsonValue) => EmbeddingsResponseFromJSON(jsonValue));
169
+ });
170
+ }
171
+ /**
172
+ * Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
173
+ * Create embeddings (OpenAI-compatible)
174
+ */
175
+ createEmbeddings(requestParameters, initOverrides) {
176
+ return __awaiter(this, void 0, void 0, function* () {
177
+ const response = yield this.createEmbeddingsRaw(requestParameters, initOverrides);
178
+ return yield response.value();
179
+ });
180
+ }
130
181
  /**
131
182
  * Creates request options for createImage without sending the request
132
183
  */
@@ -0,0 +1,56 @@
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 MarketHistoryResponse } from '../models/MarketHistoryResponse';
14
+ export interface GetMarketHistoryRequest {
15
+ gpuModel: string;
16
+ region?: string;
17
+ capacityClass?: GetMarketHistoryCapacityClassEnum;
18
+ bucket?: GetMarketHistoryBucketEnum;
19
+ from?: Date;
20
+ to?: Date;
21
+ }
22
+ /**
23
+ *
24
+ */
25
+ export declare class MarketApi extends runtime.BaseAPI {
26
+ /**
27
+ * Creates request options for getMarketHistory without sending the request
28
+ */
29
+ getMarketHistoryRequestOpts(requestParameters: GetMarketHistoryRequest): Promise<runtime.RequestOpts>;
30
+ /**
31
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
32
+ * Get a GPU\'s price and availability over time
33
+ */
34
+ getMarketHistoryRaw(requestParameters: GetMarketHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarketHistoryResponse>>;
35
+ /**
36
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
37
+ * Get a GPU\'s price and availability over time
38
+ */
39
+ getMarketHistory(requestParameters: GetMarketHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarketHistoryResponse>;
40
+ }
41
+ /**
42
+ * @export
43
+ */
44
+ export declare const GetMarketHistoryCapacityClassEnum: {
45
+ readonly Secure: "secure";
46
+ readonly Community: "community";
47
+ };
48
+ export type GetMarketHistoryCapacityClassEnum = typeof GetMarketHistoryCapacityClassEnum[keyof typeof GetMarketHistoryCapacityClassEnum];
49
+ /**
50
+ * @export
51
+ */
52
+ export declare const GetMarketHistoryBucketEnum: {
53
+ readonly _15m: "15m";
54
+ readonly _1d: "1d";
55
+ };
56
+ export type GetMarketHistoryBucketEnum = typeof GetMarketHistoryBucketEnum[keyof typeof GetMarketHistoryBucketEnum];
@@ -0,0 +1,108 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { MarketHistoryResponseFromJSON, } from '../models/MarketHistoryResponse';
25
+ /**
26
+ *
27
+ */
28
+ export class MarketApi extends runtime.BaseAPI {
29
+ /**
30
+ * Creates request options for getMarketHistory without sending the request
31
+ */
32
+ getMarketHistoryRequestOpts(requestParameters) {
33
+ return __awaiter(this, void 0, void 0, function* () {
34
+ if (requestParameters['gpuModel'] == null) {
35
+ throw new runtime.RequiredError('gpuModel', 'Required parameter "gpuModel" was null or undefined when calling getMarketHistory().');
36
+ }
37
+ const queryParameters = {};
38
+ if (requestParameters['gpuModel'] != null) {
39
+ queryParameters['gpu_model'] = requestParameters['gpuModel'];
40
+ }
41
+ if (requestParameters['region'] != null) {
42
+ queryParameters['region'] = requestParameters['region'];
43
+ }
44
+ if (requestParameters['capacityClass'] != null) {
45
+ queryParameters['capacity_class'] = requestParameters['capacityClass'];
46
+ }
47
+ if (requestParameters['bucket'] != null) {
48
+ queryParameters['bucket'] = requestParameters['bucket'];
49
+ }
50
+ if (requestParameters['from'] != null) {
51
+ queryParameters['from'] = requestParameters['from'].toISOString();
52
+ }
53
+ if (requestParameters['to'] != null) {
54
+ queryParameters['to'] = requestParameters['to'].toISOString();
55
+ }
56
+ const headerParameters = {};
57
+ if (this.configuration && this.configuration.accessToken) {
58
+ const token = this.configuration.accessToken;
59
+ const tokenString = yield token("bearerAuth", []);
60
+ if (tokenString) {
61
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
62
+ }
63
+ }
64
+ let urlPath = `/market-history`;
65
+ return {
66
+ path: urlPath,
67
+ method: 'GET',
68
+ headers: headerParameters,
69
+ query: queryParameters,
70
+ };
71
+ });
72
+ }
73
+ /**
74
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
75
+ * Get a GPU\'s price and availability over time
76
+ */
77
+ getMarketHistoryRaw(requestParameters, initOverrides) {
78
+ return __awaiter(this, void 0, void 0, function* () {
79
+ const requestOptions = yield this.getMarketHistoryRequestOpts(requestParameters);
80
+ const response = yield this.request(requestOptions, initOverrides);
81
+ return new runtime.JSONApiResponse(response, (jsonValue) => MarketHistoryResponseFromJSON(jsonValue));
82
+ });
83
+ }
84
+ /**
85
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
86
+ * Get a GPU\'s price and availability over time
87
+ */
88
+ getMarketHistory(requestParameters, initOverrides) {
89
+ return __awaiter(this, void 0, void 0, function* () {
90
+ const response = yield this.getMarketHistoryRaw(requestParameters, initOverrides);
91
+ return yield response.value();
92
+ });
93
+ }
94
+ }
95
+ /**
96
+ * @export
97
+ */
98
+ export const GetMarketHistoryCapacityClassEnum = {
99
+ Secure: 'secure',
100
+ Community: 'community'
101
+ };
102
+ /**
103
+ * @export
104
+ */
105
+ export const GetMarketHistoryBucketEnum = {
106
+ _15m: '15m',
107
+ _1d: '1d'
108
+ };