@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
@@ -1,3 +1,7 @@
1
+ export * from './AutolaunchRule';
2
+ export * from './AutolaunchRuleCreate';
3
+ export * from './AutolaunchRuleDisarm';
4
+ export * from './AutolaunchRulePage';
1
5
  export * from './ChatChoice';
2
6
  export * from './ChatCompletionRequest';
3
7
  export * from './ChatCompletionResponse';
@@ -17,6 +21,11 @@ export * from './CreateRegistryCredentialRequest';
17
21
  export * from './CreateSshKeyRequest';
18
22
  export * from './CreateWebhookEndpointRequest';
19
23
  export * from './CryptoDeposit';
24
+ export * from './Embedding';
25
+ export * from './EmbeddingsRequest';
26
+ export * from './EmbeddingsRequestInput';
27
+ export * from './EmbeddingsResponse';
28
+ export * from './EmbeddingsUsage';
20
29
  export * from './Environments';
21
30
  export * from './FileObject';
22
31
  export * from './FineTuningJob';
@@ -40,6 +49,8 @@ export * from './InstancePage';
40
49
  export * from './ListCommunityMachines200Response';
41
50
  export * from './ListDeposits200Response';
42
51
  export * from './ListRegistryCredentials200Response';
52
+ export * from './MarketHistoryPoint';
53
+ export * from './MarketHistoryResponse';
43
54
  export * from './Model';
44
55
  export * from './ModelList';
45
56
  export * from './ModelParametersInner';
@@ -72,5 +83,9 @@ export * from './VMImage';
72
83
  export * from './VideoCreateRequest';
73
84
  export * from './VideoJob';
74
85
  export * from './VideoList';
86
+ export * from './WatchRule';
87
+ export * from './WatchRuleCreate';
88
+ export * from './WatchRulePage';
89
+ export * from './WatchRuleUpdate';
75
90
  export * from './WebhookEndpoint';
76
91
  export * from './WebhookEndpointPage';
@@ -1,5 +1,9 @@
1
1
  /* tslint:disable */
2
2
  /* eslint-disable */
3
+ export * from './AutolaunchRule';
4
+ export * from './AutolaunchRuleCreate';
5
+ export * from './AutolaunchRuleDisarm';
6
+ export * from './AutolaunchRulePage';
3
7
  export * from './ChatChoice';
4
8
  export * from './ChatCompletionRequest';
5
9
  export * from './ChatCompletionResponse';
@@ -19,6 +23,11 @@ export * from './CreateRegistryCredentialRequest';
19
23
  export * from './CreateSshKeyRequest';
20
24
  export * from './CreateWebhookEndpointRequest';
21
25
  export * from './CryptoDeposit';
26
+ export * from './Embedding';
27
+ export * from './EmbeddingsRequest';
28
+ export * from './EmbeddingsRequestInput';
29
+ export * from './EmbeddingsResponse';
30
+ export * from './EmbeddingsUsage';
22
31
  export * from './Environments';
23
32
  export * from './FileObject';
24
33
  export * from './FineTuningJob';
@@ -42,6 +51,8 @@ export * from './InstancePage';
42
51
  export * from './ListCommunityMachines200Response';
43
52
  export * from './ListDeposits200Response';
44
53
  export * from './ListRegistryCredentials200Response';
54
+ export * from './MarketHistoryPoint';
55
+ export * from './MarketHistoryResponse';
45
56
  export * from './Model';
46
57
  export * from './ModelList';
47
58
  export * from './ModelParametersInner';
@@ -74,5 +85,9 @@ export * from './VMImage';
74
85
  export * from './VideoCreateRequest';
75
86
  export * from './VideoJob';
76
87
  export * from './VideoList';
88
+ export * from './WatchRule';
89
+ export * from './WatchRuleCreate';
90
+ export * from './WatchRulePage';
91
+ export * from './WatchRuleUpdate';
77
92
  export * from './WebhookEndpoint';
78
93
  export * from './WebhookEndpointPage';
