@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.
Files changed (108) hide show
  1. package/.openapi-generator/FILES +28 -0
  2. package/README.md +34 -9
  3. package/dist/apis/AutolaunchApi.d.ts +109 -0
  4. package/dist/apis/AutolaunchApi.js +286 -0
  5. package/dist/apis/BillingApi.d.ts +15 -0
  6. package/dist/apis/BillingApi.js +45 -0
  7. package/dist/apis/MarketApi.d.ts +56 -0
  8. package/dist/apis/MarketApi.js +112 -0
  9. package/dist/apis/WatchApi.d.ts +109 -0
  10. package/dist/apis/WatchApi.js +286 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +3 -0
  13. package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
  14. package/dist/esm/apis/AutolaunchApi.js +282 -0
  15. package/dist/esm/apis/BillingApi.d.ts +15 -0
  16. package/dist/esm/apis/BillingApi.js +45 -0
  17. package/dist/esm/apis/MarketApi.d.ts +56 -0
  18. package/dist/esm/apis/MarketApi.js +108 -0
  19. package/dist/esm/apis/WatchApi.d.ts +109 -0
  20. package/dist/esm/apis/WatchApi.js +282 -0
  21. package/dist/esm/apis/index.d.ts +3 -0
  22. package/dist/esm/apis/index.js +3 -0
  23. package/dist/esm/models/AutolaunchRule.d.ts +181 -0
  24. package/dist/esm/models/AutolaunchRule.js +142 -0
  25. package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
  26. package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
  27. package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
  28. package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
  29. package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
  30. package/dist/esm/models/AutolaunchRulePage.js +48 -0
  31. package/dist/esm/models/Balance.d.ts +65 -0
  32. package/dist/esm/models/Balance.js +63 -0
  33. package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
  34. package/dist/esm/models/MarketHistoryPoint.js +55 -0
  35. package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
  36. package/dist/esm/models/MarketHistoryResponse.js +60 -0
  37. package/dist/esm/models/Problem.d.ts +1 -0
  38. package/dist/esm/models/Problem.js +1 -0
  39. package/dist/esm/models/WatchRule.d.ts +141 -0
  40. package/dist/esm/models/WatchRule.js +117 -0
  41. package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
  42. package/dist/esm/models/WatchRuleCreate.js +72 -0
  43. package/dist/esm/models/WatchRulePage.d.ts +39 -0
  44. package/dist/esm/models/WatchRulePage.js +48 -0
  45. package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
  46. package/dist/esm/models/WatchRuleUpdate.js +68 -0
  47. package/dist/esm/models/index.d.ts +11 -0
  48. package/dist/esm/models/index.js +11 -0
  49. package/dist/models/AutolaunchRule.d.ts +181 -0
  50. package/dist/models/AutolaunchRule.js +150 -0
  51. package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
  52. package/dist/models/AutolaunchRuleCreate.js +92 -0
  53. package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
  54. package/dist/models/AutolaunchRuleDisarm.js +50 -0
  55. package/dist/models/AutolaunchRulePage.d.ts +39 -0
  56. package/dist/models/AutolaunchRulePage.js +55 -0
  57. package/dist/models/Balance.d.ts +65 -0
  58. package/dist/models/Balance.js +70 -0
  59. package/dist/models/MarketHistoryPoint.d.ts +59 -0
  60. package/dist/models/MarketHistoryPoint.js +62 -0
  61. package/dist/models/MarketHistoryResponse.d.ts +60 -0
  62. package/dist/models/MarketHistoryResponse.js +67 -0
  63. package/dist/models/Problem.d.ts +1 -0
  64. package/dist/models/Problem.js +1 -0
  65. package/dist/models/WatchRule.d.ts +141 -0
  66. package/dist/models/WatchRule.js +125 -0
  67. package/dist/models/WatchRuleCreate.d.ts +87 -0
  68. package/dist/models/WatchRuleCreate.js +80 -0
  69. package/dist/models/WatchRulePage.d.ts +39 -0
  70. package/dist/models/WatchRulePage.js +55 -0
  71. package/dist/models/WatchRuleUpdate.d.ts +86 -0
  72. package/dist/models/WatchRuleUpdate.js +76 -0
  73. package/dist/models/index.d.ts +11 -0
  74. package/dist/models/index.js +11 -0
  75. package/docs/AutolaunchApi.md +390 -0
  76. package/docs/AutolaunchRule.md +69 -0
  77. package/docs/AutolaunchRuleCreate.md +50 -0
  78. package/docs/AutolaunchRuleDisarm.md +35 -0
  79. package/docs/AutolaunchRulePage.md +36 -0
  80. package/docs/Balance.md +45 -0
  81. package/docs/BillingApi.md +66 -0
  82. package/docs/MarketApi.md +98 -0
  83. package/docs/MarketHistoryPoint.md +43 -0
  84. package/docs/MarketHistoryResponse.md +43 -0
  85. package/docs/WatchApi.md +389 -0
  86. package/docs/WatchRule.md +61 -0
  87. package/docs/WatchRuleCreate.md +46 -0
  88. package/docs/WatchRulePage.md +36 -0
  89. package/docs/WatchRuleUpdate.md +47 -0
  90. package/package.json +1 -1
  91. package/src/apis/AutolaunchApi.ts +360 -0
  92. package/src/apis/BillingApi.ts +52 -0
  93. package/src/apis/MarketApi.ts +136 -0
  94. package/src/apis/WatchApi.ts +360 -0
  95. package/src/apis/index.ts +3 -0
  96. package/src/models/AutolaunchRule.ts +270 -0
  97. package/src/models/AutolaunchRuleCreate.ts +162 -0
  98. package/src/models/AutolaunchRuleDisarm.ts +68 -0
  99. package/src/models/AutolaunchRulePage.ts +83 -0
  100. package/src/models/Balance.ts +114 -0
  101. package/src/models/MarketHistoryPoint.ts +103 -0
  102. package/src/models/MarketHistoryResponse.ts +113 -0
  103. package/src/models/Problem.ts +1 -0
  104. package/src/models/WatchRule.ts +219 -0
  105. package/src/models/WatchRuleCreate.ts +138 -0
  106. package/src/models/WatchRulePage.ts +83 -0
  107. package/src/models/WatchRuleUpdate.ts +135 -0
  108. package/src/models/index.ts +11 -0
