@gpuai/sdk 0.3.13 → 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.
- package/.openapi-generator/FILES +26 -0
- package/README.md +32 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/MarketApi.d.ts +56 -0
- package/dist/apis/MarketApi.js +112 -0
- package/dist/apis/WatchApi.d.ts +109 -0
- package/dist/apis/WatchApi.js +286 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
- package/dist/esm/apis/AutolaunchApi.js +282 -0
- package/dist/esm/apis/MarketApi.d.ts +56 -0
- package/dist/esm/apis/MarketApi.js +108 -0
- package/dist/esm/apis/WatchApi.d.ts +109 -0
- package/dist/esm/apis/WatchApi.js +282 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AutolaunchRule.d.ts +181 -0
- package/dist/esm/models/AutolaunchRule.js +142 -0
- package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
- package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
- package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/esm/models/AutolaunchRulePage.js +48 -0
- package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/esm/models/MarketHistoryPoint.js +55 -0
- package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/esm/models/MarketHistoryResponse.js +60 -0
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/WatchRule.d.ts +141 -0
- package/dist/esm/models/WatchRule.js +117 -0
- package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
- package/dist/esm/models/WatchRuleCreate.js +72 -0
- package/dist/esm/models/WatchRulePage.d.ts +39 -0
- package/dist/esm/models/WatchRulePage.js +48 -0
- package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/esm/models/WatchRuleUpdate.js +68 -0
- package/dist/esm/models/index.d.ts +10 -0
- package/dist/esm/models/index.js +10 -0
- package/dist/models/AutolaunchRule.d.ts +181 -0
- package/dist/models/AutolaunchRule.js +150 -0
- package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/models/AutolaunchRuleCreate.js +92 -0
- package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/models/AutolaunchRuleDisarm.js +50 -0
- package/dist/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/models/AutolaunchRulePage.js +55 -0
- package/dist/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/models/MarketHistoryPoint.js +62 -0
- package/dist/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/models/MarketHistoryResponse.js +67 -0
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/WatchRule.d.ts +141 -0
- package/dist/models/WatchRule.js +125 -0
- package/dist/models/WatchRuleCreate.d.ts +87 -0
- package/dist/models/WatchRuleCreate.js +80 -0
- package/dist/models/WatchRulePage.d.ts +39 -0
- package/dist/models/WatchRulePage.js +55 -0
- package/dist/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/models/WatchRuleUpdate.js +76 -0
- package/dist/models/index.d.ts +10 -0
- package/dist/models/index.js +10 -0
- package/docs/AutolaunchApi.md +390 -0
- package/docs/AutolaunchRule.md +69 -0
- package/docs/AutolaunchRuleCreate.md +50 -0
- package/docs/AutolaunchRuleDisarm.md +35 -0
- package/docs/AutolaunchRulePage.md +36 -0
- package/docs/MarketApi.md +98 -0
- package/docs/MarketHistoryPoint.md +43 -0
- package/docs/MarketHistoryResponse.md +43 -0
- package/docs/WatchApi.md +389 -0
- package/docs/WatchRule.md +61 -0
- package/docs/WatchRuleCreate.md +46 -0
- package/docs/WatchRulePage.md +36 -0
- package/docs/WatchRuleUpdate.md +47 -0
- package/package.json +1 -1
- package/src/apis/AutolaunchApi.ts +360 -0
- package/src/apis/MarketApi.ts +136 -0
- package/src/apis/WatchApi.ts +360 -0
- package/src/apis/index.ts +3 -0
- package/src/models/AutolaunchRule.ts +270 -0
- package/src/models/AutolaunchRuleCreate.ts +162 -0
- package/src/models/AutolaunchRuleDisarm.ts +68 -0
- package/src/models/AutolaunchRulePage.ts +83 -0
- package/src/models/MarketHistoryPoint.ts +103 -0
- package/src/models/MarketHistoryResponse.ts +113 -0
- package/src/models/Problem.ts +1 -0
- package/src/models/WatchRule.ts +219 -0
- package/src/models/WatchRuleCreate.ts +138 -0
- package/src/models/WatchRulePage.ts +83 -0
- package/src/models/WatchRuleUpdate.ts +135 -0
- package/src/models/index.ts +10 -0
|
@@ -0,0 +1,390 @@
|
|
|
1
|
+
# AutolaunchApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.gpu.ai/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**createAutolaunchRule**](AutolaunchApi.md#createautolaunchrule) | **POST** /autolaunch-rules | Create an auto-launch rule (pre-approves a bounded, unattended spend) |
|
|
8
|
+
| [**deleteAutolaunchRule**](AutolaunchApi.md#deleteautolaunchrule) | **DELETE** /autolaunch-rules/{id} | Cancel an auto-launch rule |
|
|
9
|
+
| [**disarmAutolaunchRule**](AutolaunchApi.md#disarmautolaunchrule) | **PATCH** /autolaunch-rules/{id} | Disarm an auto-launch rule |
|
|
10
|
+
| [**getAutolaunchRule**](AutolaunchApi.md#getautolaunchrule) | **GET** /autolaunch-rules/{id} | Get an auto-launch rule |
|
|
11
|
+
| [**listAutolaunchRules**](AutolaunchApi.md#listautolaunchrules) | **GET** /autolaunch-rules | List auto-launch rules |
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
## createAutolaunchRule
|
|
16
|
+
|
|
17
|
+
> AutolaunchRule createAutolaunchRule(autolaunchRuleCreate, idempotencyKey)
|
|
18
|
+
|
|
19
|
+
Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
20
|
+
|
|
21
|
+
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.
|
|
22
|
+
|
|
23
|
+
### Example
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import {
|
|
27
|
+
Configuration,
|
|
28
|
+
AutolaunchApi,
|
|
29
|
+
} from '@gpuai/sdk';
|
|
30
|
+
import type { CreateAutolaunchRuleRequest } from '@gpuai/sdk';
|
|
31
|
+
|
|
32
|
+
async function example() {
|
|
33
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
34
|
+
const config = new Configuration({
|
|
35
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
36
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
37
|
+
});
|
|
38
|
+
const api = new AutolaunchApi(config);
|
|
39
|
+
|
|
40
|
+
const body = {
|
|
41
|
+
// AutolaunchRuleCreate
|
|
42
|
+
autolaunchRuleCreate: ...,
|
|
43
|
+
// string (optional)
|
|
44
|
+
idempotencyKey: idempotencyKey_example,
|
|
45
|
+
} satisfies CreateAutolaunchRuleRequest;
|
|
46
|
+
|
|
47
|
+
try {
|
|
48
|
+
const data = await api.createAutolaunchRule(body);
|
|
49
|
+
console.log(data);
|
|
50
|
+
} catch (error) {
|
|
51
|
+
console.error(error);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
// Run the test
|
|
56
|
+
example().catch(console.error);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
### Parameters
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
| Name | Type | Description | Notes |
|
|
63
|
+
|------------- | ------------- | ------------- | -------------|
|
|
64
|
+
| **autolaunchRuleCreate** | [AutolaunchRuleCreate](AutolaunchRuleCreate.md) | | |
|
|
65
|
+
| **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
66
|
+
|
|
67
|
+
### Return type
|
|
68
|
+
|
|
69
|
+
[**AutolaunchRule**](AutolaunchRule.md)
|
|
70
|
+
|
|
71
|
+
### Authorization
|
|
72
|
+
|
|
73
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
74
|
+
|
|
75
|
+
### HTTP request headers
|
|
76
|
+
|
|
77
|
+
- **Content-Type**: `application/json`
|
|
78
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### HTTP response details
|
|
82
|
+
| Status code | Description | Response headers |
|
|
83
|
+
|-------------|-------------|------------------|
|
|
84
|
+
| **201** | Created | - |
|
|
85
|
+
| **403** | The API key lacks `autolaunch:write`. This scope is explicit-grant only and is NOT covered by `full_access`, `standard` or `read_only`; the problem detail names the scope and the fix. | - |
|
|
86
|
+
| **422** | Validation failed — a missing or mismatched `acknowledged_max_total_usd`, a missing ceiling or runtime bound, an unknown condition kind, a non-canonical region, a missing threshold on a threshold condition, a `spec` that would not launch, a pinned `spec.offering_id`, or the active-rule limit already reached. | - |
|
|
87
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
88
|
+
| **0** | Error response (RFC 7807) | - |
|
|
89
|
+
|
|
90
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
## deleteAutolaunchRule
|
|
94
|
+
|
|
95
|
+
> deleteAutolaunchRule(id)
|
|
96
|
+
|
|
97
|
+
Cancel an auto-launch rule
|
|
98
|
+
|
|
99
|
+
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.
|
|
100
|
+
|
|
101
|
+
### Example
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
import {
|
|
105
|
+
Configuration,
|
|
106
|
+
AutolaunchApi,
|
|
107
|
+
} from '@gpuai/sdk';
|
|
108
|
+
import type { DeleteAutolaunchRuleRequest } from '@gpuai/sdk';
|
|
109
|
+
|
|
110
|
+
async function example() {
|
|
111
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
112
|
+
const config = new Configuration({
|
|
113
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
114
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
115
|
+
});
|
|
116
|
+
const api = new AutolaunchApi(config);
|
|
117
|
+
|
|
118
|
+
const body = {
|
|
119
|
+
// string
|
|
120
|
+
id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
121
|
+
} satisfies DeleteAutolaunchRuleRequest;
|
|
122
|
+
|
|
123
|
+
try {
|
|
124
|
+
const data = await api.deleteAutolaunchRule(body);
|
|
125
|
+
console.log(data);
|
|
126
|
+
} catch (error) {
|
|
127
|
+
console.error(error);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
// Run the test
|
|
132
|
+
example().catch(console.error);
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
### Parameters
|
|
136
|
+
|
|
137
|
+
|
|
138
|
+
| Name | Type | Description | Notes |
|
|
139
|
+
|------------- | ------------- | ------------- | -------------|
|
|
140
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
141
|
+
|
|
142
|
+
### Return type
|
|
143
|
+
|
|
144
|
+
`void` (Empty response body)
|
|
145
|
+
|
|
146
|
+
### Authorization
|
|
147
|
+
|
|
148
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
149
|
+
|
|
150
|
+
### HTTP request headers
|
|
151
|
+
|
|
152
|
+
- **Content-Type**: Not defined
|
|
153
|
+
- **Accept**: `application/problem+json`
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
### HTTP response details
|
|
157
|
+
| Status code | Description | Response headers |
|
|
158
|
+
|-------------|-------------|------------------|
|
|
159
|
+
| **204** | Deleted | - |
|
|
160
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
161
|
+
| **0** | Error response (RFC 7807) | - |
|
|
162
|
+
|
|
163
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
164
|
+
|
|
165
|
+
|
|
166
|
+
## disarmAutolaunchRule
|
|
167
|
+
|
|
168
|
+
> AutolaunchRule disarmAutolaunchRule(id, autolaunchRuleDisarm)
|
|
169
|
+
|
|
170
|
+
Disarm an auto-launch rule
|
|
171
|
+
|
|
172
|
+
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.
|
|
173
|
+
|
|
174
|
+
### Example
|
|
175
|
+
|
|
176
|
+
```ts
|
|
177
|
+
import {
|
|
178
|
+
Configuration,
|
|
179
|
+
AutolaunchApi,
|
|
180
|
+
} from '@gpuai/sdk';
|
|
181
|
+
import type { DisarmAutolaunchRuleRequest } from '@gpuai/sdk';
|
|
182
|
+
|
|
183
|
+
async function example() {
|
|
184
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
185
|
+
const config = new Configuration({
|
|
186
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
187
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
188
|
+
});
|
|
189
|
+
const api = new AutolaunchApi(config);
|
|
190
|
+
|
|
191
|
+
const body = {
|
|
192
|
+
// string
|
|
193
|
+
id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
194
|
+
// AutolaunchRuleDisarm
|
|
195
|
+
autolaunchRuleDisarm: ...,
|
|
196
|
+
} satisfies DisarmAutolaunchRuleRequest;
|
|
197
|
+
|
|
198
|
+
try {
|
|
199
|
+
const data = await api.disarmAutolaunchRule(body);
|
|
200
|
+
console.log(data);
|
|
201
|
+
} catch (error) {
|
|
202
|
+
console.error(error);
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// Run the test
|
|
207
|
+
example().catch(console.error);
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Parameters
|
|
211
|
+
|
|
212
|
+
|
|
213
|
+
| Name | Type | Description | Notes |
|
|
214
|
+
|------------- | ------------- | ------------- | -------------|
|
|
215
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
216
|
+
| **autolaunchRuleDisarm** | [AutolaunchRuleDisarm](AutolaunchRuleDisarm.md) | | |
|
|
217
|
+
|
|
218
|
+
### Return type
|
|
219
|
+
|
|
220
|
+
[**AutolaunchRule**](AutolaunchRule.md)
|
|
221
|
+
|
|
222
|
+
### Authorization
|
|
223
|
+
|
|
224
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
225
|
+
|
|
226
|
+
### HTTP request headers
|
|
227
|
+
|
|
228
|
+
- **Content-Type**: `application/json`
|
|
229
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
230
|
+
|
|
231
|
+
|
|
232
|
+
### HTTP response details
|
|
233
|
+
| Status code | Description | Response headers |
|
|
234
|
+
|-------------|-------------|------------------|
|
|
235
|
+
| **200** | OK | - |
|
|
236
|
+
| **422** | The body carried a key other than `enabled`, omitted `enabled`, or asked to re-arm the rule. | - |
|
|
237
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
238
|
+
| **0** | Error response (RFC 7807) | - |
|
|
239
|
+
|
|
240
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
241
|
+
|
|
242
|
+
|
|
243
|
+
## getAutolaunchRule
|
|
244
|
+
|
|
245
|
+
> AutolaunchRule getAutolaunchRule(id)
|
|
246
|
+
|
|
247
|
+
Get an auto-launch rule
|
|
248
|
+
|
|
249
|
+
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.
|
|
250
|
+
|
|
251
|
+
### Example
|
|
252
|
+
|
|
253
|
+
```ts
|
|
254
|
+
import {
|
|
255
|
+
Configuration,
|
|
256
|
+
AutolaunchApi,
|
|
257
|
+
} from '@gpuai/sdk';
|
|
258
|
+
import type { GetAutolaunchRuleRequest } from '@gpuai/sdk';
|
|
259
|
+
|
|
260
|
+
async function example() {
|
|
261
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
262
|
+
const config = new Configuration({
|
|
263
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
264
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
265
|
+
});
|
|
266
|
+
const api = new AutolaunchApi(config);
|
|
267
|
+
|
|
268
|
+
const body = {
|
|
269
|
+
// string
|
|
270
|
+
id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
|
|
271
|
+
} satisfies GetAutolaunchRuleRequest;
|
|
272
|
+
|
|
273
|
+
try {
|
|
274
|
+
const data = await api.getAutolaunchRule(body);
|
|
275
|
+
console.log(data);
|
|
276
|
+
} catch (error) {
|
|
277
|
+
console.error(error);
|
|
278
|
+
}
|
|
279
|
+
}
|
|
280
|
+
|
|
281
|
+
// Run the test
|
|
282
|
+
example().catch(console.error);
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Parameters
|
|
286
|
+
|
|
287
|
+
|
|
288
|
+
| Name | Type | Description | Notes |
|
|
289
|
+
|------------- | ------------- | ------------- | -------------|
|
|
290
|
+
| **id** | `string` | | [Defaults to `undefined`] |
|
|
291
|
+
|
|
292
|
+
### Return type
|
|
293
|
+
|
|
294
|
+
[**AutolaunchRule**](AutolaunchRule.md)
|
|
295
|
+
|
|
296
|
+
### Authorization
|
|
297
|
+
|
|
298
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
299
|
+
|
|
300
|
+
### HTTP request headers
|
|
301
|
+
|
|
302
|
+
- **Content-Type**: Not defined
|
|
303
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
304
|
+
|
|
305
|
+
|
|
306
|
+
### HTTP response details
|
|
307
|
+
| Status code | Description | Response headers |
|
|
308
|
+
|-------------|-------------|------------------|
|
|
309
|
+
| **200** | OK | - |
|
|
310
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
311
|
+
| **0** | Error response (RFC 7807) | - |
|
|
312
|
+
|
|
313
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
## listAutolaunchRules
|
|
317
|
+
|
|
318
|
+
> AutolaunchRulePage listAutolaunchRules(cursor, limit)
|
|
319
|
+
|
|
320
|
+
List auto-launch rules
|
|
321
|
+
|
|
322
|
+
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.
|
|
323
|
+
|
|
324
|
+
### Example
|
|
325
|
+
|
|
326
|
+
```ts
|
|
327
|
+
import {
|
|
328
|
+
Configuration,
|
|
329
|
+
AutolaunchApi,
|
|
330
|
+
} from '@gpuai/sdk';
|
|
331
|
+
import type { ListAutolaunchRulesRequest } from '@gpuai/sdk';
|
|
332
|
+
|
|
333
|
+
async function example() {
|
|
334
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
335
|
+
const config = new Configuration({
|
|
336
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
337
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
338
|
+
});
|
|
339
|
+
const api = new AutolaunchApi(config);
|
|
340
|
+
|
|
341
|
+
const body = {
|
|
342
|
+
// string (optional)
|
|
343
|
+
cursor: cursor_example,
|
|
344
|
+
// number (optional)
|
|
345
|
+
limit: 56,
|
|
346
|
+
} satisfies ListAutolaunchRulesRequest;
|
|
347
|
+
|
|
348
|
+
try {
|
|
349
|
+
const data = await api.listAutolaunchRules(body);
|
|
350
|
+
console.log(data);
|
|
351
|
+
} catch (error) {
|
|
352
|
+
console.error(error);
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
// Run the test
|
|
357
|
+
example().catch(console.error);
|
|
358
|
+
```
|
|
359
|
+
|
|
360
|
+
### Parameters
|
|
361
|
+
|
|
362
|
+
|
|
363
|
+
| Name | Type | Description | Notes |
|
|
364
|
+
|------------- | ------------- | ------------- | -------------|
|
|
365
|
+
| **cursor** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
366
|
+
| **limit** | `number` | | [Optional] [Defaults to `50`] |
|
|
367
|
+
|
|
368
|
+
### Return type
|
|
369
|
+
|
|
370
|
+
[**AutolaunchRulePage**](AutolaunchRulePage.md)
|
|
371
|
+
|
|
372
|
+
### Authorization
|
|
373
|
+
|
|
374
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
375
|
+
|
|
376
|
+
### HTTP request headers
|
|
377
|
+
|
|
378
|
+
- **Content-Type**: Not defined
|
|
379
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
380
|
+
|
|
381
|
+
|
|
382
|
+
### HTTP response details
|
|
383
|
+
| Status code | Description | Response headers |
|
|
384
|
+
|-------------|-------------|------------------|
|
|
385
|
+
| **200** | OK | - |
|
|
386
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
387
|
+
| **0** | Error response (RFC 7807) | - |
|
|
388
|
+
|
|
389
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
390
|
+
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
|
|
2
|
+
# AutolaunchRule
|
|
3
|
+
|
|
4
|
+
A standing, pre-approved purchase order. It carries no upstream supplier identity, no org id, and no identifier of the API key that consented — the consenting principal is recorded in storage for the fire-time re-check, and a credential identifier has no business in a rule listing.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`gpuModel` | string
|
|
12
|
+
`region` | string
|
|
13
|
+
`capacityClass` | string
|
|
14
|
+
`conditionKind` | string
|
|
15
|
+
`threshold` | number
|
|
16
|
+
`maxPricePerHour` | number
|
|
17
|
+
`maxRuntimeHours` | number
|
|
18
|
+
`maxTotalUsd` | number
|
|
19
|
+
`spec` | { [key: string]: any; }
|
|
20
|
+
`state` | string
|
|
21
|
+
`attemptsThisEdge` | number
|
|
22
|
+
`lastFailureReason` | string
|
|
23
|
+
`launchedInstanceId` | string
|
|
24
|
+
`createdBySurface` | string
|
|
25
|
+
`enabled` | boolean
|
|
26
|
+
`createdAt` | Date
|
|
27
|
+
`updatedAt` | Date
|
|
28
|
+
|
|
29
|
+
## Example
|
|
30
|
+
|
|
31
|
+
```typescript
|
|
32
|
+
import type { AutolaunchRule } from '@gpuai/sdk'
|
|
33
|
+
|
|
34
|
+
// TODO: Update the object below with actual values
|
|
35
|
+
const example = {
|
|
36
|
+
"id": null,
|
|
37
|
+
"gpuModel": null,
|
|
38
|
+
"region": null,
|
|
39
|
+
"capacityClass": null,
|
|
40
|
+
"conditionKind": null,
|
|
41
|
+
"threshold": null,
|
|
42
|
+
"maxPricePerHour": null,
|
|
43
|
+
"maxRuntimeHours": null,
|
|
44
|
+
"maxTotalUsd": null,
|
|
45
|
+
"spec": null,
|
|
46
|
+
"state": null,
|
|
47
|
+
"attemptsThisEdge": null,
|
|
48
|
+
"lastFailureReason": null,
|
|
49
|
+
"launchedInstanceId": null,
|
|
50
|
+
"createdBySurface": null,
|
|
51
|
+
"enabled": null,
|
|
52
|
+
"createdAt": null,
|
|
53
|
+
"updatedAt": null,
|
|
54
|
+
} satisfies AutolaunchRule
|
|
55
|
+
|
|
56
|
+
console.log(example)
|
|
57
|
+
|
|
58
|
+
// Convert the instance to a JSON string
|
|
59
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
60
|
+
console.log(exampleJSON)
|
|
61
|
+
|
|
62
|
+
// Parse the JSON string back to an object
|
|
63
|
+
const exampleParsed = JSON.parse(exampleJSON) as AutolaunchRule
|
|
64
|
+
console.log(exampleParsed)
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
68
|
+
|
|
69
|
+
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
|
|
2
|
+
# AutolaunchRuleCreate
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`gpuModel` | string
|
|
10
|
+
`region` | string
|
|
11
|
+
`capacityClass` | string
|
|
12
|
+
`conditionKind` | string
|
|
13
|
+
`threshold` | number
|
|
14
|
+
`maxPricePerHour` | number
|
|
15
|
+
`maxRuntimeHours` | number
|
|
16
|
+
`spec` | { [key: string]: any; }
|
|
17
|
+
`acknowledgedMaxTotalUsd` | number
|
|
18
|
+
|
|
19
|
+
## Example
|
|
20
|
+
|
|
21
|
+
```typescript
|
|
22
|
+
import type { AutolaunchRuleCreate } from '@gpuai/sdk'
|
|
23
|
+
|
|
24
|
+
// TODO: Update the object below with actual values
|
|
25
|
+
const example = {
|
|
26
|
+
"gpuModel": null,
|
|
27
|
+
"region": null,
|
|
28
|
+
"capacityClass": null,
|
|
29
|
+
"conditionKind": null,
|
|
30
|
+
"threshold": null,
|
|
31
|
+
"maxPricePerHour": null,
|
|
32
|
+
"maxRuntimeHours": null,
|
|
33
|
+
"spec": null,
|
|
34
|
+
"acknowledgedMaxTotalUsd": null,
|
|
35
|
+
} satisfies AutolaunchRuleCreate
|
|
36
|
+
|
|
37
|
+
console.log(example)
|
|
38
|
+
|
|
39
|
+
// Convert the instance to a JSON string
|
|
40
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
41
|
+
console.log(exampleJSON)
|
|
42
|
+
|
|
43
|
+
// Parse the JSON string back to an object
|
|
44
|
+
const exampleParsed = JSON.parse(exampleJSON) as AutolaunchRuleCreate
|
|
45
|
+
console.log(exampleParsed)
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
49
|
+
|
|
50
|
+
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
|
|
2
|
+
# AutolaunchRuleDisarm
|
|
3
|
+
|
|
4
|
+
The entire PATCH surface. `enabled` must be present and must be false. Any other key is refused rather than accepted-and-ignored, because a PATCH carrying a new ceiling that returned 200 would leave the caller believing the cap had moved.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`enabled` | boolean
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { AutolaunchRuleDisarm } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"enabled": null,
|
|
20
|
+
} satisfies AutolaunchRuleDisarm
|
|
21
|
+
|
|
22
|
+
console.log(example)
|
|
23
|
+
|
|
24
|
+
// Convert the instance to a JSON string
|
|
25
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
26
|
+
console.log(exampleJSON)
|
|
27
|
+
|
|
28
|
+
// Parse the JSON string back to an object
|
|
29
|
+
const exampleParsed = JSON.parse(exampleJSON) as AutolaunchRuleDisarm
|
|
30
|
+
console.log(exampleParsed)
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# AutolaunchRulePage
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`data` | [Array<AutolaunchRule>](AutolaunchRule.md)
|
|
10
|
+
`nextCursor` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { AutolaunchRulePage } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"data": null,
|
|
20
|
+
"nextCursor": null,
|
|
21
|
+
} satisfies AutolaunchRulePage
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as AutolaunchRulePage
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
# MarketApi
|
|
2
|
+
|
|
3
|
+
All URIs are relative to *https://api.gpu.ai/v1*
|
|
4
|
+
|
|
5
|
+
| Method | HTTP request | Description |
|
|
6
|
+
|------------- | ------------- | -------------|
|
|
7
|
+
| [**getMarketHistory**](MarketApi.md#getmarkethistory) | **GET** /market-history | Get a GPU\'s price and availability over time |
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
## getMarketHistory
|
|
12
|
+
|
|
13
|
+
> MarketHistoryResponse getMarketHistory(gpuModel, region, capacityClass, bucket, from, to)
|
|
14
|
+
|
|
15
|
+
Get a GPU\'s price and availability over time
|
|
16
|
+
|
|
17
|
+
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.
|
|
18
|
+
|
|
19
|
+
### Example
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import {
|
|
23
|
+
Configuration,
|
|
24
|
+
MarketApi,
|
|
25
|
+
} from '@gpuai/sdk';
|
|
26
|
+
import type { GetMarketHistoryRequest } from '@gpuai/sdk';
|
|
27
|
+
|
|
28
|
+
async function example() {
|
|
29
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
30
|
+
const config = new Configuration({
|
|
31
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
32
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
33
|
+
});
|
|
34
|
+
const api = new MarketApi(config);
|
|
35
|
+
|
|
36
|
+
const body = {
|
|
37
|
+
// string | GPU model to chart, e.g. \"H100\". Required — it is the leading column of the lookup index.
|
|
38
|
+
gpuModel: gpuModel_example,
|
|
39
|
+
// string | Canonical region to narrow the series to. Omit to MERGE every region rather than to filter on the empty string. (optional)
|
|
40
|
+
region: region_example,
|
|
41
|
+
// 'secure' | 'community' | Capacity class to narrow the series to. Omit to merge both. (optional)
|
|
42
|
+
capacityClass: capacityClass_example,
|
|
43
|
+
// '15m' | '1d' | Resolution. Only these two values are accepted: the series cannot be returned finer than it was stored. (optional)
|
|
44
|
+
bucket: bucket_example,
|
|
45
|
+
// Date | Start of the window (RFC3339). Defaults to 7 days before `to`. (optional)
|
|
46
|
+
from: 2013-10-20T19:20:30+01:00,
|
|
47
|
+
// Date | End of the window (RFC3339). Defaults to now; a future value is clamped to now, since no bucket can exist for a time that has not happened. (optional)
|
|
48
|
+
to: 2013-10-20T19:20:30+01:00,
|
|
49
|
+
} satisfies GetMarketHistoryRequest;
|
|
50
|
+
|
|
51
|
+
try {
|
|
52
|
+
const data = await api.getMarketHistory(body);
|
|
53
|
+
console.log(data);
|
|
54
|
+
} catch (error) {
|
|
55
|
+
console.error(error);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// Run the test
|
|
60
|
+
example().catch(console.error);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
### Parameters
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
| Name | Type | Description | Notes |
|
|
67
|
+
|------------- | ------------- | ------------- | -------------|
|
|
68
|
+
| **gpuModel** | `string` | GPU model to chart, e.g. \"H100\". Required — it is the leading column of the lookup index. | [Defaults to `undefined`] |
|
|
69
|
+
| **region** | `string` | Canonical region to narrow the series to. Omit to MERGE every region rather than to filter on the empty string. | [Optional] [Defaults to `undefined`] |
|
|
70
|
+
| **capacityClass** | `secure`, `community` | Capacity class to narrow the series to. Omit to merge both. | [Optional] [Defaults to `undefined`] [Enum: secure, community] |
|
|
71
|
+
| **bucket** | `15m`, `1d` | Resolution. Only these two values are accepted: the series cannot be returned finer than it was stored. | [Optional] [Defaults to `'15m'`] [Enum: 15m, 1d] |
|
|
72
|
+
| **from** | `Date` | Start of the window (RFC3339). Defaults to 7 days before `to`. | [Optional] [Defaults to `undefined`] |
|
|
73
|
+
| **to** | `Date` | End of the window (RFC3339). Defaults to now; a future value is clamped to now, since no bucket can exist for a time that has not happened. | [Optional] [Defaults to `undefined`] |
|
|
74
|
+
|
|
75
|
+
### Return type
|
|
76
|
+
|
|
77
|
+
[**MarketHistoryResponse**](MarketHistoryResponse.md)
|
|
78
|
+
|
|
79
|
+
### Authorization
|
|
80
|
+
|
|
81
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
82
|
+
|
|
83
|
+
### HTTP request headers
|
|
84
|
+
|
|
85
|
+
- **Content-Type**: Not defined
|
|
86
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
### HTTP response details
|
|
90
|
+
| Status code | Description | Response headers |
|
|
91
|
+
|-------------|-------------|------------------|
|
|
92
|
+
| **200** | OK | - |
|
|
93
|
+
| **400** | Validation failed — a missing `gpu_model`, a non-canonical region, an unknown `capacity_class` or `bucket`, a non-RFC3339 timestamp, a `from` that is not before `to`, or a window wider than the cap for the requested resolution and scope. The detail names the cap and both ways to stay under it. | - |
|
|
94
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
95
|
+
| **0** | Error response (RFC 7807) | - |
|
|
96
|
+
|
|
97
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
98
|
+
|