@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
@@ -24,6 +24,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
24
24
  Object.defineProperty(exports, "__esModule", { value: true });
25
25
  exports.BillingApi = void 0;
26
26
  const runtime = require("../runtime");
27
+ const Balance_1 = require("../models/Balance");
27
28
  const CreateCryptoDepositRequest_1 = require("../models/CreateCryptoDepositRequest");
28
29
  const CryptoDeposit_1 = require("../models/CryptoDeposit");
29
30
  const ListDeposits200Response_1 = require("../models/ListDeposits200Response");
@@ -82,6 +83,50 @@ class BillingApi extends runtime.BaseAPI {
82
83
  return yield response.value();
83
84
  });
84
85
  }
86
+ /**
87
+ * Creates request options for getBalance without sending the request
88
+ */
89
+ getBalanceRequestOpts() {
90
+ return __awaiter(this, void 0, void 0, function* () {
91
+ const queryParameters = {};
92
+ const headerParameters = {};
93
+ if (this.configuration && this.configuration.accessToken) {
94
+ const token = this.configuration.accessToken;
95
+ const tokenString = yield token("bearerAuth", []);
96
+ if (tokenString) {
97
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
98
+ }
99
+ }
100
+ let urlPath = `/billing/balance`;
101
+ return {
102
+ path: urlPath,
103
+ method: 'GET',
104
+ headers: headerParameters,
105
+ query: queryParameters,
106
+ };
107
+ });
108
+ }
109
+ /**
110
+ * 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`.
111
+ * Get the org credit balance
112
+ */
113
+ getBalanceRaw(initOverrides) {
114
+ return __awaiter(this, void 0, void 0, function* () {
115
+ const requestOptions = yield this.getBalanceRequestOpts();
116
+ const response = yield this.request(requestOptions, initOverrides);
117
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, Balance_1.BalanceFromJSON)(jsonValue));
118
+ });
119
+ }
120
+ /**
121
+ * 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`.
122
+ * Get the org credit balance
123
+ */
124
+ getBalance(initOverrides) {
125
+ return __awaiter(this, void 0, void 0, function* () {
126
+ const response = yield this.getBalanceRaw(initOverrides);
127
+ return yield response.value();
128
+ });
129
+ }
85
130
  /**
86
131
  * Creates request options for getDeposit without sending the request
87
132
  */