@@ -1,6 +1,12 @@
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
9
+ docs/Balance.md
4
10
  docs/BillingApi.md
5
11
  docs/ChatChoice.md
6
12
  docs/ChatCompletionRequest.md
@@ -55,6 +61,9 @@ docs/InstancesApi.md
55
61
  docs/ListCommunityMachines200Response.md
56
62
  docs/ListDeposits200Response.md
57
63
  docs/ListRegistryCredentials200Response.md
64
+ docs/MarketApi.md
65
+ docs/MarketHistoryPoint.md
66
+ docs/MarketHistoryResponse.md
58
67
  docs/MetaApi.md
59
68
  docs/Model.md
60
69
  docs/ModelList.md
@@ -94,10 +103,16 @@ docs/VMImage.md
94
103
  docs/VideoCreateRequest.md
95
104
  docs/VideoJob.md
96
105
  docs/VideoList.md
106
+ docs/WatchApi.md
107
+ docs/WatchRule.md
108
+ docs/WatchRuleCreate.md
109
+ docs/WatchRulePage.md
110
+ docs/WatchRuleUpdate.md
97
111
  docs/WebhookEndpoint.md
98
112
  docs/WebhookEndpointPage.md
99
113
  docs/WebhooksApi.md
100
114
  package.json
115
+ src/apis/AutolaunchApi.ts
101
116
  src/apis/BillingApi.ts
102
117
  src/apis/CommunityApi.ts
103
118
  src/apis/EnvironmentsApi.ts
@@ -105,6 +120,7 @@ src/apis/FineTuningApi.ts
105
120
  src/apis/GpuTypesApi.ts
106
121
  src/apis/InferenceApi.ts
107
122
  src/apis/InstancesApi.ts
123
+ src/apis/MarketApi.ts
108
124
  src/apis/MetaApi.ts
109
125
  src/apis/OperationsApi.ts
110
126
  src/apis/PricingApi.ts
@@ -112,9 +128,15 @@ src/apis/RegistryCredentialsApi.ts
112
128
  src/apis/SshKeysApi.ts
113
129
  src/apis/TemplatesApi.ts
114
130
  src/apis/UsageApi.ts
131
+ src/apis/WatchApi.ts
115
132
  src/apis/WebhooksApi.ts
116
133
  src/apis/index.ts
117
134
  src/index.ts
135
+ src/models/AutolaunchRule.ts
136
+ src/models/AutolaunchRuleCreate.ts
137
+ src/models/AutolaunchRuleDisarm.ts
138
+ src/models/AutolaunchRulePage.ts
139
+ src/models/Balance.ts
118
140
  src/models/ChatChoice.ts
119
141
  src/models/ChatCompletionRequest.ts
120
142
  src/models/ChatCompletionResponse.ts
@@ -162,6 +184,8 @@ src/models/InstancePage.ts
162
184
  src/models/ListCommunityMachines200Response.ts
