@gpuai/sdk 0.3.12 → 0.3.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/.openapi-generator/FILES +36 -0
  2. package/README.md +38 -9
  3. package/dist/apis/AutolaunchApi.d.ts +109 -0
  4. package/dist/apis/AutolaunchApi.js +286 -0
  5. package/dist/apis/InferenceApi.d.ts +19 -0
  6. package/dist/apis/InferenceApi.js +51 -0
  7. package/dist/apis/MarketApi.d.ts +56 -0
  8. package/dist/apis/MarketApi.js +112 -0
  9. package/dist/apis/WatchApi.d.ts +109 -0
  10. package/dist/apis/WatchApi.js +286 -0
  11. package/dist/apis/index.d.ts +3 -0
  12. package/dist/apis/index.js +3 -0
  13. package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
  14. package/dist/esm/apis/AutolaunchApi.js +282 -0
  15. package/dist/esm/apis/InferenceApi.d.ts +19 -0
  16. package/dist/esm/apis/InferenceApi.js +51 -0
  17. package/dist/esm/apis/MarketApi.d.ts +56 -0
  18. package/dist/esm/apis/MarketApi.js +108 -0
  19. package/dist/esm/apis/WatchApi.d.ts +109 -0
  20. package/dist/esm/apis/WatchApi.js +282 -0
  21. package/dist/esm/apis/index.d.ts +3 -0
  22. package/dist/esm/apis/index.js +3 -0
  23. package/dist/esm/models/AutolaunchRule.d.ts +181 -0
  24. package/dist/esm/models/AutolaunchRule.js +142 -0
  25. package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
  26. package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
  27. package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
  28. package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
  29. package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
  30. package/dist/esm/models/AutolaunchRulePage.js +48 -0
  31. package/dist/esm/models/Embedding.d.ts +51 -0
  32. package/dist/esm/models/Embedding.js +59 -0
  33. package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
  34. package/dist/esm/models/EmbeddingsRequest.js +60 -0
  35. package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
  36. package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
  37. package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
  38. package/dist/esm/models/EmbeddingsResponse.js +65 -0
  39. package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
  40. package/dist/esm/models/EmbeddingsUsage.js +47 -0
  41. package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
  42. package/dist/esm/models/MarketHistoryPoint.js +55 -0
  43. package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
  44. package/dist/esm/models/MarketHistoryResponse.js +60 -0
  45. package/dist/esm/models/Problem.d.ts +1 -0
  46. package/dist/esm/models/Problem.js +1 -0
  47. package/dist/esm/models/WatchRule.d.ts +141 -0
  48. package/dist/esm/models/WatchRule.js +117 -0
  49. package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
  50. package/dist/esm/models/WatchRuleCreate.js +72 -0
  51. package/dist/esm/models/WatchRulePage.d.ts +39 -0
  52. package/dist/esm/models/WatchRulePage.js +48 -0
  53. package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
  54. package/dist/esm/models/WatchRuleUpdate.js +68 -0
  55. package/dist/esm/models/index.d.ts +15 -0
  56. package/dist/esm/models/index.js +15 -0
  57. package/dist/models/AutolaunchRule.d.ts +181 -0
  58. package/dist/models/AutolaunchRule.js +150 -0
  59. package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
  60. package/dist/models/AutolaunchRuleCreate.js +92 -0
  61. package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
  62. package/dist/models/AutolaunchRuleDisarm.js +50 -0
  63. package/dist/models/AutolaunchRulePage.d.ts +39 -0
  64. package/dist/models/AutolaunchRulePage.js +55 -0
  65. package/dist/models/Embedding.d.ts +51 -0
  66. package/dist/models/Embedding.js +67 -0
  67. package/dist/models/EmbeddingsRequest.d.ts +64 -0
  68. package/dist/models/EmbeddingsRequest.js +68 -0
  69. package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
  70. package/dist/models/EmbeddingsRequestInput.js +53 -0
  71. package/dist/models/EmbeddingsResponse.d.ts +59 -0
  72. package/dist/models/EmbeddingsResponse.js +73 -0
  73. package/dist/models/EmbeddingsUsage.d.ts +38 -0
  74. package/dist/models/EmbeddingsUsage.js +54 -0
  75. package/dist/models/MarketHistoryPoint.d.ts +59 -0
  76. package/dist/models/MarketHistoryPoint.js +62 -0
  77. package/dist/models/MarketHistoryResponse.d.ts +60 -0
  78. package/dist/models/MarketHistoryResponse.js +67 -0
  79. package/dist/models/Problem.d.ts +1 -0
  80. package/dist/models/Problem.js +1 -0
  81. package/dist/models/WatchRule.d.ts +141 -0
  82. package/dist/models/WatchRule.js +125 -0
  83. package/dist/models/WatchRuleCreate.d.ts +87 -0
  84. package/dist/models/WatchRuleCreate.js +80 -0
  85. package/dist/models/WatchRulePage.d.ts +39 -0
  86. package/dist/models/WatchRulePage.js +55 -0
  87. package/dist/models/WatchRuleUpdate.d.ts +86 -0
  88. package/dist/models/WatchRuleUpdate.js +76 -0
  89. package/dist/models/index.d.ts +15 -0
  90. package/dist/models/index.js +15 -0
  91. package/docs/AutolaunchApi.md +390 -0
  92. package/docs/AutolaunchRule.md +69 -0
  93. package/docs/AutolaunchRuleCreate.md +50 -0
  94. package/docs/AutolaunchRuleDisarm.md +35 -0
  95. package/docs/AutolaunchRulePage.md +36 -0
  96. package/docs/Embedding.md +38 -0
  97. package/docs/EmbeddingsRequest.md +42 -0
  98. package/docs/EmbeddingsRequestInput.md +33 -0
  99. package/docs/EmbeddingsResponse.md +40 -0
  100. package/docs/EmbeddingsUsage.md +37 -0
  101. package/docs/InferenceApi.md +83 -0
  102. package/docs/MarketApi.md +98 -0
  103. package/docs/MarketHistoryPoint.md +43 -0
  104. package/docs/MarketHistoryResponse.md +43 -0
  105. package/docs/WatchApi.md +389 -0
  106. package/docs/WatchRule.md +61 -0
  107. package/docs/WatchRuleCreate.md +46 -0
  108. package/docs/WatchRulePage.md +36 -0
  109. package/docs/WatchRuleUpdate.md +47 -0
  110. package/package.json +1 -1
  111. package/src/apis/AutolaunchApi.ts +360 -0
  112. package/src/apis/InferenceApi.ts +71 -0
  113. package/src/apis/MarketApi.ts +136 -0
  114. package/src/apis/WatchApi.ts +360 -0
  115. package/src/apis/index.ts +3 -0
  116. package/src/models/AutolaunchRule.ts +270 -0
  117. package/src/models/AutolaunchRuleCreate.ts +162 -0
  118. package/src/models/AutolaunchRuleDisarm.ts +68 -0
  119. package/src/models/AutolaunchRulePage.ts +83 -0
  120. package/src/models/Embedding.ts +96 -0
  121. package/src/models/EmbeddingsRequest.ts +117 -0
  122. package/src/models/EmbeddingsRequestInput.ts +59 -0
  123. package/src/models/EmbeddingsResponse.ts +120 -0
  124. package/src/models/EmbeddingsUsage.ts +75 -0
  125. package/src/models/MarketHistoryPoint.ts +103 -0
  126. package/src/models/MarketHistoryResponse.ts +113 -0
  127. package/src/models/Problem.ts +1 -0
  128. package/src/models/WatchRule.ts +219 -0
  129. package/src/models/WatchRuleCreate.ts +138 -0
  130. package/src/models/WatchRulePage.ts +83 -0
  131. package/src/models/WatchRuleUpdate.ts +135 -0
  132. package/src/models/index.ts +15 -0