@@ -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;
@@ -0,0 +1,150 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AutolaunchRuleCreatedBySurfaceEnum = exports.AutolaunchRuleStateEnum = exports.AutolaunchRuleConditionKindEnum = exports.AutolaunchRuleCapacityClassEnum = void 0;
17
+ exports.instanceOfAutolaunchRule = instanceOfAutolaunchRule;
18
+ exports.AutolaunchRuleFromJSON = AutolaunchRuleFromJSON;
19
+ exports.AutolaunchRuleFromJSONTyped = AutolaunchRuleFromJSONTyped;
20
+ exports.AutolaunchRuleToJSON = AutolaunchRuleToJSON;
21
+ exports.AutolaunchRuleToJSONTyped = AutolaunchRuleToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.AutolaunchRuleCapacityClassEnum = {
26
+ Secure: 'secure',
27
+ Community: 'community'
28
+ };
29
+ /**
30
+ * @export
31
+ */
32
+ exports.AutolaunchRuleConditionKindEnum = {
33
+ PriceUnder: 'price_under',
34
+ InStock: 'in_stock',
35
+ CountAtLeast: 'count_at_least'
36
+ };
37
+ /**
38
+ * @export
39
+ */
40
+ exports.AutolaunchRuleStateEnum = {
41
+ Armed: 'armed',
42
+ Launching: 'launching',
43
+ Fired: 'fired',
44
+ Expired: 'expired'
45
+ };
46
+ /**
47
+ * @export
48
+ */
49
+ exports.AutolaunchRuleCreatedBySurfaceEnum = {
50
+ ApiKey: 'api_key',
51
+ Dashboard: 'dashboard'
52
+ };
53
+ /**
54
+ * Check if a given object implements the AutolaunchRule interface.
55
+ */
56
+ function instanceOfAutolaunchRule(value) {
57
+ if (!('id' in value) || value['id'] === undefined)
58
+ return false;
59
+ if ((!('gpuModel' in value) && !('gpu_model' in value)) || (value['gpuModel'] === undefined && value['gpu_model'] === undefined))
60
+ return false;
61
+ if (!('region' in value) || value['region'] === undefined)
62
+ return false;
63
+ if ((!('capacityClass' in value) && !('capacity_class' in value)) || (value['capacityClass'] === undefined && value['capacity_class'] === undefined))
64
+ return false;
65
+ if ((!('conditionKind' in value) && !('condition_kind' in value)) || (value['conditionKind'] === undefined && value['condition_kind'] === undefined))
66
+ return false;
67
+ if (!('threshold' in value) || value['threshold'] === undefined)
68
+ return false;
69
+ if ((!('maxPricePerHour' in value) && !('max_price_per_hour' in value)) || (value['maxPricePerHour'] === undefined && value['max_price_per_hour'] === undefined))
70
+ return false;
71
+ if ((!('maxRuntimeHours' in value) && !('max_runtime_hours' in value)) || (value['maxRuntimeHours'] === undefined && value['max_runtime_hours'] === undefined))
72
+ return false;
73
+ if ((!('maxTotalUsd' in value) && !('max_total_usd' in value)) || (value['maxTotalUsd'] === undefined && value['max_total_usd'] === undefined))
74
+ return false;
75
+ if (!('spec' in value) || value['spec'] === undefined)
76
+ return false;
77
+ if (!('state' in value) || value['state'] === undefined)
78
+ return false;
79
+ if ((!('attemptsThisEdge' in value) && !('attempts_this_edge' in value)) || (value['attemptsThisEdge'] === undefined && value['attempts_this_edge'] === undefined))
80
+ return false;
81
+ if ((!('lastFailureReason' in value) && !('last_failure_reason' in value)) || (value['lastFailureReason'] === undefined && value['last_failure_reason'] === undefined))
82
+ return false;
83
+ if ((!('launchedInstanceId' in value) && !('launched_instance_id' in value)) || (value['launchedInstanceId'] === undefined && value['launched_instance_id'] === undefined))
84
+ return false;
85
+ if ((!('createdBySurface' in value) && !('created_by_surface' in value)) || (value['createdBySurface'] === undefined && value['created_by_surface'] === undefined))
86
+ return false;
87
+ if (!('enabled' in value) || value['enabled'] === undefined)
88
+ return false;
89
+ if ((!('createdAt' in value) && !('created_at' in value)) || (value['createdAt'] === undefined && value['created_at'] === undefined))
90
+ return false;
91
+ if ((!('updatedAt' in value) && !('updated_at' in value)) || (value['updatedAt'] === undefined && value['updated_at'] === undefined))
92
+ return false;
93
+ return true;
94
+ }
95
+ function AutolaunchRuleFromJSON(json) {
96
+ return AutolaunchRuleFromJSONTyped(json, false);
97
+ }
98
+ function AutolaunchRuleFromJSONTyped(json, ignoreDiscriminator) {
99
+ if (json == null) {
100
+ return json;
101
+ }
102
+ return {
103
+ 'id': json['id'],
104
+ 'gpuModel': json['gpu_model'],
105
+ 'region': json['region'],
106
+ 'capacityClass': json['capacity_class'],
107
+ 'conditionKind': json['condition_kind'],
108
+ 'threshold': json['threshold'],
109
+ 'maxPricePerHour': json['max_price_per_hour'],
110
+ 'maxRuntimeHours': json['max_runtime_hours'],
111
+ 'maxTotalUsd': json['max_total_usd'],
112
+ 'spec': json['spec'],
113
+ 'state': json['state'],
114
+ 'attemptsThisEdge': json['attempts_this_edge'],
115
+ 'lastFailureReason': json['last_failure_reason'],
116
+ 'launchedInstanceId': json['launched_instance_id'],
117
+ 'createdBySurface': json['created_by_surface'],
118
+ 'enabled': json['enabled'],
119
+ 'createdAt': (new Date(json['created_at'])),
120
+ 'updatedAt': (new Date(json['updated_at'])),
121
+ };
122
+ }
123
+ function AutolaunchRuleToJSON(json) {
124
+ return AutolaunchRuleToJSONTyped(json, false);
125
+ }
126
+ function AutolaunchRuleToJSONTyped(value, ignoreDiscriminator = false) {
127
+ if (value == null) {
128
+ return value;
129
+ }
130
+ return {
131
+ 'id': value['id'],
132
+ 'gpu_model': value['gpuModel'],
133
+ 'region': value['region'],
134
+ 'capacity_class': value['capacityClass'],
135
+ 'condition_kind': value['conditionKind'],
136
+ 'threshold': value['threshold'],
137
+ 'max_price_per_hour': value['maxPricePerHour'],
138
+ 'max_runtime_hours': value['maxRuntimeHours'],
139
+ 'max_total_usd': value['maxTotalUsd'],
140
+ 'spec': value['spec'],
141
+ 'state': value['state'],
142
+ 'attempts_this_edge': value['attemptsThisEdge'],
143
+ 'last_failure_reason': value['lastFailureReason'],
144
+ 'launched_instance_id': value['launchedInstanceId'],
145
+ 'created_by_surface': value['createdBySurface'],
146
+ 'enabled': value['enabled'],
147
+ 'created_at': value['createdAt'].toISOString(),
148
+ 'updated_at': value['updatedAt'].toISOString(),
149
+ };
150
+ }
@@ -0,0 +1,105 @@
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
+ *
14
+ * @export
15
+ * @interface AutolaunchRuleCreate
16
+ */
17
+ export interface AutolaunchRuleCreate {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof AutolaunchRuleCreate
22
+ */
23
+ gpuModel: string;
24
+ /**
25
+ * Omit or send null to consider every region.
26
+ * @type {string}
27
+ * @memberof AutolaunchRuleCreate
28
+ */
29
+ region?: string | null;
30
+ /**
31
+ * Omit or send null to consider both capacity classes.
32
+ * @type {AutolaunchRuleCreateCapacityClassEnum}
33
+ * @memberof AutolaunchRuleCreate
34
+ */
35
+ capacityClass?: AutolaunchRuleCreateCapacityClassEnum | null;
36
+ /**
37
+ *
38
+ * @type {AutolaunchRuleCreateConditionKindEnum}
39
+ * @memberof AutolaunchRuleCreate
40
+ */
41
+ conditionKind: AutolaunchRuleCreateConditionKindEnum;
42
+ /**
43
+ * The TRIGGER, in dollars PER GPU-HOUR for price_under or a unit count for count_at_least. Required and greater than zero for both. Ignored for in_stock. Not the spend cap. Values above the maximum are refused with a 422 naming the bound — it is the largest value the column stores.
44
+ *
45
+ * @type {number}
46
+ * @memberof AutolaunchRuleCreate
47
+ */
48
+ threshold?: number | null;
49
+ /**
50
+ * The CEILING, in dollars per hour for the WHOLE INSTANCE. Required even for in_stock rules: "buy it when it comes back" with no ceiling is an unbounded authorization, and this resource has no such shape. Values above the maximum are refused with a 422 naming the bound.
51
+ *
52
+ * @type {number}
53
+ * @memberof AutolaunchRuleCreate
54
+ */
55
+ maxPricePerHour: number;
56
+ /**
57
+ *
58
+ * @type {number}
59
+ * @memberof AutolaunchRuleCreate
60
+ */
61
+ maxRuntimeHours: number;
62
+ /**
63
+ * The full create-instance body this rule freezes and replays — the same shape POST /v1/instances accepts. It is modelled as an open object rather than a $ref because the instance-create body is an inline requestBody schema rather than a named component; promoting it would rewrite the instances operation and every generated client's signature for it, in a change that only needs to STORE one.
64
+ *
65
+ * Two fields behave differently here than on a live create: `offering_id` is REJECTED (a pinned offering produces a rule that can never fire, because offering identity churns between catalog polls), and `auto_terminate_hours` is OVERWRITTEN from the rule's `max_runtime_hours` so a nested field cannot widen the runtime bound the customer approved.
66
+ *
67
+ * @type {{ [key: string]: any; }}
68
+ * @memberof AutolaunchRuleCreate
69
+ */
70
+ spec: {
71
+ [key: string]: any;
72
+ };
73
+ /**
74
+ * REQUIRED. Echo of the worst-case total, max_price_per_hour × max_runtime_hours, accepted within one cent. This is the consent gate: a caller that never computed this number cannot have shown it to the person approving the rule, and a caller that displayed a different number disagrees with what is about to be stored. Either way the request is refused so the caller can re-render the real figure.
75
+ *
76
+ * @type {number}
77
+ * @memberof AutolaunchRuleCreate
78
+ */
79
+ acknowledgedMaxTotalUsd: number;
80
+ }
81
+ /**
82
+ * @export
83
+ */
84
+ export declare const AutolaunchRuleCreateCapacityClassEnum: {
85
+ readonly Secure: "secure";
86
+ readonly Community: "community";
87
+ };
88
+ export type AutolaunchRuleCreateCapacityClassEnum = typeof AutolaunchRuleCreateCapacityClassEnum[keyof typeof AutolaunchRuleCreateCapacityClassEnum];
89
+ /**
90
+ * @export
91
+ */
92
+ export declare const AutolaunchRuleCreateConditionKindEnum: {
93
+ readonly PriceUnder: "price_under";
94
+ readonly InStock: "in_stock";
95
+ readonly CountAtLeast: "count_at_least";
96
+ };
97
+ export type AutolaunchRuleCreateConditionKindEnum = typeof AutolaunchRuleCreateConditionKindEnum[keyof typeof AutolaunchRuleCreateConditionKindEnum];
98
+ /**
99
+ * Check if a given object implements the AutolaunchRuleCreate interface.
100
+ */
101
+ export declare function instanceOfAutolaunchRuleCreate(value: object): value is AutolaunchRuleCreate;
102
+ export declare function AutolaunchRuleCreateFromJSON(json: any): AutolaunchRuleCreate;
103
+ export declare function AutolaunchRuleCreateFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleCreate;
104
+ export declare function AutolaunchRuleCreateToJSON(json: any): AutolaunchRuleCreate;
105
+ export declare function AutolaunchRuleCreateToJSONTyped(value?: AutolaunchRuleCreate | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,92 @@
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
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.AutolaunchRuleCreateConditionKindEnum = exports.AutolaunchRuleCreateCapacityClassEnum = void 0;
17
+ exports.instanceOfAutolaunchRuleCreate = instanceOfAutolaunchRuleCreate;
18
+ exports.AutolaunchRuleCreateFromJSON = AutolaunchRuleCreateFromJSON;
19
+ exports.AutolaunchRuleCreateFromJSONTyped = AutolaunchRuleCreateFromJSONTyped;
20
+ exports.AutolaunchRuleCreateToJSON = AutolaunchRuleCreateToJSON;
21
+ exports.AutolaunchRuleCreateToJSONTyped = AutolaunchRuleCreateToJSONTyped;
22
+ /**
23
+ * @export
24
+ */
25
+ exports.AutolaunchRuleCreateCapacityClassEnum = {
26
+ Secure: 'secure',
27
+ Community: 'community'
28
+ };
29
+ /**
30
+ * @export
31
+ */
32
+ exports.AutolaunchRuleCreateConditionKindEnum = {
33
+ PriceUnder: 'price_under',
34
+ InStock: 'in_stock',
35
+ CountAtLeast: 'count_at_least'
36
+ };
37
+ /**
38
+ * Check if a given object implements the AutolaunchRuleCreate interface.
39
+ */
40
+ function instanceOfAutolaunchRuleCreate(value) {
41
+ if ((!('gpuModel' in value) && !('gpu_model' in value)) || (value['gpuModel'] === undefined && value['gpu_model'] === undefined))
42
+ return false;
43
+ if ((!('conditionKind' in value) && !('condition_kind' in value)) || (value['conditionKind'] === undefined && value['condition_kind'] === undefined))
44
+ return false;
45
+ if ((!('maxPricePerHour' in value) && !('max_price_per_hour' in value)) || (value['maxPricePerHour'] === undefined && value['max_price_per_hour'] === undefined))
46
+ return false;
47
+ if ((!('maxRuntimeHours' in value) && !('max_runtime_hours' in value)) || (value['maxRuntimeHours'] === undefined && value['max_runtime_hours'] === undefined))
48
+ return false;
49
+ if (!('spec' in value) || value['spec'] === undefined)
50
+ return false;
51
+ if ((!('acknowledgedMaxTotalUsd' in value) && !('acknowledged_max_total_usd' in value)) || (value['acknowledgedMaxTotalUsd'] === undefined && value['acknowledged_max_total_usd'] === undefined))
52
+ return false;
53
+ return true;
54
+ }
55
+ function AutolaunchRuleCreateFromJSON(json) {
56
+ return AutolaunchRuleCreateFromJSONTyped(json, false);
57
+ }
58
+ function AutolaunchRuleCreateFromJSONTyped(json, ignoreDiscriminator) {
59
+ if (json == null) {
60
+ return json;
61
+ }
62
+ return {
63
+ 'gpuModel': json['gpu_model'],
64
+ 'region': json['region'] === undefined ? undefined : json['region'] === null ? null : json['region'],
65
+ 'capacityClass': json['capacity_class'] === undefined ? undefined : json['capacity_class'] === null ? null : json['capacity_class'],
66
+ 'conditionKind': json['condition_kind'],
67
+ 'threshold': json['threshold'] === undefined ? undefined : json['threshold'] === null ? null : json['threshold'],
68
+ 'maxPricePerHour': json['max_price_per_hour'],
69
+ 'maxRuntimeHours': json['max_runtime_hours'],
70
+ 'spec': json['spec'],
71
+ 'acknowledgedMaxTotalUsd': json['acknowledged_max_total_usd'],
72
+ };
73
+ }
74
+ function AutolaunchRuleCreateToJSON(json) {
75
+ return AutolaunchRuleCreateToJSONTyped(json, false);
76
+ }
77
+ function AutolaunchRuleCreateToJSONTyped(value, ignoreDiscriminator = false) {
78
+ if (value == null) {
79
+ return value;
80
+ }
81
+ return {
82
+ 'gpu_model': value['gpuModel'],
83
+ 'region': value['region'],
84
+ 'capacity_class': value['capacityClass'],
85
+ 'condition_kind': value['conditionKind'],
86
+ 'threshold': value['threshold'],
87
+ 'max_price_per_hour': value['maxPricePerHour'],
88
+ 'max_runtime_hours': value['maxRuntimeHours'],
89
+ 'spec': value['spec'],
90
+ 'acknowledged_max_total_usd': value['acknowledgedMaxTotalUsd'],
91
+ };
92
+ }
@@ -0,0 +1,34 @@
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
+ * The entire PATCH surface. `enabled` must be present and must be false. Any other key is refused rather than accepted-and-ignored, because a PATCH carrying a new ceiling that returned 200 would leave the caller believing the cap had moved.
14
+ *
15
+ * @export
16
+ * @interface AutolaunchRuleDisarm
17
+ */
18
+ export interface AutolaunchRuleDisarm {
19
+ /**
20
+ * Must be false. Sending true is refused: a fired rule consumed its one shot, so "resume" would silently be an authorization nobody gave, and arming again is a create.
21
+ *
22
+ * @type {boolean}
23
+ * @memberof AutolaunchRuleDisarm
24
+ */
25
+ enabled: boolean;
26
+ }
27
+ /**
28
+ * Check if a given object implements the AutolaunchRuleDisarm interface.
29
+ */
30
+ export declare function instanceOfAutolaunchRuleDisarm(value: object): value is AutolaunchRuleDisarm;
31
+ export declare function AutolaunchRuleDisarmFromJSON(json: any): AutolaunchRuleDisarm;
32
+ export declare function AutolaunchRuleDisarmFromJSONTyped(json: any, ignoreDiscriminator: boolean): AutolaunchRuleDisarm;
33
+ export declare function AutolaunchRuleDisarmToJSON(json: any): AutolaunchRuleDisarm;
34
+ export declare function AutolaunchRuleDisarmToJSONTyped(value?: AutolaunchRuleDisarm | null, ignoreDiscriminator?: boolean): any;