163
185
  src/models/ListDeposits200Response.ts
164
186
  src/models/ListRegistryCredentials200Response.ts
187
+ src/models/MarketHistoryPoint.ts
188
+ src/models/MarketHistoryResponse.ts
165
189
  src/models/Model.ts
166
190
  src/models/ModelList.ts
167
191
  src/models/ModelParametersInner.ts
@@ -194,6 +218,10 @@ src/models/VMImage.ts
194
218
  src/models/VideoCreateRequest.ts
195
219
  src/models/VideoJob.ts
196
220
  src/models/VideoList.ts
221
+ src/models/WatchRule.ts
222
+ src/models/WatchRuleCreate.ts
223
+ src/models/WatchRulePage.ts
224
+ src/models/WatchRuleUpdate.ts
197
225
  src/models/WebhookEndpoint.ts
198
226
  src/models/WebhookEndpointPage.ts
199
227
  src/models/index.ts
package/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # @gpuai/sdk@0.3.13
1
+ # @gpuai/sdk@0.3.15
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
- BillingApi,
19
+ AutolaunchApi,
20
20
  } from '@gpuai/sdk';
21
- import type { CreateCryptoDepositOperationRequest } from '@gpuai/sdk';
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 BillingApi(config);
29
+ const api = new AutolaunchApi(config);
30
30
 
31
31
  const body = {
32
- // CreateCryptoDepositRequest
33
- createCryptoDepositRequest: ...,
34
- } satisfies CreateCryptoDepositOperationRequest;
32
+ // AutolaunchRuleCreate
33
+ autolaunchRuleCreate: ...,
34
+ // string (optional)
35
+ idempotencyKey: idempotencyKey_example,
36
+ } satisfies CreateAutolaunchRuleRequest;
35
37
 
