@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.
- package/.openapi-generator/FILES +36 -0
- package/README.md +38 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/InferenceApi.d.ts +19 -0
- package/dist/apis/InferenceApi.js +51 -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/InferenceApi.d.ts +19 -0
- package/dist/esm/apis/InferenceApi.js +51 -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/Embedding.d.ts +51 -0
- package/dist/esm/models/Embedding.js +59 -0
- package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/esm/models/EmbeddingsRequest.js +60 -0
- package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
- package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/esm/models/EmbeddingsResponse.js +65 -0
- package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/esm/models/EmbeddingsUsage.js +47 -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 +15 -0
- package/dist/esm/models/index.js +15 -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/Embedding.d.ts +51 -0
- package/dist/models/Embedding.js +67 -0
- package/dist/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/models/EmbeddingsRequest.js +68 -0
- package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/models/EmbeddingsRequestInput.js +53 -0
- package/dist/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/models/EmbeddingsResponse.js +73 -0
- package/dist/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/models/EmbeddingsUsage.js +54 -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 +15 -0
- package/dist/models/index.js +15 -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/Embedding.md +38 -0
- package/docs/EmbeddingsRequest.md +42 -0
- package/docs/EmbeddingsRequestInput.md +33 -0
- package/docs/EmbeddingsResponse.md +40 -0
- package/docs/EmbeddingsUsage.md +37 -0
- package/docs/InferenceApi.md +83 -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/InferenceApi.ts +71 -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/Embedding.ts +96 -0
- package/src/models/EmbeddingsRequest.ts +117 -0
- package/src/models/EmbeddingsRequestInput.ts +59 -0
- package/src/models/EmbeddingsResponse.ts +120 -0
- package/src/models/EmbeddingsUsage.ts +75 -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 +15 -0
package/.openapi-generator/FILES
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
.gitignore
|
|
2
2
|
.npmignore
|
|
3
3
|
README.md
|
|
4
|
+
docs/AutolaunchApi.md
|
|
5
|
+
docs/AutolaunchRule.md
|
|
6
|
+
docs/AutolaunchRuleCreate.md
|
|
7
|
+
docs/AutolaunchRuleDisarm.md
|
|
8
|
+
docs/AutolaunchRulePage.md
|
|
4
9
|
docs/BillingApi.md
|
|
5
10
|
docs/ChatChoice.md
|
|
6
11
|
docs/ChatCompletionRequest.md
|
|
@@ -22,6 +27,11 @@ docs/CreateRegistryCredentialRequest.md
|
|
|
22
27
|
docs/CreateSshKeyRequest.md
|
|
23
28
|
docs/CreateWebhookEndpointRequest.md
|
|
24
29
|
docs/CryptoDeposit.md
|
|
30
|
+
docs/Embedding.md
|
|
31
|
+
docs/EmbeddingsRequest.md
|
|
32
|
+
docs/EmbeddingsRequestInput.md
|
|
33
|
+
docs/EmbeddingsResponse.md
|
|
34
|
+
docs/EmbeddingsUsage.md
|
|
25
35
|
docs/Environments.md
|
|
26
36
|
docs/EnvironmentsApi.md
|
|
27
37
|
docs/FileObject.md
|
|
@@ -50,6 +60,9 @@ docs/InstancesApi.md
|
|
|
50
60
|
docs/ListCommunityMachines200Response.md
|
|
51
61
|
docs/ListDeposits200Response.md
|
|
52
62
|
docs/ListRegistryCredentials200Response.md
|
|
63
|
+
docs/MarketApi.md
|
|
64
|
+
docs/MarketHistoryPoint.md
|
|
65
|
+
docs/MarketHistoryResponse.md
|
|
53
66
|
docs/MetaApi.md
|
|
54
67
|
docs/Model.md
|
|
55
68
|
docs/ModelList.md
|
|
@@ -89,10 +102,16 @@ docs/VMImage.md
|
|
|
89
102
|
docs/VideoCreateRequest.md
|
|
90
103
|
docs/VideoJob.md
|
|
91
104
|
docs/VideoList.md
|
|
105
|
+
docs/WatchApi.md
|
|
106
|
+
docs/WatchRule.md
|
|
107
|
+
docs/WatchRuleCreate.md
|
|
108
|
+
docs/WatchRulePage.md
|
|
109
|
+
docs/WatchRuleUpdate.md
|
|
92
110
|
docs/WebhookEndpoint.md
|
|
93
111
|
docs/WebhookEndpointPage.md
|
|
94
112
|
docs/WebhooksApi.md
|
|
95
113
|
package.json
|
|
114
|
+
src/apis/AutolaunchApi.ts
|
|
96
115
|
src/apis/BillingApi.ts
|
|
97
116
|
src/apis/CommunityApi.ts
|
|
98
117
|
src/apis/EnvironmentsApi.ts
|
|
@@ -100,6 +119,7 @@ src/apis/FineTuningApi.ts
|
|
|
100
119
|
src/apis/GpuTypesApi.ts
|
|
101
120
|
src/apis/InferenceApi.ts
|
|
102
121
|
src/apis/InstancesApi.ts
|
|
122
|
+
src/apis/MarketApi.ts
|
|
103
123
|
src/apis/MetaApi.ts
|
|
104
124
|
src/apis/OperationsApi.ts
|
|
105
125
|
src/apis/PricingApi.ts
|
|
@@ -107,9 +127,14 @@ src/apis/RegistryCredentialsApi.ts
|
|
|
107
127
|
src/apis/SshKeysApi.ts
|
|
108
128
|
src/apis/TemplatesApi.ts
|
|
109
129
|
src/apis/UsageApi.ts
|
|
130
|
+
src/apis/WatchApi.ts
|
|
110
131
|
src/apis/WebhooksApi.ts
|
|
111
132
|
src/apis/index.ts
|
|
112
133
|
src/index.ts
|
|
134
|
+
src/models/AutolaunchRule.ts
|
|
135
|
+
src/models/AutolaunchRuleCreate.ts
|
|
136
|
+
src/models/AutolaunchRuleDisarm.ts
|
|
137
|
+
src/models/AutolaunchRulePage.ts
|
|
113
138
|
src/models/ChatChoice.ts
|
|
114
139
|
src/models/ChatCompletionRequest.ts
|
|
115
140
|
src/models/ChatCompletionResponse.ts
|
|
@@ -129,6 +154,11 @@ src/models/CreateRegistryCredentialRequest.ts
|
|
|
129
154
|
src/models/CreateSshKeyRequest.ts
|
|
130
155
|
src/models/CreateWebhookEndpointRequest.ts
|
|
131
156
|
src/models/CryptoDeposit.ts
|
|
157
|
+
src/models/Embedding.ts
|
|
158
|
+
src/models/EmbeddingsRequest.ts
|
|
159
|
+
src/models/EmbeddingsRequestInput.ts
|
|
160
|
+
src/models/EmbeddingsResponse.ts
|
|
161
|
+
src/models/EmbeddingsUsage.ts
|
|
132
162
|
src/models/Environments.ts
|
|
133
163
|
src/models/FileObject.ts
|
|
134
164
|
src/models/FineTuningJob.ts
|
|
@@ -152,6 +182,8 @@ src/models/InstancePage.ts
|
|
|
152
182
|
src/models/ListCommunityMachines200Response.ts
|
|
153
183
|
src/models/ListDeposits200Response.ts
|
|
154
184
|
src/models/ListRegistryCredentials200Response.ts
|
|
185
|
+
src/models/MarketHistoryPoint.ts
|
|
186
|
+
src/models/MarketHistoryResponse.ts
|
|
155
187
|
src/models/Model.ts
|
|
156
188
|
src/models/ModelList.ts
|
|
157
189
|
src/models/ModelParametersInner.ts
|
|
@@ -184,6 +216,10 @@ src/models/VMImage.ts
|
|
|
184
216
|
src/models/VideoCreateRequest.ts
|
|
185
217
|
src/models/VideoJob.ts
|
|
186
218
|
src/models/VideoList.ts
|
|
219
|
+
src/models/WatchRule.ts
|
|
220
|
+
src/models/WatchRuleCreate.ts
|
|
221
|
+
src/models/WatchRulePage.ts
|
|
222
|
+
src/models/WatchRuleUpdate.ts
|
|
187
223
|
src/models/WebhookEndpoint.ts
|
|
188
224
|
src/models/WebhookEndpointPage.ts
|
|
189
225
|
src/models/index.ts
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @gpuai/sdk@0.3.
|
|
1
|
+
# @gpuai/sdk@0.3.14
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the api.gpu.ai API.
|
|
4
4
|
|
|
@@ -16,9 +16,9 @@ Next, try it out.
|
|
|
16
16
|
```ts
|
|
17
17
|
import {
|
|
18
18
|
Configuration,
|
|
19
|
-
|
|
19
|
+
AutolaunchApi,
|
|
20
20
|
} from '@gpuai/sdk';
|
|
21
|
-
import type {
|
|
21
|
+
import type { CreateAutolaunchRuleRequest } from '@gpuai/sdk';
|
|
22
22
|
|
|
23
23
|
async function example() {
|
|
24
24
|
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
@@ -26,15 +26,17 @@ async function example() {
|
|
|
26
26
|
// Configure HTTP bearer authorization: bearerAuth
|
|
27
27
|
accessToken: "YOUR BEARER TOKEN",
|
|
28
28
|
});
|
|
29
|
-
const api = new
|
|
29
|
+
const api = new AutolaunchApi(config);
|
|
30
30
|
|
|
31
31
|
const body = {
|
|
32
|
-
//
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
// AutolaunchRuleCreate
|
|
33
|
+
autolaunchRuleCreate: ...,
|
|
34
|
+
// string (optional)
|
|
35
|
+
idempotencyKey: idempotencyKey_example,
|
|
36
|
+
} satisfies CreateAutolaunchRuleRequest;
|
|
35
37
|
|
|
36
38
|
try {
|
|
37
|
-
const data = await api.
|
|
39
|
+
const data = await api.createAutolaunchRule(body);
|
|
38
40
|
console.log(data);
|
|
39
41
|
} catch (error) {
|
|
40
42
|
console.error(error);
|
|
@@ -54,6 +56,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
54
56
|
|
|
55
57
|
| Class | Method | HTTP request | Description
|
|
56
58
|
| ----- | ------ | ------------ | -------------
|
|
59
|
+
*AutolaunchApi* | [**createAutolaunchRule**](docs/AutolaunchApi.md#createautolaunchrule) | **POST** /autolaunch-rules | Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
60
|
+
*AutolaunchApi* | [**deleteAutolaunchRule**](docs/AutolaunchApi.md#deleteautolaunchrule) | **DELETE** /autolaunch-rules/{id} | Cancel an auto-launch rule
|
|
61
|
+
*AutolaunchApi* | [**disarmAutolaunchRule**](docs/AutolaunchApi.md#disarmautolaunchrule) | **PATCH** /autolaunch-rules/{id} | Disarm an auto-launch rule
|
|
62
|
+
*AutolaunchApi* | [**getAutolaunchRule**](docs/AutolaunchApi.md#getautolaunchrule) | **GET** /autolaunch-rules/{id} | Get an auto-launch rule
|
|
63
|
+
*AutolaunchApi* | [**listAutolaunchRules**](docs/AutolaunchApi.md#listautolaunchrules) | **GET** /autolaunch-rules | List auto-launch rules
|
|
57
64
|
*BillingApi* | [**createCryptoDeposit**](docs/BillingApi.md#createcryptodepositoperation) | **POST** /billing/deposits/crypto | Create a stablecoin deposit
|
|
58
65
|
*BillingApi* | [**getDeposit**](docs/BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit
|
|
59
66
|
*BillingApi* | [**getSpendingLimit**](docs/BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit
|
|
@@ -76,6 +83,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
76
83
|
*GpuTypesApi* | [**listGpuTypes**](docs/GpuTypesApi.md#listgputypes) | **GET** /gpu-types | List available GPU types (no auth required)
|
|
77
84
|
*InferenceApi* | [**cancelVideo**](docs/InferenceApi.md#cancelvideo) | **POST** /videos/{id}/cancel | Cancel a video generation job
|
|
78
85
|
*InferenceApi* | [**createChatCompletion**](docs/InferenceApi.md#createchatcompletion) | **POST** /chat/completions | Create a chat completion (OpenAI-compatible)
|
|
86
|
+
*InferenceApi* | [**createEmbeddings**](docs/InferenceApi.md#createembeddings) | **POST** /embeddings | Create embeddings (OpenAI-compatible)
|
|
79
87
|
*InferenceApi* | [**createImage**](docs/InferenceApi.md#createimage) | **POST** /images/generations | Create image (OpenAI-compatible)
|
|
80
88
|
*InferenceApi* | [**createVideo**](docs/InferenceApi.md#createvideo) | **POST** /videos | Create a video generation job (async)
|
|
81
89
|
*InferenceApi* | [**getModel**](docs/InferenceApi.md#getmodel) | **GET** /models/{id} | Get a specific model (OpenAI-compatible)
|
|
@@ -88,6 +96,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
88
96
|
*InstancesApi* | [**getInstance**](docs/InstancesApi.md#getinstance) | **GET** /instances/{id} | Get an instance
|
|
89
97
|
*InstancesApi* | [**listInstances**](docs/InstancesApi.md#listinstances) | **GET** /instances | List instances
|
|
90
98
|
*InstancesApi* | [**updateInstance**](docs/InstancesApi.md#updateinstanceoperation) | **PATCH** /instances/{id} | Update an instance (rename only in v1)
|
|
99
|
+
*MarketApi* | [**getMarketHistory**](docs/MarketApi.md#getmarkethistory) | **GET** /market-history | Get a GPU\'s price and availability over time
|
|
91
100
|
*MetaApi* | [**getHealth**](docs/MetaApi.md#gethealth) | **GET** /health | Liveness probe
|
|
92
101
|
*MetaApi* | [**getOpenApiSpec**](docs/MetaApi.md#getopenapispec) | **GET** /openapi.json | OpenAPI 3.1 specification
|
|
93
102
|
*OperationsApi* | [**getOperation**](docs/OperationsApi.md#getoperation) | **GET** /operations/{id} | Get an async operation status
|
|
@@ -102,6 +111,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
102
111
|
*TemplatesApi* | [**getTemplate**](docs/TemplatesApi.md#gettemplate) | **GET** /templates/{id} | Get one deployable application template
|
|
103
112
|
*TemplatesApi* | [**listTemplates**](docs/TemplatesApi.md#listtemplates) | **GET** /templates | List deployable application templates
|
|
104
113
|
*UsageApi* | [**listUsage**](docs/UsageApi.md#listusage) | **GET** /usage | Time-bucketed usage
|
|
114
|
+
*WatchApi* | [**createWatchRule**](docs/WatchApi.md#createwatchrule) | **POST** /watch-rules | Create a watch rule
|
|
115
|
+
*WatchApi* | [**deleteWatchRule**](docs/WatchApi.md#deletewatchrule) | **DELETE** /watch-rules/{id} | Delete a watch rule
|
|
116
|
+
*WatchApi* | [**getWatchRule**](docs/WatchApi.md#getwatchrule) | **GET** /watch-rules/{id} | Get a watch rule
|
|
117
|
+
*WatchApi* | [**listWatchRules**](docs/WatchApi.md#listwatchrules) | **GET** /watch-rules | List watch rules
|
|
118
|
+
*WatchApi* | [**updateWatchRule**](docs/WatchApi.md#updatewatchrule) | **PATCH** /watch-rules/{id} | Update a watch rule
|
|
105
119
|
*WebhooksApi* | [**createWebhookEndpoint**](docs/WebhooksApi.md#createwebhookendpointoperation) | **POST** /webhook-endpoints | Create a webhook endpoint
|
|
106
120
|
*WebhooksApi* | [**deleteWebhookEndpoint**](docs/WebhooksApi.md#deletewebhookendpoint) | **DELETE** /webhook-endpoints/{id} | Delete a webhook endpoint
|
|
107
121
|
*WebhooksApi* | [**getWebhookEndpoint**](docs/WebhooksApi.md#getwebhookendpoint) | **GET** /webhook-endpoints/{id} | Get a webhook endpoint
|
|
@@ -110,6 +124,10 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
110
124
|
|
|
111
125
|
### Models
|
|
112
126
|
|
|
127
|
+
- [AutolaunchRule](docs/AutolaunchRule.md)
|
|
128
|
+
- [AutolaunchRuleCreate](docs/AutolaunchRuleCreate.md)
|
|
129
|
+
- [AutolaunchRuleDisarm](docs/AutolaunchRuleDisarm.md)
|
|
130
|
+
- [AutolaunchRulePage](docs/AutolaunchRulePage.md)
|
|
113
131
|
- [ChatChoice](docs/ChatChoice.md)
|
|
114
132
|
- [ChatCompletionRequest](docs/ChatCompletionRequest.md)
|
|
115
133
|
- [ChatCompletionResponse](docs/ChatCompletionResponse.md)
|
|
@@ -129,6 +147,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
129
147
|
- [CreateSshKeyRequest](docs/CreateSshKeyRequest.md)
|
|
130
148
|
- [CreateWebhookEndpointRequest](docs/CreateWebhookEndpointRequest.md)
|
|
131
149
|
- [CryptoDeposit](docs/CryptoDeposit.md)
|
|
150
|
+
- [Embedding](docs/Embedding.md)
|
|
151
|
+
- [EmbeddingsRequest](docs/EmbeddingsRequest.md)
|
|
152
|
+
- [EmbeddingsRequestInput](docs/EmbeddingsRequestInput.md)
|
|
153
|
+
- [EmbeddingsResponse](docs/EmbeddingsResponse.md)
|
|
154
|
+
- [EmbeddingsUsage](docs/EmbeddingsUsage.md)
|
|
132
155
|
- [Environments](docs/Environments.md)
|
|
133
156
|
- [FileObject](docs/FileObject.md)
|
|
134
157
|
- [FineTuningJob](docs/FineTuningJob.md)
|
|
@@ -152,6 +175,8 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
152
175
|
- [ListCommunityMachines200Response](docs/ListCommunityMachines200Response.md)
|
|
153
176
|
- [ListDeposits200Response](docs/ListDeposits200Response.md)
|
|
154
177
|
- [ListRegistryCredentials200Response](docs/ListRegistryCredentials200Response.md)
|
|
178
|
+
- [MarketHistoryPoint](docs/MarketHistoryPoint.md)
|
|
179
|
+
- [MarketHistoryResponse](docs/MarketHistoryResponse.md)
|
|
155
180
|
- [Model](docs/Model.md)
|
|
156
181
|
- [ModelList](docs/ModelList.md)
|
|
157
182
|
- [ModelParametersInner](docs/ModelParametersInner.md)
|
|
@@ -184,6 +209,10 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
184
209
|
- [VideoCreateRequest](docs/VideoCreateRequest.md)
|
|
185
210
|
- [VideoJob](docs/VideoJob.md)
|
|
186
211
|
- [VideoList](docs/VideoList.md)
|
|
212
|
+
- [WatchRule](docs/WatchRule.md)
|
|
213
|
+
- [WatchRuleCreate](docs/WatchRuleCreate.md)
|
|
214
|
+
- [WatchRulePage](docs/WatchRulePage.md)
|
|
215
|
+
- [WatchRuleUpdate](docs/WatchRuleUpdate.md)
|
|
187
216
|
- [WebhookEndpoint](docs/WebhookEndpoint.md)
|
|
188
217
|
- [WebhookEndpointPage](docs/WebhookEndpointPage.md)
|
|
189
218
|
|
|
@@ -204,7 +233,7 @@ and is automatically generated by the
|
|
|
204
233
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
205
234
|
|
|
206
235
|
- API version: `1.0.0`
|
|
207
|
-
- Package version: `0.3.
|
|
236
|
+
- Package version: `0.3.14`
|
|
208
237
|
- Generator version: `7.24.0`
|
|
209
238
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
210
239
|
|
|
@@ -0,0 +1,109 @@
|
|
|
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 AutolaunchRule } from '../models/AutolaunchRule';
|
|
14
|
+
import { type AutolaunchRuleCreate } from '../models/AutolaunchRuleCreate';
|
|
15
|
+
import { type AutolaunchRuleDisarm } from '../models/AutolaunchRuleDisarm';
|
|
16
|
+
import { type AutolaunchRulePage } from '../models/AutolaunchRulePage';
|
|
17
|
+
export interface CreateAutolaunchRuleRequest {
|
|
18
|
+
autolaunchRuleCreate: AutolaunchRuleCreate;
|
|
19
|
+
idempotencyKey?: string;
|
|
20
|
+
}
|
|
21
|
+
export interface DeleteAutolaunchRuleRequest {
|
|
22
|
+
id: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DisarmAutolaunchRuleRequest {
|
|
25
|
+
id: string;
|
|
26
|
+
autolaunchRuleDisarm: AutolaunchRuleDisarm;
|
|
27
|
+
}
|
|
28
|
+
export interface GetAutolaunchRuleRequest {
|
|
29
|
+
id: string;
|
|
30
|
+
}
|
|
31
|
+
export interface ListAutolaunchRulesRequest {
|
|
32
|
+
cursor?: string;
|
|
33
|
+
limit?: number;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
*
|
|
37
|
+
*/
|
|
38
|
+
export declare class AutolaunchApi extends runtime.BaseAPI {
|
|
39
|
+
/**
|
|
40
|
+
* Creates request options for createAutolaunchRule without sending the request
|
|
41
|
+
*/
|
|
42
|
+
createAutolaunchRuleRequestOpts(requestParameters: CreateAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
43
|
+
/**
|
|
44
|
+
* 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.
|
|
45
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
46
|
+
*/
|
|
47
|
+
createAutolaunchRuleRaw(requestParameters: CreateAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
48
|
+
/**
|
|
49
|
+
* 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.
|
|
50
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
51
|
+
*/
|
|
52
|
+
createAutolaunchRule(requestParameters: CreateAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
53
|
+
/**
|
|
54
|
+
* Creates request options for deleteAutolaunchRule without sending the request
|
|
55
|
+
*/
|
|
56
|
+
deleteAutolaunchRuleRequestOpts(requestParameters: DeleteAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
57
|
+
/**
|
|
58
|
+
* 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.
|
|
59
|
+
* Cancel an auto-launch rule
|
|
60
|
+
*/
|
|
61
|
+
deleteAutolaunchRuleRaw(requestParameters: DeleteAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
|
|
62
|
+
/**
|
|
63
|
+
* 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.
|
|
64
|
+
* Cancel an auto-launch rule
|
|
65
|
+
*/
|
|
66
|
+
deleteAutolaunchRule(requestParameters: DeleteAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates request options for disarmAutolaunchRule without sending the request
|
|
69
|
+
*/
|
|
70
|
+
disarmAutolaunchRuleRequestOpts(requestParameters: DisarmAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
71
|
+
/**
|
|
72
|
+
* 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.
|
|
73
|
+
* Disarm an auto-launch rule
|
|
74
|
+
*/
|
|
75
|
+
disarmAutolaunchRuleRaw(requestParameters: DisarmAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
76
|
+
/**
|
|
77
|
+
* 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.
|
|
78
|
+
* Disarm an auto-launch rule
|
|
79
|
+
*/
|
|
80
|
+
disarmAutolaunchRule(requestParameters: DisarmAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
81
|
+
/**
|
|
82
|
+
* Creates request options for getAutolaunchRule without sending the request
|
|
83
|
+
*/
|
|
84
|
+
getAutolaunchRuleRequestOpts(requestParameters: GetAutolaunchRuleRequest): Promise<runtime.RequestOpts>;
|
|
85
|
+
/**
|
|
86
|
+
* 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.
|
|
87
|
+
* Get an auto-launch rule
|
|
88
|
+
*/
|
|
89
|
+
getAutolaunchRuleRaw(requestParameters: GetAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRule>>;
|
|
90
|
+
/**
|
|
91
|
+
* 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.
|
|
92
|
+
* Get an auto-launch rule
|
|
93
|
+
*/
|
|
94
|
+
getAutolaunchRule(requestParameters: GetAutolaunchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRule>;
|
|
95
|
+
/**
|
|
96
|
+
* Creates request options for listAutolaunchRules without sending the request
|
|
97
|
+
*/
|
|
98
|
+
listAutolaunchRulesRequestOpts(requestParameters: ListAutolaunchRulesRequest): Promise<runtime.RequestOpts>;
|
|
99
|
+
/**
|
|
100
|
+
* 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.
|
|
101
|
+
* List auto-launch rules
|
|
102
|
+
*/
|
|
103
|
+
listAutolaunchRulesRaw(requestParameters: ListAutolaunchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<AutolaunchRulePage>>;
|
|
104
|
+
/**
|
|
105
|
+
* 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.
|
|
106
|
+
* List auto-launch rules
|
|
107
|
+
*/
|
|
108
|
+
listAutolaunchRules(requestParameters?: ListAutolaunchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<AutolaunchRulePage>;
|
|
109
|
+
}
|
|
@@ -0,0 +1,286 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
/**
|
|
5
|
+
* GPU.ai Public Developer API
|
|
6
|
+
* Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
|
|
7
|
+
*
|
|
8
|
+
* The version of the OpenAPI document: 1.0.0
|
|
9
|
+
* Contact: support@gpu.ai
|
|
10
|
+
*
|
|
11
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
+
* https://openapi-generator.tech
|
|
13
|
+
* Do not edit the class manually.
|
|
14
|
+
*/
|
|
15
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
16
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
18
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
19
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
20
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
21
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
22
|
+
});
|
|
23
|
+
};
|
|
24
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
25
|
+
exports.AutolaunchApi = void 0;
|
|
26
|
+
const runtime = require("../runtime");
|
|
27
|
+
const AutolaunchRule_1 = require("../models/AutolaunchRule");
|
|
28
|
+
const AutolaunchRuleCreate_1 = require("../models/AutolaunchRuleCreate");
|
|
29
|
+
const AutolaunchRuleDisarm_1 = require("../models/AutolaunchRuleDisarm");
|
|
30
|
+
const AutolaunchRulePage_1 = require("../models/AutolaunchRulePage");
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
class AutolaunchApi extends runtime.BaseAPI {
|
|
35
|
+
/**
|
|
36
|
+
* Creates request options for createAutolaunchRule without sending the request
|
|
37
|
+
*/
|
|
38
|
+
createAutolaunchRuleRequestOpts(requestParameters) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
if (requestParameters['autolaunchRuleCreate'] == null) {
|
|
41
|
+
throw new runtime.RequiredError('autolaunchRuleCreate', 'Required parameter "autolaunchRuleCreate" was null or undefined when calling createAutolaunchRule().');
|
|
42
|
+
}
|
|
43
|
+
const queryParameters = {};
|
|
44
|
+
const headerParameters = {};
|
|
45
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
46
|
+
if (requestParameters['idempotencyKey'] != null) {
|
|
47
|
+
headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
|
|
48
|
+
}
|
|
49
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
50
|
+
const token = this.configuration.accessToken;
|
|
51
|
+
const tokenString = yield token("bearerAuth", []);
|
|
52
|
+
if (tokenString) {
|
|
53
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
let urlPath = `/autolaunch-rules`;
|
|
57
|
+
return {
|
|
58
|
+
path: urlPath,
|
|
59
|
+
method: 'POST',
|
|
60
|
+
headers: headerParameters,
|
|
61
|
+
query: queryParameters,
|
|
62
|
+
body: (0, AutolaunchRuleCreate_1.AutolaunchRuleCreateToJSON)(requestParameters['autolaunchRuleCreate']),
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* 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.
|
|
68
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
69
|
+
*/
|
|
70
|
+
createAutolaunchRuleRaw(requestParameters, initOverrides) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
72
|
+
const requestOptions = yield this.createAutolaunchRuleRequestOpts(requestParameters);
|
|
73
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
74
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, AutolaunchRule_1.AutolaunchRuleFromJSON)(jsonValue));
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* 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.
|
|
79
|
+
* Create an auto-launch rule (pre-approves a bounded, unattended spend)
|
|
80
|
+
*/
|
|
81
|
+
createAutolaunchRule(requestParameters, initOverrides) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
83
|
+
const response = yield this.createAutolaunchRuleRaw(requestParameters, initOverrides);
|
|
84
|
+
return yield response.value();
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Creates request options for deleteAutolaunchRule without sending the request
|
|
89
|
+
*/
|
|
90
|
+
deleteAutolaunchRuleRequestOpts(requestParameters) {
|
|
91
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
92
|
+
if (requestParameters['id'] == null) {
|
|
93
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteAutolaunchRule().');
|
|
94
|
+
}
|
|
95
|
+
const queryParameters = {};
|
|
96
|
+
const headerParameters = {};
|
|
97
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
98
|
+
const token = this.configuration.accessToken;
|
|
99
|
+
const tokenString = yield token("bearerAuth", []);
|
|
100
|
+
if (tokenString) {
|
|
101
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
let urlPath = `/autolaunch-rules/{id}`;
|
|
105
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
106
|
+
return {
|
|
107
|
+
path: urlPath,
|
|
108
|
+
method: 'DELETE',
|
|
109
|
+
headers: headerParameters,
|
|
110
|
+
query: queryParameters,
|
|
111
|
+
};
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* 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.
|
|
116
|
+
* Cancel an auto-launch rule
|
|
117
|
+
*/
|
|
118
|
+
deleteAutolaunchRuleRaw(requestParameters, initOverrides) {
|
|
119
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
120
|
+
const requestOptions = yield this.deleteAutolaunchRuleRequestOpts(requestParameters);
|
|
121
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
122
|
+
return new runtime.VoidApiResponse(response);
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
/**
|
|
126
|
+
* 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.
|
|
127
|
+
* Cancel an auto-launch rule
|
|
128
|
+
*/
|
|
129
|
+
deleteAutolaunchRule(requestParameters, initOverrides) {
|
|
130
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
131
|
+
yield this.deleteAutolaunchRuleRaw(requestParameters, initOverrides);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Creates request options for disarmAutolaunchRule without sending the request
|
|
136
|
+
*/
|
|
137
|
+
disarmAutolaunchRuleRequestOpts(requestParameters) {
|
|
138
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
139
|
+
if (requestParameters['id'] == null) {
|
|
140
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling disarmAutolaunchRule().');
|
|
141
|
+
}
|
|
142
|
+
if (requestParameters['autolaunchRuleDisarm'] == null) {
|
|
143
|
+
throw new runtime.RequiredError('autolaunchRuleDisarm', 'Required parameter "autolaunchRuleDisarm" was null or undefined when calling disarmAutolaunchRule().');
|
|
144
|
+
}
|
|
145
|
+
const queryParameters = {};
|
|
146
|
+
const headerParameters = {};
|
|
147
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
148
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
149
|
+
const token = this.configuration.accessToken;
|
|
150
|
+
const tokenString = yield token("bearerAuth", []);
|
|
151
|
+
if (tokenString) {
|
|
152
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
let urlPath = `/autolaunch-rules/{id}`;
|
|
156
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
157
|
+
return {
|
|
158
|
+
path: urlPath,
|
|
159
|
+
method: 'PATCH',
|
|
160
|
+
headers: headerParameters,
|
|
161
|
+
query: queryParameters,
|
|
162
|
+
body: (0, AutolaunchRuleDisarm_1.AutolaunchRuleDisarmToJSON)(requestParameters['autolaunchRuleDisarm']),
|
|
163
|
+
};
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* 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.
|
|
168
|
+
* Disarm an auto-launch rule
|
|
169
|
+
*/
|
|
170
|
+
disarmAutolaunchRuleRaw(requestParameters, initOverrides) {
|
|
171
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
172
|
+
const requestOptions = yield this.disarmAutolaunchRuleRequestOpts(requestParameters);
|
|
173
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
174
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, AutolaunchRule_1.AutolaunchRuleFromJSON)(jsonValue));
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* 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.
|
|
179
|
+
* Disarm an auto-launch rule
|
|
180
|
+
*/
|
|
181
|
+
disarmAutolaunchRule(requestParameters, initOverrides) {
|
|
182
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
183
|
+
const response = yield this.disarmAutolaunchRuleRaw(requestParameters, initOverrides);
|
|
184
|
+
return yield response.value();
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
/**
|
|
188
|
+
* Creates request options for getAutolaunchRule without sending the request
|
|
189
|
+
*/
|
|
190
|
+
getAutolaunchRuleRequestOpts(requestParameters) {
|
|
191
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
192
|
+
if (requestParameters['id'] == null) {
|
|
193
|
+
throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getAutolaunchRule().');
|
|
194
|
+
}
|
|
195
|
+
const queryParameters = {};
|
|
196
|
+
const headerParameters = {};
|
|
197
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
198
|
+
const token = this.configuration.accessToken;
|
|
199
|
+
const tokenString = yield token("bearerAuth", []);
|
|
200
|
+
if (tokenString) {
|
|
201
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
let urlPath = `/autolaunch-rules/{id}`;
|
|
205
|
+
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
206
|
+
return {
|
|
207
|
+
path: urlPath,
|
|
208
|
+
method: 'GET',
|
|
209
|
+
headers: headerParameters,
|
|
210
|
+
query: queryParameters,
|
|
211
|
+
};
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* 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.
|
|
216
|
+
* Get an auto-launch rule
|
|
217
|
+
*/
|
|
218
|
+
getAutolaunchRuleRaw(requestParameters, initOverrides) {
|
|
219
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
220
|
+
const requestOptions = yield this.getAutolaunchRuleRequestOpts(requestParameters);
|
|
221
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
222
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, AutolaunchRule_1.AutolaunchRuleFromJSON)(jsonValue));
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* 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.
|
|
227
|
+
* Get an auto-launch rule
|
|
228
|
+
*/
|
|
229
|
+
getAutolaunchRule(requestParameters, initOverrides) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
231
|
+
const response = yield this.getAutolaunchRuleRaw(requestParameters, initOverrides);
|
|
232
|
+
return yield response.value();
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Creates request options for listAutolaunchRules without sending the request
|
|
237
|
+
*/
|
|
238
|
+
listAutolaunchRulesRequestOpts(requestParameters) {
|
|
239
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
240
|
+
const queryParameters = {};
|
|
241
|
+
if (requestParameters['cursor'] != null) {
|
|
242
|
+
queryParameters['cursor'] = requestParameters['cursor'];
|
|
243
|
+
}
|
|
244
|
+
if (requestParameters['limit'] != null) {
|
|
245
|
+
queryParameters['limit'] = requestParameters['limit'];
|
|
246
|
+
}
|
|
247
|
+
const headerParameters = {};
|
|
248
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
249
|
+
const token = this.configuration.accessToken;
|
|
250
|
+
const tokenString = yield token("bearerAuth", []);
|
|
251
|
+
if (tokenString) {
|
|
252
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
let urlPath = `/autolaunch-rules`;
|
|
256
|
+
return {
|
|
257
|
+
path: urlPath,
|
|
258
|
+
method: 'GET',
|
|
259
|
+
headers: headerParameters,
|
|
260
|
+
query: queryParameters,
|
|
261
|
+
};
|
|
262
|
+
});
|
|
263
|
+
}
|
|
264
|
+
/**
|
|
265
|
+
* 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.
|
|
266
|
+
* List auto-launch rules
|
|
267
|
+
*/
|
|
268
|
+
listAutolaunchRulesRaw(requestParameters, initOverrides) {
|
|
269
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
const requestOptions = yield this.listAutolaunchRulesRequestOpts(requestParameters);
|
|
271
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
272
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, AutolaunchRulePage_1.AutolaunchRulePageFromJSON)(jsonValue));
|
|
273
|
+
});
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* 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.
|
|
277
|
+
* List auto-launch rules
|
|
278
|
+
*/
|
|
279
|
+
listAutolaunchRules() {
|
|
280
|
+
return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
|
|
281
|
+
const response = yield this.listAutolaunchRulesRaw(requestParameters, initOverrides);
|
|
282
|
+
return yield response.value();
|
|
283
|
+
});
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
exports.AutolaunchApi = AutolaunchApi;
|