@gpuai/sdk 0.3.13 → 0.3.15
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 +28 -0
- package/README.md +34 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/BillingApi.d.ts +15 -0
- package/dist/apis/BillingApi.js +45 -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/BillingApi.d.ts +15 -0
- package/dist/esm/apis/BillingApi.js +45 -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/Balance.d.ts +65 -0
- package/dist/esm/models/Balance.js +63 -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 +11 -0
- package/dist/esm/models/index.js +11 -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/Balance.d.ts +65 -0
- package/dist/models/Balance.js +70 -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 +11 -0
- package/dist/models/index.js +11 -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/Balance.md +45 -0
- package/docs/BillingApi.md +66 -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/BillingApi.ts +52 -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/Balance.ts +114 -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 +11 -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
|
+
|
package/docs/Balance.md
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
|
|
2
|
+
# Balance
|
|
3
|
+
|
|
4
|
+
The organization\'s credit balance with its auto-pay configuration and live burn rate. Mirrors the dashboard\'s balance contract field for field. No payment-instrument detail appears here — saved cards live behind separate admin-only routes.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`balanceCents` | number
|
|
11
|
+
`balanceDollars` | number
|
|
12
|
+
`autoPayEnabled` | boolean
|
|
13
|
+
`autoPayThresholdCents` | number
|
|
14
|
+
`autoPayAmountCents` | number
|
|
15
|
+
`burnCentsPerHour` | number
|
|
16
|
+
|
|
17
|
+
## Example
|
|
18
|
+
|
|
19
|
+
```typescript
|
|
20
|
+
import type { Balance } from '@gpuai/sdk'
|
|
21
|
+
|
|
22
|
+
// TODO: Update the object below with actual values
|
|
23
|
+
const example = {
|
|
24
|
+
"balanceCents": null,
|
|
25
|
+
"balanceDollars": null,
|
|
26
|
+
"autoPayEnabled": null,
|
|
27
|
+
"autoPayThresholdCents": null,
|
|
28
|
+
"autoPayAmountCents": null,
|
|
29
|
+
"burnCentsPerHour": null,
|
|
30
|
+
} satisfies Balance
|
|
31
|
+
|
|
32
|
+
console.log(example)
|
|
33
|
+
|
|
34
|
+
// Convert the instance to a JSON string
|
|
35
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
36
|
+
console.log(exampleJSON)
|
|
37
|
+
|
|
38
|
+
// Parse the JSON string back to an object
|
|
39
|
+
const exampleParsed = JSON.parse(exampleJSON) as Balance
|
|
40
|
+
console.log(exampleParsed)
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
44
|
+
|
|
45
|
+
|