36
38
  try {
37
- const data = await api.createCryptoDeposit(body);
39
+ const data = await api.createAutolaunchRule(body);
38
40
  console.log(data);
39
41
  } catch (error) {
40
42
  console.error(error);
@@ -54,7 +56,13 @@ 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
65
+ *BillingApi* | [**getBalance**](docs/BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance
58
66
  *BillingApi* | [**getDeposit**](docs/BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit
59
67
  *BillingApi* | [**getSpendingLimit**](docs/BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit
60
68
  *BillingApi* | [**listDeposits**](docs/BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits
@@ -89,6 +97,7 @@ All URIs are relative to *https://api.gpu.ai/v1*
89
97
  *InstancesApi* | [**getInstance**](docs/InstancesApi.md#getinstance) | **GET** /instances/{id} | Get an instance
90
98
  *InstancesApi* | [**listInstances**](docs/InstancesApi.md#listinstances) | **GET** /instances | List instances
91
99
  *InstancesApi* | [**updateInstance**](docs/InstancesApi.md#updateinstanceoperation) | **PATCH** /instances/{id} | Update an instance (rename only in v1)
100
+ *MarketApi* | [**getMarketHistory**](docs/MarketApi.md#getmarkethistory) | **GET** /market-history | Get a GPU\'s price and availability over time
92
101
  *MetaApi* | [**getHealth**](docs/MetaApi.md#gethealth) | **GET** /health | Liveness probe
93
102
  *MetaApi* | [**getOpenApiSpec**](docs/MetaApi.md#getopenapispec) | **GET** /openapi.json | OpenAPI 3.1 specification
94
103
  *OperationsApi* | [**getOperation**](docs/OperationsApi.md#getoperation) | **GET** /operations/{id} | Get an async operation status
@@ -103,6 +112,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
103
112
  *TemplatesApi* | [**getTemplate**](docs/TemplatesApi.md#gettemplate) | **GET** /templates/{id} | Get one deployable application template
104
113
  *TemplatesApi* | [**listTemplates**](docs/TemplatesApi.md#listtemplates) | **GET** /templates | List deployable application templates
105
114
  *UsageApi* | [**listUsage**](docs/UsageApi.md#listusage) | **GET** /usage | Time-bucketed usage
115
+ *WatchApi* | [**createWatchRule**](docs/WatchApi.md#createwatchrule) | **POST** /watch-rules | Create a watch rule
116
+ *WatchApi* | [**deleteWatchRule**](docs/WatchApi.md#deletewatchrule) | **DELETE** /watch-rules/{id} | Delete a watch rule
117
+ *WatchApi* | [**getWatchRule**](docs/WatchApi.md#getwatchrule) | **GET** /watch-rules/{id} | Get a watch rule
118
+ *WatchApi* | [**listWatchRules**](docs/WatchApi.md#listwatchrules) | **GET** /watch-rules | List watch rules
119
+ *WatchApi* | [**updateWatchRule**](docs/WatchApi.md#updatewatchrule) | **PATCH** /watch-rules/{id} | Update a watch rule
106
120
  *WebhooksApi* | [**createWebhookEndpoint**](docs/WebhooksApi.md#createwebhookendpointoperation) | **POST** /webhook-endpoints | Create a webhook endpoint
107
121
  *WebhooksApi* | [**deleteWebhookEndpoint**](docs/WebhooksApi.md#deletewebhookendpoint) | **DELETE** /webhook-endpoints/{id} | Delete a webhook endpoint
108
122
  *WebhooksApi* | [**getWebhookEndpoint**](docs/WebhooksApi.md#getwebhookendpoint) | **GET** /webhook-endpoints/{id} | Get a webhook endpoint
@@ -111,6 +125,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
111
125
 
112
126
  ### Models
113
127
 
128
+ - [AutolaunchRule](docs/AutolaunchRule.md)
129
+ - [AutolaunchRuleCreate](docs/AutolaunchRuleCreate.md)
130
+ - [AutolaunchRuleDisarm](docs/AutolaunchRuleDisarm.md)
131
+ - [AutolaunchRulePage](docs/AutolaunchRulePage.md)
132
+ - [Balance](docs/Balance.md)
114
133
  - [ChatChoice](docs/ChatChoice.md)
115
134
  - [ChatCompletionRequest](docs/ChatCompletionRequest.md)
116
135
  - [ChatCompletionResponse](docs/ChatCompletionResponse.md)
@@ -158,6 +177,8 @@ All URIs are relative to *https://api.gpu.ai/v1*
158
177
  - [ListCommunityMachines200Response](docs/ListCommunityMachines200Response.md)
159
178
  - [ListDeposits200Response](docs/ListDeposits200Response.md)
160
179
  - [ListRegistryCredentials200Response](docs/ListRegistryCredentials200Response.md)
180
+ - [MarketHistoryPoint](docs/MarketHistoryPoint.md)
181
+ - [MarketHistoryResponse](docs/MarketHistoryResponse.md)
161
182
  - [Model](docs/Model.md)
162
183
  - [ModelList](docs/ModelList.md)
163
184
  - [ModelParametersInner](docs/ModelParametersInner.md)
@@ -190,6 +211,10 @@ All URIs are relative to *https://api.gpu.ai/v1*
190
211
  - [VideoCreateRequest](docs/VideoCreateRequest.md)
191
212
  - [VideoJob](docs/VideoJob.md)
192
213
  - [VideoList](docs/VideoList.md)
214
+ - [WatchRule](docs/WatchRule.md)
215
+ - [WatchRuleCreate](docs/WatchRuleCreate.md)
216
+ - [WatchRulePage](docs/WatchRulePage.md)
217
+ - [WatchRuleUpdate](docs/WatchRuleUpdate.md)
193
218
  - [WebhookEndpoint](docs/WebhookEndpoint.md)
194
219
  - [WebhookEndpointPage](docs/WebhookEndpointPage.md)
195
220
 
@@ -210,7 +235,7 @@ and is automatically generated by the
210
235
  [OpenAPI Generator](https://openapi-generator.tech) project:
211
236
 
212
237
  - API version: `1.0.0`
213
- - Package version: `0.3.13`
238
+ - Package version: `0.3.15`
214
239
  - Generator version: `7.24.0`
215
240
  - Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
216
241
 
@@ -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;
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import * as runtime from '../runtime';
13
+ import { type Balance } from '../models/Balance';
13
14
  import { type CreateCryptoDepositRequest } from '../models/CreateCryptoDepositRequest';
14
15
  import { type CryptoDeposit } from '../models/CryptoDeposit';
15
16
  import { type ListDeposits200Response } from '../models/ListDeposits200Response';
@@ -42,6 +43,20 @@ export declare class BillingApi extends runtime.BaseAPI {
42
43
  * Create a stablecoin deposit
43
44
  */
44
45
  createCryptoDeposit(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit>;
46
+ /**
47
+ * Creates request options for getBalance without sending the request
48
+ */
49
+ getBalanceRequestOpts(): Promise<runtime.RequestOpts>;
50
+ /**
51
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
52
+ * Get the org credit balance
53
+ */
54
+ getBalanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>>;
55
+ /**
56
+ * Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
57
+ * Get the org credit balance
58
+ */
59
+ getBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance>;
45
60
  /**
46
61
  * Creates request options for getDeposit without sending the request
47
62
  */