@@ -0,0 +1,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 WatchRule } from '../models/WatchRule';
14
+ import { type WatchRuleCreate } from '../models/WatchRuleCreate';
15
+ import { type WatchRulePage } from '../models/WatchRulePage';
16
+ import { type WatchRuleUpdate } from '../models/WatchRuleUpdate';
17
+ export interface CreateWatchRuleRequest {
18
+ watchRuleCreate: WatchRuleCreate;
19
+ idempotencyKey?: string;
20
+ }
21
+ export interface DeleteWatchRuleRequest {
22
+ id: string;
23
+ }
24
+ export interface GetWatchRuleRequest {
25
+ id: string;
26
+ }
27
+ export interface ListWatchRulesRequest {
28
+ cursor?: string;
29
+ limit?: number;
30
+ }
31
+ export interface UpdateWatchRuleRequest {
32
+ id: string;
33
+ watchRuleUpdate: WatchRuleUpdate;
34
+ }
35
+ /**
36
+ *
37
+ */
38
+ export declare class WatchApi extends runtime.BaseAPI {
39
+ /**
40
+ * Creates request options for createWatchRule without sending the request
41
+ */
42
+ createWatchRuleRequestOpts(requestParameters: CreateWatchRuleRequest): Promise<runtime.RequestOpts>;
43
+ /**
44
+ * Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
45
+ * Create a watch rule
46
+ */
47
+ createWatchRuleRaw(requestParameters: CreateWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WatchRule>>;
48
+ /**
49
+ * Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
50
+ * Create a watch rule
51
+ */
52
+ createWatchRule(requestParameters: CreateWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WatchRule>;
53
+ /**
54
+ * Creates request options for deleteWatchRule without sending the request
55
+ */
56
+ deleteWatchRuleRequestOpts(requestParameters: DeleteWatchRuleRequest): Promise<runtime.RequestOpts>;
57
+ /**
58
+ * Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
59
+ * Delete a watch rule
60
+ */
61
+ deleteWatchRuleRaw(requestParameters: DeleteWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>>;
62
+ /**
63
+ * Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
64
+ * Delete a watch rule
65
+ */
66
+ deleteWatchRule(requestParameters: DeleteWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void>;
67
+ /**
68
+ * Creates request options for getWatchRule without sending the request
69
+ */
70
+ getWatchRuleRequestOpts(requestParameters: GetWatchRuleRequest): Promise<runtime.RequestOpts>;
71
+ /**
72
+ * Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
73
+ * Get a watch rule
74
+ */
75
+ getWatchRuleRaw(requestParameters: GetWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WatchRule>>;
76
+ /**
77
+ * Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
78
+ * Get a watch rule
79
+ */
80
+ getWatchRule(requestParameters: GetWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WatchRule>;
81
+ /**
82
+ * Creates request options for listWatchRules without sending the request
83
+ */
84
+ listWatchRulesRequestOpts(requestParameters: ListWatchRulesRequest): Promise<runtime.RequestOpts>;
85
+ /**
86
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
87
+ * List watch rules
88
+ */
89
+ listWatchRulesRaw(requestParameters: ListWatchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WatchRulePage>>;
90
+ /**
91
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
92
+ * List watch rules
93
+ */
94
+ listWatchRules(requestParameters?: ListWatchRulesRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WatchRulePage>;
95
+ /**
96
+ * Creates request options for updateWatchRule without sending the request
97
+ */
98
+ updateWatchRuleRequestOpts(requestParameters: UpdateWatchRuleRequest): Promise<runtime.RequestOpts>;
99
+ /**
100
+ * Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
101
+ * Update a watch rule
102
+ */
103
+ updateWatchRuleRaw(requestParameters: UpdateWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<WatchRule>>;
104
+ /**
105
+ * Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
106
+ * Update a watch rule
107
+ */
108
+ updateWatchRule(requestParameters: UpdateWatchRuleRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<WatchRule>;
109
+ }
@@ -0,0 +1,282 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
15
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
16
+ return new (P || (P = Promise))(function (resolve, reject) {
17
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
18
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
19
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
20
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
21
+ });
22
+ };
23
+ import * as runtime from '../runtime';
24
+ import { WatchRuleFromJSON, } from '../models/WatchRule';
25
+ import { WatchRuleCreateToJSON, } from '../models/WatchRuleCreate';
26
+ import { WatchRulePageFromJSON, } from '../models/WatchRulePage';
27
+ import { WatchRuleUpdateToJSON, } from '../models/WatchRuleUpdate';
28
+ /**
29
+ *
30
+ */
31
+ export class WatchApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates request options for createWatchRule without sending the request
34
+ */
35
+ createWatchRuleRequestOpts(requestParameters) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['watchRuleCreate'] == null) {
38
+ throw new runtime.RequiredError('watchRuleCreate', 'Required parameter "watchRuleCreate" was null or undefined when calling createWatchRule().');
39
+ }
40
+ const queryParameters = {};
41
+ const headerParameters = {};
42
+ headerParameters['Content-Type'] = 'application/json';
43
+ if (requestParameters['idempotencyKey'] != null) {
44
+ headerParameters['Idempotency-Key'] = String(requestParameters['idempotencyKey']);
45
+ }
46
+ if (this.configuration && this.configuration.accessToken) {
47
+ const token = this.configuration.accessToken;
48
+ const tokenString = yield token("bearerAuth", []);
49
+ if (tokenString) {
50
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
51
+ }
52
+ }
53
+ let urlPath = `/watch-rules`;
54
+ return {
55
+ path: urlPath,
56
+ method: 'POST',
57
+ headers: headerParameters,
58
+ query: queryParameters,
59
+ body: WatchRuleCreateToJSON(requestParameters['watchRuleCreate']),
60
+ };
61
+ });
62
+ }
63
+ /**
64
+ * Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
65
+ * Create a watch rule
66
+ */
67
+ createWatchRuleRaw(requestParameters, initOverrides) {
68
+ return __awaiter(this, void 0, void 0, function* () {
69
+ const requestOptions = yield this.createWatchRuleRequestOpts(requestParameters);
70
+ const response = yield this.request(requestOptions, initOverrides);
71
+ return new runtime.JSONApiResponse(response, (jsonValue) => WatchRuleFromJSON(jsonValue));
72
+ });
73
+ }
74
+ /**
75
+ * Creates a rule that notifies you when the market moves on a GPU model. Requires the `watch:write` scope (or `full_access`). A watch rule ONLY notifies. It cannot launch capacity and cannot spend money: there is no field on this resource that provisions anything. Automatic launching is a separate resource with its own spend-consent gate. Targeting is dimensional — a GPU model plus optional canonical region and capacity class. It is deliberately NOT possible to pin a rule to a specific catalog listing: listing identity is unstable, so a pinned rule can silently match nothing and never fire. Delivery is to the organization\'s registered webhook endpoints, plus an email to the rule\'s creator. `webhook_endpoint_override_id` routes one rule to one specific endpoint and is the id of an endpoint already registered via `/webhook-endpoints` — the resource accepts no URL of any kind. Organizations are limited to 50 ENABLED rules; the 422 names the limit.
76
+ * Create a watch rule
77
+ */
78
+ createWatchRule(requestParameters, initOverrides) {
79
+ return __awaiter(this, void 0, void 0, function* () {
80
+ const response = yield this.createWatchRuleRaw(requestParameters, initOverrides);
81
+ return yield response.value();
82
+ });
83
+ }
84
+ /**
85
+ * Creates request options for deleteWatchRule without sending the request
86
+ */
87
+ deleteWatchRuleRequestOpts(requestParameters) {
88
+ return __awaiter(this, void 0, void 0, function* () {
89
+ if (requestParameters['id'] == null) {
90
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling deleteWatchRule().');
91
+ }
92
+ const queryParameters = {};
93
+ const headerParameters = {};
94
+ if (this.configuration && this.configuration.accessToken) {
95
+ const token = this.configuration.accessToken;
96
+ const tokenString = yield token("bearerAuth", []);
97
+ if (tokenString) {
98
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
99
+ }
100
+ }
101
+ let urlPath = `/watch-rules/{id}`;
102
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
103
+ return {
104
+ path: urlPath,
105
+ method: 'DELETE',
106
+ headers: headerParameters,
107
+ query: queryParameters,
108
+ };
109
+ });
110
+ }
111
+ /**
112
+ * Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
113
+ * Delete a watch rule
114
+ */
115
+ deleteWatchRuleRaw(requestParameters, initOverrides) {
116
+ return __awaiter(this, void 0, void 0, function* () {
117
+ const requestOptions = yield this.deleteWatchRuleRequestOpts(requestParameters);
118
+ const response = yield this.request(requestOptions, initOverrides);
119
+ return new runtime.VoidApiResponse(response);
120
+ });
121
+ }
122
+ /**
123
+ * Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
124
+ * Delete a watch rule
125
+ */
126
+ deleteWatchRule(requestParameters, initOverrides) {
127
+ return __awaiter(this, void 0, void 0, function* () {
128
+ yield this.deleteWatchRuleRaw(requestParameters, initOverrides);
129
+ });
130
+ }
131
+ /**
132
+ * Creates request options for getWatchRule without sending the request
133
+ */
134
+ getWatchRuleRequestOpts(requestParameters) {
135
+ return __awaiter(this, void 0, void 0, function* () {
136
+ if (requestParameters['id'] == null) {
137
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling getWatchRule().');
138
+ }
139
+ const queryParameters = {};
140
+ const headerParameters = {};
141
+ if (this.configuration && this.configuration.accessToken) {
142
+ const token = this.configuration.accessToken;
143
+ const tokenString = yield token("bearerAuth", []);
144
+ if (tokenString) {
145
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
146
+ }
147
+ }
148
+ let urlPath = `/watch-rules/{id}`;
149
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
150
+ return {
151
+ path: urlPath,
152
+ method: 'GET',
153
+ headers: headerParameters,
154
+ query: queryParameters,
155
+ };
156
+ });
157
+ }
158
+ /**
159
+ * Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
160
+ * Get a watch rule
161
+ */
162
+ getWatchRuleRaw(requestParameters, initOverrides) {
163
+ return __awaiter(this, void 0, void 0, function* () {
164
+ const requestOptions = yield this.getWatchRuleRequestOpts(requestParameters);
165
+ const response = yield this.request(requestOptions, initOverrides);
166
+ return new runtime.JSONApiResponse(response, (jsonValue) => WatchRuleFromJSON(jsonValue));
167
+ });
168
+ }
169
+ /**
170
+ * Fetches one watch rule. Requires the `watch:read` scope (or `full_access`). A rule belonging to another organization returns 404 — the same answer as an id that does not exist.
171
+ * Get a watch rule
172
+ */
173
+ getWatchRule(requestParameters, initOverrides) {
174
+ return __awaiter(this, void 0, void 0, function* () {
175
+ const response = yield this.getWatchRuleRaw(requestParameters, initOverrides);
176
+ return yield response.value();
177
+ });
178
+ }
179
+ /**
180
+ * Creates request options for listWatchRules without sending the request
181
+ */
182
+ listWatchRulesRequestOpts(requestParameters) {
183
+ return __awaiter(this, void 0, void 0, function* () {
184
+ const queryParameters = {};
185
+ if (requestParameters['cursor'] != null) {
186
+ queryParameters['cursor'] = requestParameters['cursor'];
187
+ }
188
+ if (requestParameters['limit'] != null) {
189
+ queryParameters['limit'] = requestParameters['limit'];
190
+ }
191
+ const headerParameters = {};
192
+ if (this.configuration && this.configuration.accessToken) {
193
+ const token = this.configuration.accessToken;
194
+ const tokenString = yield token("bearerAuth", []);
195
+ if (tokenString) {
196
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
197
+ }
198
+ }
199
+ let urlPath = `/watch-rules`;
200
+ return {
201
+ path: urlPath,
202
+ method: 'GET',
203
+ headers: headerParameters,
204
+ query: queryParameters,
205
+ };
206
+ });
207
+ }
208
+ /**
209
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
210
+ * List watch rules
211
+ */
212
+ listWatchRulesRaw(requestParameters, initOverrides) {
213
+ return __awaiter(this, void 0, void 0, function* () {
214
+ const requestOptions = yield this.listWatchRulesRequestOpts(requestParameters);
215
+ const response = yield this.request(requestOptions, initOverrides);
216
+ return new runtime.JSONApiResponse(response, (jsonValue) => WatchRulePageFromJSON(jsonValue));
217
+ });
218
+ }
219
+ /**
220
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
221
+ * List watch rules
222
+ */
223
+ listWatchRules() {
224
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
225
+ const response = yield this.listWatchRulesRaw(requestParameters, initOverrides);
226
+ return yield response.value();
227
+ });
228
+ }
229
+ /**
230
+ * Creates request options for updateWatchRule without sending the request
231
+ */
232
+ updateWatchRuleRequestOpts(requestParameters) {
233
+ return __awaiter(this, void 0, void 0, function* () {
234
+ if (requestParameters['id'] == null) {
235
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateWatchRule().');
236
+ }
237
+ if (requestParameters['watchRuleUpdate'] == null) {
238
+ throw new runtime.RequiredError('watchRuleUpdate', 'Required parameter "watchRuleUpdate" was null or undefined when calling updateWatchRule().');
239
+ }
240
+ const queryParameters = {};
241
+ const headerParameters = {};
242
+ headerParameters['Content-Type'] = 'application/json';
243
+ if (this.configuration && this.configuration.accessToken) {
244
+ const token = this.configuration.accessToken;
245
+ const tokenString = yield token("bearerAuth", []);
246
+ if (tokenString) {
247
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
248
+ }
249
+ }
250
+ let urlPath = `/watch-rules/{id}`;
251
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
252
+ return {
253
+ path: urlPath,
254
+ method: 'PATCH',
255
+ headers: headerParameters,
256
+ query: queryParameters,
257
+ body: WatchRuleUpdateToJSON(requestParameters['watchRuleUpdate']),
258
+ };
259
+ });
260
+ }
261
+ /**
262
+ * Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
263
+ * Update a watch rule
264
+ */
265
+ updateWatchRuleRaw(requestParameters, initOverrides) {
266
+ return __awaiter(this, void 0, void 0, function* () {
267
+ const requestOptions = yield this.updateWatchRuleRequestOpts(requestParameters);
268
+ const response = yield this.request(requestOptions, initOverrides);
269
+ return new runtime.JSONApiResponse(response, (jsonValue) => WatchRuleFromJSON(jsonValue));
270
+ });
271
+ }
272
+ /**
273
+ * Partially updates a watch rule. Requires the `watch:write` scope (or `full_access`). An ABSENT key keeps the stored value; an explicit `null` on `region`, `capacity_class` or `webhook_endpoint_override_id` CLEARS it back to \"any\" / \"organization default\". The two are distinguished by which keys the body carries, so send only the keys you mean to change. Editing a rule RE-ARMS it: the fired latch describes the condition that was replaced, so carrying it across an edit would suppress the first alert on the new one.
274
+ * Update a watch rule
275
+ */
276
+ updateWatchRule(requestParameters, initOverrides) {
277
+ return __awaiter(this, void 0, void 0, function* () {
278
+ const response = yield this.updateWatchRuleRaw(requestParameters, initOverrides);
279
+ return yield response.value();
280
+ });
281
+ }
282
+ }
@@ -1,3 +1,4 @@
1
+ export * from './AutolaunchApi';
1
2
  export * from './BillingApi';
2
3
  export * from './CommunityApi';
3
4
  export * from './EnvironmentsApi';
@@ -5,6 +6,7 @@ export * from './FineTuningApi';
5
6
  export * from './GpuTypesApi';
6
7
  export * from './InferenceApi';
7
8
  export * from './InstancesApi';
9
+ export * from './MarketApi';
8
10
  export * from './MetaApi';
9
11
  export * from './OperationsApi';
10
12
  export * from './PricingApi';
@@ -12,4 +14,5 @@ export * from './RegistryCredentialsApi';
12
14
  export * from './SshKeysApi';
13
15
  export * from './TemplatesApi';
14
16
  export * from './UsageApi';
17
+ export * from './WatchApi';
15
18
  export * from './WebhooksApi';
@@ -1,5 +1,6 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export * from './AutolaunchApi';
3
4
  export * from './BillingApi';
4
5
  export * from './CommunityApi';
5
6
  export * from './EnvironmentsApi';
@@ -7,6 +8,7 @@ export * from './FineTuningApi';
7
8
  export * from './GpuTypesApi';
8
9
  export * from './InferenceApi';
9
10
  export * from './InstancesApi';
11
+ export * from './MarketApi';
10
12
  export * from './MetaApi';
11
13
  export * from './OperationsApi';
12
14
  export * from './PricingApi';
@@ -14,4 +16,5 @@ export * from './RegistryCredentialsApi';
14
16
  export * from './SshKeysApi';
15
17
  export * from './TemplatesApi';
16
18
  export * from './UsageApi';
19
+ export * from './WatchApi';
17
20
  export * from './WebhooksApi';
@@ -0,0 +1,181 @@
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
+ /**
13
+ * A standing, pre-approved purchase order. It carries no upstream supplier identity, no org id, and no identifier of the API key that consented — the consenting principal is recorded in storage for the fire-time re-check, and a credential identifier has no business in a rule listing.
14
+ *
15
+ * @export
16
+ * @interface AutolaunchRule
17
+ */
18
+ export interface AutolaunchRule {
19
+ /**
20
+ *
21
+ * @type {string}
22
+ * @memberof AutolaunchRule
23
+ */
24
+ id: string;
25
+ /**
26
+ * The GPU model the rule watches and launches, e.g. "H100".
27
+ * @type {string}
28
+ * @memberof AutolaunchRule
29
+ */
30
+ gpuModel: string;
31
+ /**
32
+ * Canonical region the rule is narrowed to, or null for every region.
33
+ * @type {string}
34
+ * @memberof AutolaunchRule
35
+ */
36
+ region: string | null;
37
+ /**
38
+ * Capacity class the rule is narrowed to, or null for both.
39
+ * @type {AutolaunchRuleCapacityClassEnum}
40
+ * @memberof AutolaunchRule
41
+ */
42
+ capacityClass: AutolaunchRuleCapacityClassEnum | null;
43
+ /**
44
+ *
45
+ * @type {AutolaunchRuleConditionKindEnum}
46
+ * @memberof AutolaunchRule
47
+ */
48
+ conditionKind: AutolaunchRuleConditionKindEnum;
49
+ /**
50
+ * The TRIGGER. Dollars PER GPU-HOUR for price_under, or a unit count for count_at_least. Null for in_stock. This is NOT the spend cap — see max_price_per_hour, which is in a different unit.
51
+ *
52
+ * @type {number}
53
+ * @memberof AutolaunchRule
54
+ */
55
+ threshold: number | null;
56
+ /**
57
+ * The CEILING, and the consent. Dollars per hour for the WHOLE INSTANCE, not per GPU. The launch is abandoned — never repriced — if the live price exceeds it.
58
+ *
59
+ * @type {number}
60
+ * @memberof AutolaunchRule
61
+ */
62
+ maxPricePerHour: number;
63
+ /**
64
+ * How long an auto-launched instance may run before the platform terminates it, enforced through the instance's own auto_terminate_hours.
65
+ *
66
+ * @type {number}
67
+ * @memberof AutolaunchRule
68
+ */
69
+ maxRuntimeHours: number;
70
+ /**
71
+ * The worst-case total the customer approved: max_price_per_hour × max_runtime_hours, computed by the server and echoed on every read so a client never has to derive the number it is displaying.
72
+ *
73
+ * @type {number}
74
+ * @memberof AutolaunchRule
75
+ */
76
+ maxTotalUsd: number;
77
+ /**
78
+ * The frozen launch spec, as READ. Every value under `env` is returned as the literal `[REDACTED]` — the key names are kept so you can see what the launch will set, but the values are not readable back on any surface, by any scope. Reading a rule needs only `autolaunch:read`, which every full_access, standard and read_only key holds, so a rule listing must not be a credential listing.
79
+ * This changes nothing about what the rule DOES: the stored spec keeps the real values and replays them at fire time. If you need to change a token, delete the rule and create a new one.
80
+ *
81
+ * @type {{ [key: string]: any; }}
82
+ * @memberof AutolaunchRule
83
+ */
84
+ spec: {
85
+ [key: string]: any;
86
+ };
87
+ /**
88
+ * armed = waiting for the condition. launching = an attempt is in flight. fired = a successful launch consumed the rule's one shot. expired = the per-edge attempt budget ran out. A lost capacity race costs nothing and does NOT consume the shot.
89
+ *
90
+ * @type {AutolaunchRuleStateEnum}
91
+ * @memberof AutolaunchRule
92
+ */
93
+ state: AutolaunchRuleStateEnum;
94
+ /**
95
+ * Launch attempts made since the current condition edge began.
96
+ * @type {number}
97
+ * @memberof AutolaunchRule
98
+ */
99
+ attemptsThisEdge: number;
100
+ /**
101
+ * Why the last attempt did not buy anything: over_ceiling, capacity_race, stale_reference, key_revoked, authority_revoked or validation_failed, optionally with a colon-separated detail. Match the leading token. It never carries API key material.
102
+ *
103
+ * @type {string}
104
+ * @memberof AutolaunchRule
105
+ */
106
+ lastFailureReason: string | null;
107
+ /**
108
+ * The instance this rule launched, once it has fired.
109
+ * @type {string}
110
+ * @memberof AutolaunchRule
111
+ */
112
+ launchedInstanceId: string | null;
113
+ /**
114
+ * Which entrance consented. A dashboard rule has no API key behind it, which is why its fire-time revocation failure is `authority_revoked` (the approving admin was demoted) rather than `key_revoked`.
115
+ *
116
+ * @type {AutolaunchRuleCreatedBySurfaceEnum}
117
+ * @memberof AutolaunchRule
118
+ */
119
+ createdBySurface: AutolaunchRuleCreatedBySurfaceEnum;
120
+ /**
121
+ * False once disarmed or cancelled. A disarmed rule cannot be re-armed.
122
+ * @type {boolean}
123
+ * @memberof AutolaunchRule
124
+ */
125
+ enabled: boolean;
126
+ /**
127
+ *
128
+ * @type {Date}
129
+ * @memberof AutolaunchRule
130
+ */
131
+ createdAt: Date;
132
+ /**
133
+ *
134
+ * @type {Date}
135
+ * @memberof AutolaunchRule
136
+ */
137
+ updatedAt: Date;
138
+ }
139
+ /**
140
+ * @export
141
+ */
142
+ export declare const AutolaunchRuleCapacityClassEnum: {
143
+ readonly Secure: "secure";
144
+ readonly Community: "community";
145
+ };
146
+ export type AutolaunchRuleCapacityClassEnum = typeof AutolaunchRuleCapacityClassEnum[keyof typeof AutolaunchRuleCapacityClassEnum];
147
+ /**
148
+ * @export
149
+ */
150
+ export declare const AutolaunchRuleConditionKindEnum: {
151
+ readonly PriceUnder: "price_under";
152
+ readonly InStock: "in_stock";
153
+ readonly CountAtLeast: "count_at_least";
154
+ };
155
+ export type AutolaunchRuleConditionKindEnum = typeof AutolaunchRuleConditionKindEnum[keyof typeof AutolaunchRuleConditionKindEnum];
156
+ /**
157
+ * @export
158
+ */
159
+ export declare const AutolaunchRuleStateEnum: {
160
+ readonly Armed: "armed";
161
+ readonly Launching: "launching";
162
+ readonly Fired: "fired";
163
+ readonly Expired: "expired";
164
+ };
165
+ export type AutolaunchRuleStateEnum = typeof AutolaunchRuleStateEnum[keyof typeof AutolaunchRuleStateEnum];
166
+ /**
167
+ * @export
168
+ */
169
+ export declare const AutolaunchRuleCreatedBySurfaceEnum: {
170
+ readonly ApiKey: "api_key";
171
+ readonly Dashboard: "dashboard";
172
+ };
173
+ export type AutolaunchRuleCreatedBySurfaceEnum = typeof AutolaunchRuleCreatedBySurfaceEnum[keyof typeof AutolaunchRuleCreatedBySurfaceEnum];
174
+ /**
175
+ * Check if a given object implements the AutolaunchRule interface.
176
+ */
177
+ export declare function instanceOfAutolaunchRule(value: object): value is AutolaunchRule;
178
+ export declare function AutolaunchRuleFromJSON(json: any): AutolaunchRule;
179
+ export declare function AutolaunchRuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRule;
180
+ export declare function AutolaunchRuleToJSON(json: any): AutolaunchRule;
181
+ export declare function AutolaunchRuleToJSONTyped(value?: AutolaunchRule | null, ignoreDiscriminator?: boolean): any;