@@ -0,0 +1,56 @@
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 MarketHistoryResponse } from '../models/MarketHistoryResponse';
14
+ export interface GetMarketHistoryRequest {
15
+ gpuModel: string;
16
+ region?: string;
17
+ capacityClass?: GetMarketHistoryCapacityClassEnum;
18
+ bucket?: GetMarketHistoryBucketEnum;
19
+ from?: Date;
20
+ to?: Date;
21
+ }
22
+ /**
23
+ *
24
+ */
25
+ export declare class MarketApi extends runtime.BaseAPI {
26
+ /**
27
+ * Creates request options for getMarketHistory without sending the request
28
+ */
29
+ getMarketHistoryRequestOpts(requestParameters: GetMarketHistoryRequest): Promise<runtime.RequestOpts>;
30
+ /**
31
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
32
+ * Get a GPU\'s price and availability over time
33
+ */
34
+ getMarketHistoryRaw(requestParameters: GetMarketHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<MarketHistoryResponse>>;
35
+ /**
36
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
37
+ * Get a GPU\'s price and availability over time
38
+ */
39
+ getMarketHistory(requestParameters: GetMarketHistoryRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<MarketHistoryResponse>;
40
+ }
41
+ /**
42
+ * @export
43
+ */
44
+ export declare const GetMarketHistoryCapacityClassEnum: {
45
+ readonly Secure: "secure";
46
+ readonly Community: "community";
47
+ };
48
+ export type GetMarketHistoryCapacityClassEnum = typeof GetMarketHistoryCapacityClassEnum[keyof typeof GetMarketHistoryCapacityClassEnum];
49
+ /**
50
+ * @export
51
+ */
52
+ export declare const GetMarketHistoryBucketEnum: {
53
+ readonly _15m: "15m";
54
+ readonly _1d: "1d";
55
+ };
56
+ export type GetMarketHistoryBucketEnum = typeof GetMarketHistoryBucketEnum[keyof typeof GetMarketHistoryBucketEnum];
@@ -0,0 +1,112 @@
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.GetMarketHistoryBucketEnum = exports.GetMarketHistoryCapacityClassEnum = exports.MarketApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const MarketHistoryResponse_1 = require("../models/MarketHistoryResponse");
28
+ /**
29
+ *
30
+ */
31
+ class MarketApi extends runtime.BaseAPI {
32
+ /**
33
+ * Creates request options for getMarketHistory without sending the request
34
+ */
35
+ getMarketHistoryRequestOpts(requestParameters) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ if (requestParameters['gpuModel'] == null) {
38
+ throw new runtime.RequiredError('gpuModel', 'Required parameter "gpuModel" was null or undefined when calling getMarketHistory().');
39
+ }
40
+ const queryParameters = {};
41
+ if (requestParameters['gpuModel'] != null) {
42
+ queryParameters['gpu_model'] = requestParameters['gpuModel'];
43
+ }
44
+ if (requestParameters['region'] != null) {
45
+ queryParameters['region'] = requestParameters['region'];
46
+ }
47
+ if (requestParameters['capacityClass'] != null) {
48
+ queryParameters['capacity_class'] = requestParameters['capacityClass'];
49
+ }
50
+ if (requestParameters['bucket'] != null) {
51
+ queryParameters['bucket'] = requestParameters['bucket'];
52
+ }
53
+ if (requestParameters['from'] != null) {
54
+ queryParameters['from'] = requestParameters['from'].toISOString();
55
+ }
56
+ if (requestParameters['to'] != null) {
57
+ queryParameters['to'] = requestParameters['to'].toISOString();
58
+ }
59
+ const headerParameters = {};
60
+ if (this.configuration && this.configuration.accessToken) {
61
+ const token = this.configuration.accessToken;
62
+ const tokenString = yield token("bearerAuth", []);
63
+ if (tokenString) {
64
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
65
+ }
66
+ }
67
+ let urlPath = `/market-history`;
68
+ return {
69
+ path: urlPath,
70
+ method: 'GET',
71
+ headers: headerParameters,
72
+ query: queryParameters,
73
+ };
74
+ });
75
+ }
76
+ /**
77
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
78
+ * Get a GPU\'s price and availability over time
79
+ */
80
+ getMarketHistoryRaw(requestParameters, initOverrides) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ const requestOptions = yield this.getMarketHistoryRequestOpts(requestParameters);
83
+ const response = yield this.request(requestOptions, initOverrides);
84
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, MarketHistoryResponse_1.MarketHistoryResponseFromJSON)(jsonValue));
85
+ });
86
+ }
87
+ /**
88
+ * Returns GPU.ai\'s own price and obtainable capacity for one GPU model over a window, at 15-minute or daily resolution. Requires the `market:read` scope (or `full_access`). THE NULL CONTRACT. `price_per_gpu_hour` and `available_count` are nullable, and the two states are different facts that must not be collapsed: * a real `0` means we sampled that bucket and the market was sold out; * `null` means we did NOT sample that bucket — a failed poll, a skipped cycle, an incident on our side. It says nothing about supply. The response materializes the full bucket grid across the window, so a gap has visible width. Do not interpolate across a null: that asserts a continuity the data does not have, and reading one as a zero reports our own outages as supplier stockouts. PER-GPU NORMALIZATION. `price_per_gpu_hour` is always a per-GPU rate. When it was divided out of a whole-node price, `node_price_per_hour` and `gpu_count` are present and describe that derivation; they are absent for single-GPU capacity. A per-GPU figure presented without that context implies single-GPU rentability that whole-node capacity does not offer. WINDOW CAPS. `bucket=1d` is capped at 365 days (the retention window). `bucket=15m` is capped at 90 days when BOTH `region` and `capacity_class` are supplied, and at 31 days when either is omitted, because an unscoped 15-minute series scans every region and class in every bucket. An over-wide window is a 400 naming the cap and both escapes, never a silent truncation. This series carries no upstream supplier identity of any kind: the price is GPU.ai\'s own floor and the count is an aggregate.
89
+ * Get a GPU\'s price and availability over time
90
+ */
91
+ getMarketHistory(requestParameters, initOverrides) {
92
+ return __awaiter(this, void 0, void 0, function* () {
93
+ const response = yield this.getMarketHistoryRaw(requestParameters, initOverrides);
94
+ return yield response.value();
95
+ });
96
+ }
97
+ }
98
+ exports.MarketApi = MarketApi;
99
+ /**
100
+ * @export
101
+ */
102
+ exports.GetMarketHistoryCapacityClassEnum = {
103
+ Secure: 'secure',
104
+ Community: 'community'
105
+ };
106
+ /**
107
+ * @export
108
+ */
109
+ exports.GetMarketHistoryBucketEnum = {
110
+ _15m: '15m',
111
+ _1d: '1d'
112
+ };
@@ -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,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.WatchApi = void 0;
26
+ const runtime = require("../runtime");
27
+ const WatchRule_1 = require("../models/WatchRule");
28
+ const WatchRuleCreate_1 = require("../models/WatchRuleCreate");
29
+ const WatchRulePage_1 = require("../models/WatchRulePage");
30
+ const WatchRuleUpdate_1 = require("../models/WatchRuleUpdate");
31
+ /**
32
+ *
33
+ */
34
+ class WatchApi extends runtime.BaseAPI {
35
+ /**
36
+ * Creates request options for createWatchRule without sending the request
37
+ */
38
+ createWatchRuleRequestOpts(requestParameters) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (requestParameters['watchRuleCreate'] == null) {
41
+ throw new runtime.RequiredError('watchRuleCreate', 'Required parameter "watchRuleCreate" was null or undefined when calling createWatchRule().');
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 = `/watch-rules`;
57
+ return {
58
+ path: urlPath,
59
+ method: 'POST',
60
+ headers: headerParameters,
61
+ query: queryParameters,
62
+ body: (0, WatchRuleCreate_1.WatchRuleCreateToJSON)(requestParameters['watchRuleCreate']),
63
+ };
64
+ });
65
+ }
66
+ /**
67
+ * 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.
68
+ * Create a watch rule
69
+ */
70
+ createWatchRuleRaw(requestParameters, initOverrides) {
71
+ return __awaiter(this, void 0, void 0, function* () {
72
+ const requestOptions = yield this.createWatchRuleRequestOpts(requestParameters);
73
+ const response = yield this.request(requestOptions, initOverrides);
74
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
75
+ });
76
+ }
77
+ /**
78
+ * 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.
79
+ * Create a watch rule
80
+ */
81
+ createWatchRule(requestParameters, initOverrides) {
82
+ return __awaiter(this, void 0, void 0, function* () {
83
+ const response = yield this.createWatchRuleRaw(requestParameters, initOverrides);
84
+ return yield response.value();
85
+ });
86
+ }
87
+ /**
88
+ * Creates request options for deleteWatchRule without sending the request
89
+ */
90
+ deleteWatchRuleRequestOpts(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 deleteWatchRule().');
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 = `/watch-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 a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
116
+ * Delete a watch rule
117
+ */
118
+ deleteWatchRuleRaw(requestParameters, initOverrides) {
119
+ return __awaiter(this, void 0, void 0, function* () {
120
+ const requestOptions = yield this.deleteWatchRuleRequestOpts(requestParameters);
121
+ const response = yield this.request(requestOptions, initOverrides);
122
+ return new runtime.VoidApiResponse(response);
123
+ });
124
+ }
125
+ /**
126
+ * Deletes a watch rule. Requires the `watch:write` scope (or `full_access`). Deleting an already-deleted rule returns 404.
127
+ * Delete a watch rule
128
+ */
129
+ deleteWatchRule(requestParameters, initOverrides) {
130
+ return __awaiter(this, void 0, void 0, function* () {
131
+ yield this.deleteWatchRuleRaw(requestParameters, initOverrides);
132
+ });
133
+ }
134
+ /**
135
+ * Creates request options for getWatchRule without sending the request
136
+ */
137
+ getWatchRuleRequestOpts(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 getWatchRule().');
141
+ }
142
+ const queryParameters = {};
143
+ const headerParameters = {};
144
+ if (this.configuration && this.configuration.accessToken) {
145
+ const token = this.configuration.accessToken;
146
+ const tokenString = yield token("bearerAuth", []);
147
+ if (tokenString) {
148
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
149
+ }
150
+ }
151
+ let urlPath = `/watch-rules/{id}`;
152
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
153
+ return {
154
+ path: urlPath,
155
+ method: 'GET',
156
+ headers: headerParameters,
157
+ query: queryParameters,
158
+ };
159
+ });
160
+ }
161
+ /**
162
+ * 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.
163
+ * Get a watch rule
164
+ */
165
+ getWatchRuleRaw(requestParameters, initOverrides) {
166
+ return __awaiter(this, void 0, void 0, function* () {
167
+ const requestOptions = yield this.getWatchRuleRequestOpts(requestParameters);
168
+ const response = yield this.request(requestOptions, initOverrides);
169
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
170
+ });
171
+ }
172
+ /**
173
+ * 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.
174
+ * Get a watch rule
175
+ */
176
+ getWatchRule(requestParameters, initOverrides) {
177
+ return __awaiter(this, void 0, void 0, function* () {
178
+ const response = yield this.getWatchRuleRaw(requestParameters, initOverrides);
179
+ return yield response.value();
180
+ });
181
+ }
182
+ /**
183
+ * Creates request options for listWatchRules without sending the request
184
+ */
185
+ listWatchRulesRequestOpts(requestParameters) {
186
+ return __awaiter(this, void 0, void 0, function* () {
187
+ const queryParameters = {};
188
+ if (requestParameters['cursor'] != null) {
189
+ queryParameters['cursor'] = requestParameters['cursor'];
190
+ }
191
+ if (requestParameters['limit'] != null) {
192
+ queryParameters['limit'] = requestParameters['limit'];
193
+ }
194
+ const headerParameters = {};
195
+ if (this.configuration && this.configuration.accessToken) {
196
+ const token = this.configuration.accessToken;
197
+ const tokenString = yield token("bearerAuth", []);
198
+ if (tokenString) {
199
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
200
+ }
201
+ }
202
+ let urlPath = `/watch-rules`;
203
+ return {
204
+ path: urlPath,
205
+ method: 'GET',
206
+ headers: headerParameters,
207
+ query: queryParameters,
208
+ };
209
+ });
210
+ }
211
+ /**
212
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
213
+ * List watch rules
214
+ */
215
+ listWatchRulesRaw(requestParameters, initOverrides) {
216
+ return __awaiter(this, void 0, void 0, function* () {
217
+ const requestOptions = yield this.listWatchRulesRequestOpts(requestParameters);
218
+ const response = yield this.request(requestOptions, initOverrides);
219
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRulePage_1.WatchRulePageFromJSON)(jsonValue));
220
+ });
221
+ }
222
+ /**
223
+ * Lists this organization\'s watch rules. Requires the `watch:read` scope (or `full_access`). Rules belonging to other organizations are never returned.
224
+ * List watch rules
225
+ */
226
+ listWatchRules() {
227
+ return __awaiter(this, arguments, void 0, function* (requestParameters = {}, initOverrides) {
228
+ const response = yield this.listWatchRulesRaw(requestParameters, initOverrides);
229
+ return yield response.value();
230
+ });
231
+ }
232
+ /**
233
+ * Creates request options for updateWatchRule without sending the request
234
+ */
235
+ updateWatchRuleRequestOpts(requestParameters) {
236
+ return __awaiter(this, void 0, void 0, function* () {
237
+ if (requestParameters['id'] == null) {
238
+ throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling updateWatchRule().');
239
+ }
240
+ if (requestParameters['watchRuleUpdate'] == null) {
241
+ throw new runtime.RequiredError('watchRuleUpdate', 'Required parameter "watchRuleUpdate" was null or undefined when calling updateWatchRule().');
242
+ }
243
+ const queryParameters = {};
244
+ const headerParameters = {};
245
+ headerParameters['Content-Type'] = 'application/json';
246
+ if (this.configuration && this.configuration.accessToken) {
247
+ const token = this.configuration.accessToken;
248
+ const tokenString = yield token("bearerAuth", []);
249
+ if (tokenString) {
250
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
251
+ }
252
+ }
253
+ let urlPath = `/watch-rules/{id}`;
254
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
255
+ return {
256
+ path: urlPath,
257
+ method: 'PATCH',
258
+ headers: headerParameters,
259
+ query: queryParameters,
260
+ body: (0, WatchRuleUpdate_1.WatchRuleUpdateToJSON)(requestParameters['watchRuleUpdate']),
261
+ };
262
+ });
263
+ }
264
+ /**
265
+ * 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.
266
+ * Update a watch rule
267
+ */
268
+ updateWatchRuleRaw(requestParameters, initOverrides) {
269
+ return __awaiter(this, void 0, void 0, function* () {
270
+ const requestOptions = yield this.updateWatchRuleRequestOpts(requestParameters);
271
+ const response = yield this.request(requestOptions, initOverrides);
272
+ return new runtime.JSONApiResponse(response, (jsonValue) => (0, WatchRule_1.WatchRuleFromJSON)(jsonValue));
273
+ });
274
+ }
275
+ /**
276
+ * 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.
277
+ * Update a watch rule
278
+ */
279
+ updateWatchRule(requestParameters, initOverrides) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ const response = yield this.updateWatchRuleRaw(requestParameters, initOverrides);
282
+ return yield response.value();
283
+ });
284
+ }
285
+ }
286
+ exports.WatchApi = WatchApi;
@@ -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';