@gpuai/sdk 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +36 -0
- package/README.md +38 -9
- package/dist/apis/AutolaunchApi.d.ts +109 -0
- package/dist/apis/AutolaunchApi.js +286 -0
- package/dist/apis/InferenceApi.d.ts +19 -0
- package/dist/apis/InferenceApi.js +51 -0
- package/dist/apis/MarketApi.d.ts +56 -0
- package/dist/apis/MarketApi.js +112 -0
- package/dist/apis/WatchApi.d.ts +109 -0
- package/dist/apis/WatchApi.js +286 -0
- package/dist/apis/index.d.ts +3 -0
- package/dist/apis/index.js +3 -0
- package/dist/esm/apis/AutolaunchApi.d.ts +109 -0
- package/dist/esm/apis/AutolaunchApi.js +282 -0
- package/dist/esm/apis/InferenceApi.d.ts +19 -0
- package/dist/esm/apis/InferenceApi.js +51 -0
- package/dist/esm/apis/MarketApi.d.ts +56 -0
- package/dist/esm/apis/MarketApi.js +108 -0
- package/dist/esm/apis/WatchApi.d.ts +109 -0
- package/dist/esm/apis/WatchApi.js +282 -0
- package/dist/esm/apis/index.d.ts +3 -0
- package/dist/esm/apis/index.js +3 -0
- package/dist/esm/models/AutolaunchRule.d.ts +181 -0
- package/dist/esm/models/AutolaunchRule.js +142 -0
- package/dist/esm/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/esm/models/AutolaunchRuleCreate.js +84 -0
- package/dist/esm/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/esm/models/AutolaunchRuleDisarm.js +43 -0
- package/dist/esm/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/esm/models/AutolaunchRulePage.js +48 -0
- package/dist/esm/models/Embedding.d.ts +51 -0
- package/dist/esm/models/Embedding.js +59 -0
- package/dist/esm/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/esm/models/EmbeddingsRequest.js +60 -0
- package/dist/esm/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/esm/models/EmbeddingsRequestInput.js +47 -0
- package/dist/esm/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/esm/models/EmbeddingsResponse.js +65 -0
- package/dist/esm/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/esm/models/EmbeddingsUsage.js +47 -0
- package/dist/esm/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/esm/models/MarketHistoryPoint.js +55 -0
- package/dist/esm/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/esm/models/MarketHistoryResponse.js +60 -0
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/WatchRule.d.ts +141 -0
- package/dist/esm/models/WatchRule.js +117 -0
- package/dist/esm/models/WatchRuleCreate.d.ts +87 -0
- package/dist/esm/models/WatchRuleCreate.js +72 -0
- package/dist/esm/models/WatchRulePage.d.ts +39 -0
- package/dist/esm/models/WatchRulePage.js +48 -0
- package/dist/esm/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/esm/models/WatchRuleUpdate.js +68 -0
- package/dist/esm/models/index.d.ts +15 -0
- package/dist/esm/models/index.js +15 -0
- package/dist/models/AutolaunchRule.d.ts +181 -0
- package/dist/models/AutolaunchRule.js +150 -0
- package/dist/models/AutolaunchRuleCreate.d.ts +105 -0
- package/dist/models/AutolaunchRuleCreate.js +92 -0
- package/dist/models/AutolaunchRuleDisarm.d.ts +34 -0
- package/dist/models/AutolaunchRuleDisarm.js +50 -0
- package/dist/models/AutolaunchRulePage.d.ts +39 -0
- package/dist/models/AutolaunchRulePage.js +55 -0
- package/dist/models/Embedding.d.ts +51 -0
- package/dist/models/Embedding.js +67 -0
- package/dist/models/EmbeddingsRequest.d.ts +64 -0
- package/dist/models/EmbeddingsRequest.js +68 -0
- package/dist/models/EmbeddingsRequestInput.d.ts +21 -0
- package/dist/models/EmbeddingsRequestInput.js +53 -0
- package/dist/models/EmbeddingsResponse.d.ts +59 -0
- package/dist/models/EmbeddingsResponse.js +73 -0
- package/dist/models/EmbeddingsUsage.d.ts +38 -0
- package/dist/models/EmbeddingsUsage.js +54 -0
- package/dist/models/MarketHistoryPoint.d.ts +59 -0
- package/dist/models/MarketHistoryPoint.js +62 -0
- package/dist/models/MarketHistoryResponse.d.ts +60 -0
- package/dist/models/MarketHistoryResponse.js +67 -0
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/WatchRule.d.ts +141 -0
- package/dist/models/WatchRule.js +125 -0
- package/dist/models/WatchRuleCreate.d.ts +87 -0
- package/dist/models/WatchRuleCreate.js +80 -0
- package/dist/models/WatchRulePage.d.ts +39 -0
- package/dist/models/WatchRulePage.js +55 -0
- package/dist/models/WatchRuleUpdate.d.ts +86 -0
- package/dist/models/WatchRuleUpdate.js +76 -0
- package/dist/models/index.d.ts +15 -0
- package/dist/models/index.js +15 -0
- package/docs/AutolaunchApi.md +390 -0
- package/docs/AutolaunchRule.md +69 -0
- package/docs/AutolaunchRuleCreate.md +50 -0
- package/docs/AutolaunchRuleDisarm.md +35 -0
- package/docs/AutolaunchRulePage.md +36 -0
- package/docs/Embedding.md +38 -0
- package/docs/EmbeddingsRequest.md +42 -0
- package/docs/EmbeddingsRequestInput.md +33 -0
- package/docs/EmbeddingsResponse.md +40 -0
- package/docs/EmbeddingsUsage.md +37 -0
- package/docs/InferenceApi.md +83 -0
- package/docs/MarketApi.md +98 -0
- package/docs/MarketHistoryPoint.md +43 -0
- package/docs/MarketHistoryResponse.md +43 -0
- package/docs/WatchApi.md +389 -0
- package/docs/WatchRule.md +61 -0
- package/docs/WatchRuleCreate.md +46 -0
- package/docs/WatchRulePage.md +36 -0
- package/docs/WatchRuleUpdate.md +47 -0
- package/package.json +1 -1
- package/src/apis/AutolaunchApi.ts +360 -0
- package/src/apis/InferenceApi.ts +71 -0
- package/src/apis/MarketApi.ts +136 -0
- package/src/apis/WatchApi.ts +360 -0
- package/src/apis/index.ts +3 -0
- package/src/models/AutolaunchRule.ts +270 -0
- package/src/models/AutolaunchRuleCreate.ts +162 -0
- package/src/models/AutolaunchRuleDisarm.ts +68 -0
- package/src/models/AutolaunchRulePage.ts +83 -0
- package/src/models/Embedding.ts +96 -0
- package/src/models/EmbeddingsRequest.ts +117 -0
- package/src/models/EmbeddingsRequestInput.ts +59 -0
- package/src/models/EmbeddingsResponse.ts +120 -0
- package/src/models/EmbeddingsUsage.ts +75 -0
- package/src/models/MarketHistoryPoint.ts +103 -0
- package/src/models/MarketHistoryResponse.ts +113 -0
- package/src/models/Problem.ts +1 -0
- package/src/models/WatchRule.ts +219 -0
- package/src/models/WatchRuleCreate.ts +138 -0
- package/src/models/WatchRulePage.ts +83 -0
- package/src/models/WatchRuleUpdate.ts +135 -0
- package/src/models/index.ts +15 -0
|
@@ -0,0 +1,120 @@
|
|
|
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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { Embedding } from './Embedding';
|
|
17
|
+
import {
|
|
18
|
+
EmbeddingFromJSON,
|
|
19
|
+
EmbeddingFromJSONTyped,
|
|
20
|
+
EmbeddingToJSON,
|
|
21
|
+
EmbeddingToJSONTyped,
|
|
22
|
+
} from './Embedding';
|
|
23
|
+
import type { EmbeddingsUsage } from './EmbeddingsUsage';
|
|
24
|
+
import {
|
|
25
|
+
EmbeddingsUsageFromJSON,
|
|
26
|
+
EmbeddingsUsageFromJSONTyped,
|
|
27
|
+
EmbeddingsUsageToJSON,
|
|
28
|
+
EmbeddingsUsageToJSONTyped,
|
|
29
|
+
} from './EmbeddingsUsage';
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @export
|
|
34
|
+
* @interface EmbeddingsResponse
|
|
35
|
+
*/
|
|
36
|
+
export interface EmbeddingsResponse {
|
|
37
|
+
/**
|
|
38
|
+
*
|
|
39
|
+
* @type {EmbeddingsResponseObjectEnum}
|
|
40
|
+
* @memberof EmbeddingsResponse
|
|
41
|
+
*/
|
|
42
|
+
object: EmbeddingsResponseObjectEnum;
|
|
43
|
+
/**
|
|
44
|
+
*
|
|
45
|
+
* @type {Array<Embedding>}
|
|
46
|
+
* @memberof EmbeddingsResponse
|
|
47
|
+
*/
|
|
48
|
+
data: Array<Embedding>;
|
|
49
|
+
/**
|
|
50
|
+
* Canonical (gpuai/...) model id, NEVER the upstream identifier.
|
|
51
|
+
* @type {string}
|
|
52
|
+
* @memberof EmbeddingsResponse
|
|
53
|
+
*/
|
|
54
|
+
model: string;
|
|
55
|
+
/**
|
|
56
|
+
*
|
|
57
|
+
* @type {EmbeddingsUsage}
|
|
58
|
+
* @memberof EmbeddingsResponse
|
|
59
|
+
*/
|
|
60
|
+
usage: EmbeddingsUsage;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* @export
|
|
66
|
+
*/
|
|
67
|
+
export const EmbeddingsResponseObjectEnum = {
|
|
68
|
+
List: 'list'
|
|
69
|
+
} as const;
|
|
70
|
+
export type EmbeddingsResponseObjectEnum = typeof EmbeddingsResponseObjectEnum[keyof typeof EmbeddingsResponseObjectEnum];
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Check if a given object implements the EmbeddingsResponse interface.
|
|
75
|
+
*/
|
|
76
|
+
export function instanceOfEmbeddingsResponse(value: object): value is EmbeddingsResponse {
|
|
77
|
+
if (!('object' in value) || value['object'] === undefined) return false;
|
|
78
|
+
if (value['object'] !== 'list') return false;
|
|
79
|
+
|
|
80
|
+
if (!('data' in value) || value['data'] === undefined) return false;
|
|
81
|
+
if (!('model' in value) || value['model'] === undefined) return false;
|
|
82
|
+
if (!('usage' in value) || value['usage'] === undefined) return false;
|
|
83
|
+
return true;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export function EmbeddingsResponseFromJSON(json: any): EmbeddingsResponse {
|
|
87
|
+
return EmbeddingsResponseFromJSONTyped(json, false);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export function EmbeddingsResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmbeddingsResponse {
|
|
91
|
+
if (json == null) {
|
|
92
|
+
return json;
|
|
93
|
+
}
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'object': json['object'],
|
|
97
|
+
'data': ((json['data'] as Array<any>).map(EmbeddingFromJSON)),
|
|
98
|
+
'model': json['model'],
|
|
99
|
+
'usage': EmbeddingsUsageFromJSON(json['usage']),
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
export function EmbeddingsResponseToJSON(json: any): EmbeddingsResponse {
|
|
104
|
+
return EmbeddingsResponseToJSONTyped(json, false);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export function EmbeddingsResponseToJSONTyped(value?: EmbeddingsResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
108
|
+
if (value == null) {
|
|
109
|
+
return value;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
|
|
114
|
+
'object': value['object'],
|
|
115
|
+
'data': ((value['data'] as Array<any>).map(EmbeddingToJSON)),
|
|
116
|
+
'model': value['model'],
|
|
117
|
+
'usage': EmbeddingsUsageToJSON(value['usage']),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
|
|
@@ -0,0 +1,75 @@
|
|
|
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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* Embeddings are billed on input tokens only, so this block carries no completion_tokens field — an embeddings call emits none, and total_tokens always equals prompt_tokens.
|
|
18
|
+
* @export
|
|
19
|
+
* @interface EmbeddingsUsage
|
|
20
|
+
*/
|
|
21
|
+
export interface EmbeddingsUsage {
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @type {number}
|
|
25
|
+
* @memberof EmbeddingsUsage
|
|
26
|
+
*/
|
|
27
|
+
promptTokens: number;
|
|
28
|
+
/**
|
|
29
|
+
*
|
|
30
|
+
* @type {number}
|
|
31
|
+
* @memberof EmbeddingsUsage
|
|
32
|
+
*/
|
|
33
|
+
totalTokens: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Check if a given object implements the EmbeddingsUsage interface.
|
|
38
|
+
*/
|
|
39
|
+
export function instanceOfEmbeddingsUsage(value: object): value is EmbeddingsUsage {
|
|
40
|
+
if ((!('promptTokens' in (value as Record<string, any>)) && !('prompt_tokens' in (value as Record<string, any>))) || ((value as Record<string, any>)['promptTokens'] === undefined && (value as Record<string, any>)['prompt_tokens'] === undefined)) return false;
|
|
41
|
+
if ((!('totalTokens' in (value as Record<string, any>)) && !('total_tokens' in (value as Record<string, any>))) || ((value as Record<string, any>)['totalTokens'] === undefined && (value as Record<string, any>)['total_tokens'] === undefined)) return false;
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function EmbeddingsUsageFromJSON(json: any): EmbeddingsUsage {
|
|
46
|
+
return EmbeddingsUsageFromJSONTyped(json, false);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export function EmbeddingsUsageFromJSONTyped(json: any, ignoreDiscriminator: boolean): EmbeddingsUsage {
|
|
50
|
+
if (json == null) {
|
|
51
|
+
return json;
|
|
52
|
+
}
|
|
53
|
+
return {
|
|
54
|
+
|
|
55
|
+
'promptTokens': json['prompt_tokens'],
|
|
56
|
+
'totalTokens': json['total_tokens'],
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function EmbeddingsUsageToJSON(json: any): EmbeddingsUsage {
|
|
61
|
+
return EmbeddingsUsageToJSONTyped(json, false);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function EmbeddingsUsageToJSONTyped(value?: EmbeddingsUsage | null, ignoreDiscriminator: boolean = false): any {
|
|
65
|
+
if (value == null) {
|
|
66
|
+
return value;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
|
|
71
|
+
'prompt_tokens': value['promptTokens'],
|
|
72
|
+
'total_tokens': value['totalTokens'],
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
|
|
@@ -0,0 +1,103 @@
|
|
|
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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* One bucket of a price/stock series.
|
|
18
|
+
*
|
|
19
|
+
* The nullability of `price_per_gpu_hour` and `available_count` is the contract, not a convenience: a real 0 is a bucket we sampled and found sold out, and null is a bucket we never successfully sampled. A client that coerces null to 0 will report GPU.ai's own polling outages as supplier stockouts, and must not interpolate across a null.
|
|
20
|
+
*
|
|
21
|
+
* @export
|
|
22
|
+
* @interface MarketHistoryPoint
|
|
23
|
+
*/
|
|
24
|
+
export interface MarketHistoryPoint {
|
|
25
|
+
/**
|
|
26
|
+
* Start of the bucket, UTC, aligned to the bucket width.
|
|
27
|
+
* @type {Date}
|
|
28
|
+
* @memberof MarketHistoryPoint
|
|
29
|
+
*/
|
|
30
|
+
bucketTs: Date;
|
|
31
|
+
/**
|
|
32
|
+
* GPU.ai's floor per-GPU hourly rate for this bucket, or null if we did not sample this bucket. Null is NOT zero.
|
|
33
|
+
* @type {number}
|
|
34
|
+
* @memberof MarketHistoryPoint
|
|
35
|
+
*/
|
|
36
|
+
pricePerGpuHour: number | null;
|
|
37
|
+
/**
|
|
38
|
+
* Obtainable units across every matching offer in this bucket. 0 means we sampled and the market was sold out; null means we did not sample this bucket.
|
|
39
|
+
* @type {number}
|
|
40
|
+
* @memberof MarketHistoryPoint
|
|
41
|
+
*/
|
|
42
|
+
availableCount: number | null;
|
|
43
|
+
/**
|
|
44
|
+
* Whole-node hourly price the per-GPU rate was divided out of. Present only when the bucket's floor came from a multi-GPU node; absent for single-GPU capacity.
|
|
45
|
+
* @type {number}
|
|
46
|
+
* @memberof MarketHistoryPoint
|
|
47
|
+
*/
|
|
48
|
+
nodePricePerHour?: number;
|
|
49
|
+
/**
|
|
50
|
+
* GPUs in that node. Present only alongside `node_price_per_hour`, and it is what lets a renderer qualify a derived rate as "(from an 8-GPU node)" rather than implying single-GPU rentability.
|
|
51
|
+
* @type {number}
|
|
52
|
+
* @memberof MarketHistoryPoint
|
|
53
|
+
*/
|
|
54
|
+
gpuCount?: number;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Check if a given object implements the MarketHistoryPoint interface.
|
|
59
|
+
*/
|
|
60
|
+
export function instanceOfMarketHistoryPoint(value: object): value is MarketHistoryPoint {
|
|
61
|
+
if ((!('bucketTs' in (value as Record<string, any>)) && !('bucket_ts' in (value as Record<string, any>))) || ((value as Record<string, any>)['bucketTs'] === undefined && (value as Record<string, any>)['bucket_ts'] === undefined)) return false;
|
|
62
|
+
if ((!('pricePerGpuHour' in (value as Record<string, any>)) && !('price_per_gpu_hour' in (value as Record<string, any>))) || ((value as Record<string, any>)['pricePerGpuHour'] === undefined && (value as Record<string, any>)['price_per_gpu_hour'] === undefined)) return false;
|
|
63
|
+
if ((!('availableCount' in (value as Record<string, any>)) && !('available_count' in (value as Record<string, any>))) || ((value as Record<string, any>)['availableCount'] === undefined && (value as Record<string, any>)['available_count'] === undefined)) return false;
|
|
64
|
+
return true;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function MarketHistoryPointFromJSON(json: any): MarketHistoryPoint {
|
|
68
|
+
return MarketHistoryPointFromJSONTyped(json, false);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export function MarketHistoryPointFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketHistoryPoint {
|
|
72
|
+
if (json == null) {
|
|
73
|
+
return json;
|
|
74
|
+
}
|
|
75
|
+
return {
|
|
76
|
+
|
|
77
|
+
'bucketTs': (new Date(json['bucket_ts'])),
|
|
78
|
+
'pricePerGpuHour': json['price_per_gpu_hour'],
|
|
79
|
+
'availableCount': json['available_count'],
|
|
80
|
+
'nodePricePerHour': json['node_price_per_hour'] == null ? undefined : json['node_price_per_hour'],
|
|
81
|
+
'gpuCount': json['gpu_count'] == null ? undefined : json['gpu_count'],
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function MarketHistoryPointToJSON(json: any): MarketHistoryPoint {
|
|
86
|
+
return MarketHistoryPointToJSONTyped(json, false);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function MarketHistoryPointToJSONTyped(value?: MarketHistoryPoint | null, ignoreDiscriminator: boolean = false): any {
|
|
90
|
+
if (value == null) {
|
|
91
|
+
return value;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
return {
|
|
95
|
+
|
|
96
|
+
'bucket_ts': value['bucketTs'].toISOString(),
|
|
97
|
+
'price_per_gpu_hour': value['pricePerGpuHour'],
|
|
98
|
+
'available_count': value['availableCount'],
|
|
99
|
+
'node_price_per_hour': value['nodePricePerHour'],
|
|
100
|
+
'gpu_count': value['gpuCount'],
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
|
|
@@ -0,0 +1,113 @@
|
|
|
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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
import type { MarketHistoryPoint } from './MarketHistoryPoint';
|
|
17
|
+
import {
|
|
18
|
+
MarketHistoryPointFromJSON,
|
|
19
|
+
MarketHistoryPointFromJSONTyped,
|
|
20
|
+
MarketHistoryPointToJSON,
|
|
21
|
+
MarketHistoryPointToJSONTyped,
|
|
22
|
+
} from './MarketHistoryPoint';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* A price/stock series for one (gpu_model, region, capacity_class) key.
|
|
26
|
+
*
|
|
27
|
+
* Points cover the FULL bucket grid across the requested window, including the buckets we did not sample — a gap therefore has visible width rather than disappearing between two adjacent points.
|
|
28
|
+
*
|
|
29
|
+
* @export
|
|
30
|
+
* @interface MarketHistoryResponse
|
|
31
|
+
*/
|
|
32
|
+
export interface MarketHistoryResponse {
|
|
33
|
+
/**
|
|
34
|
+
*
|
|
35
|
+
* @type {string}
|
|
36
|
+
* @memberof MarketHistoryResponse
|
|
37
|
+
*/
|
|
38
|
+
gpuModel: string;
|
|
39
|
+
/**
|
|
40
|
+
* Echoes the request. Empty means the series is MERGED across every region, the same thing it meant on the way in.
|
|
41
|
+
* @type {string}
|
|
42
|
+
* @memberof MarketHistoryResponse
|
|
43
|
+
*/
|
|
44
|
+
region: string;
|
|
45
|
+
/**
|
|
46
|
+
* Echoes the request. Empty means the series is merged across both classes.
|
|
47
|
+
* @type {string}
|
|
48
|
+
* @memberof MarketHistoryResponse
|
|
49
|
+
*/
|
|
50
|
+
capacityClass: string;
|
|
51
|
+
/**
|
|
52
|
+
* Resolution the server actually answered at. Echoed because the wide views downsample at query time, so a client must never assume 900.
|
|
53
|
+
* @type {number}
|
|
54
|
+
* @memberof MarketHistoryResponse
|
|
55
|
+
*/
|
|
56
|
+
bucketSeconds: number;
|
|
57
|
+
/**
|
|
58
|
+
*
|
|
59
|
+
* @type {Array<MarketHistoryPoint>}
|
|
60
|
+
* @memberof MarketHistoryResponse
|
|
61
|
+
*/
|
|
62
|
+
points: Array<MarketHistoryPoint>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Check if a given object implements the MarketHistoryResponse interface.
|
|
67
|
+
*/
|
|
68
|
+
export function instanceOfMarketHistoryResponse(value: object): value is MarketHistoryResponse {
|
|
69
|
+
if ((!('gpuModel' in (value as Record<string, any>)) && !('gpu_model' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuModel'] === undefined && (value as Record<string, any>)['gpu_model'] === undefined)) return false;
|
|
70
|
+
if (!('region' in value) || value['region'] === undefined) return false;
|
|
71
|
+
if ((!('capacityClass' in (value as Record<string, any>)) && !('capacity_class' in (value as Record<string, any>))) || ((value as Record<string, any>)['capacityClass'] === undefined && (value as Record<string, any>)['capacity_class'] === undefined)) return false;
|
|
72
|
+
if ((!('bucketSeconds' in (value as Record<string, any>)) && !('bucket_seconds' in (value as Record<string, any>))) || ((value as Record<string, any>)['bucketSeconds'] === undefined && (value as Record<string, any>)['bucket_seconds'] === undefined)) return false;
|
|
73
|
+
if (!('points' in value) || value['points'] === undefined) return false;
|
|
74
|
+
return true;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export function MarketHistoryResponseFromJSON(json: any): MarketHistoryResponse {
|
|
78
|
+
return MarketHistoryResponseFromJSONTyped(json, false);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
export function MarketHistoryResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): MarketHistoryResponse {
|
|
82
|
+
if (json == null) {
|
|
83
|
+
return json;
|
|
84
|
+
}
|
|
85
|
+
return {
|
|
86
|
+
|
|
87
|
+
'gpuModel': json['gpu_model'],
|
|
88
|
+
'region': json['region'],
|
|
89
|
+
'capacityClass': json['capacity_class'],
|
|
90
|
+
'bucketSeconds': json['bucket_seconds'],
|
|
91
|
+
'points': ((json['points'] as Array<any>).map(MarketHistoryPointFromJSON)),
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function MarketHistoryResponseToJSON(json: any): MarketHistoryResponse {
|
|
96
|
+
return MarketHistoryResponseToJSONTyped(json, false);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export function MarketHistoryResponseToJSONTyped(value?: MarketHistoryResponse | null, ignoreDiscriminator: boolean = false): any {
|
|
100
|
+
if (value == null) {
|
|
101
|
+
return value;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
|
|
106
|
+
'gpu_model': value['gpuModel'],
|
|
107
|
+
'region': value['region'],
|
|
108
|
+
'capacity_class': value['capacityClass'],
|
|
109
|
+
'bucket_seconds': value['bucketSeconds'],
|
|
110
|
+
'points': ((value['points'] as Array<any>).map(MarketHistoryPointToJSON)),
|
|
111
|
+
};
|
|
112
|
+
}
|
|
113
|
+
|
package/src/models/Problem.ts
CHANGED
|
@@ -78,6 +78,7 @@ export const ProblemCodeEnum = {
|
|
|
78
78
|
InsufficientBalance: 'insufficient_balance',
|
|
79
79
|
QuotaExceeded: 'quota_exceeded',
|
|
80
80
|
RateLimited: 'rate_limited',
|
|
81
|
+
CreatorCheckUnavailable: 'creator_check_unavailable',
|
|
81
82
|
InternalError: 'internal_error',
|
|
82
83
|
OperationFailed: 'operation_failed'
|
|
83
84
|
} as const;
|
|
@@ -0,0 +1,219 @@
|
|
|
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
|
+
|
|
15
|
+
import { mapValues } from '../runtime';
|
|
16
|
+
/**
|
|
17
|
+
* A rule that notifies when the market moves on a GPU model. It carries no upstream supplier identity of any kind, and no delivery address — those are properties of the resource, not of a particular response.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface WatchRule
|
|
21
|
+
*/
|
|
22
|
+
export interface WatchRule {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof WatchRule
|
|
27
|
+
*/
|
|
28
|
+
id: string;
|
|
29
|
+
/**
|
|
30
|
+
* The GPU model the rule watches, e.g. "H100".
|
|
31
|
+
* @type {string}
|
|
32
|
+
* @memberof WatchRule
|
|
33
|
+
*/
|
|
34
|
+
gpuModel: string;
|
|
35
|
+
/**
|
|
36
|
+
* Canonical region the rule is narrowed to, or null for every region.
|
|
37
|
+
* @type {string}
|
|
38
|
+
* @memberof WatchRule
|
|
39
|
+
*/
|
|
40
|
+
region: string | null;
|
|
41
|
+
/**
|
|
42
|
+
* Capacity class the rule is narrowed to, or null for both.
|
|
43
|
+
* @type {WatchRuleCapacityClassEnum}
|
|
44
|
+
* @memberof WatchRule
|
|
45
|
+
*/
|
|
46
|
+
capacityClass: WatchRuleCapacityClassEnum | null;
|
|
47
|
+
/**
|
|
48
|
+
*
|
|
49
|
+
* @type {WatchRuleConditionKindEnum}
|
|
50
|
+
* @memberof WatchRule
|
|
51
|
+
*/
|
|
52
|
+
conditionKind: WatchRuleConditionKindEnum;
|
|
53
|
+
/**
|
|
54
|
+
* Per-GPU hourly price for price_under, or a unit count for count_at_least. Null for in_stock, which takes no threshold.
|
|
55
|
+
*
|
|
56
|
+
* @type {number}
|
|
57
|
+
* @memberof WatchRule
|
|
58
|
+
*/
|
|
59
|
+
threshold: number | null;
|
|
60
|
+
/**
|
|
61
|
+
* armed = the condition is currently false and the next transition to true will alert. fired = it has alerted and has not yet re-armed.
|
|
62
|
+
*
|
|
63
|
+
* @type {WatchRuleStateEnum}
|
|
64
|
+
* @memberof WatchRule
|
|
65
|
+
*/
|
|
66
|
+
state: WatchRuleStateEnum;
|
|
67
|
+
/**
|
|
68
|
+
*
|
|
69
|
+
* @type {Date}
|
|
70
|
+
* @memberof WatchRule
|
|
71
|
+
*/
|
|
72
|
+
lastFiredAt: Date | null;
|
|
73
|
+
/**
|
|
74
|
+
* While set, the rule will not re-fire even if the condition re-crosses — the quiet window that stops a boundary-hugging signal alerting on every crossing.
|
|
75
|
+
*
|
|
76
|
+
* @type {Date}
|
|
77
|
+
* @memberof WatchRule
|
|
78
|
+
*/
|
|
79
|
+
quietUntil: Date | null;
|
|
80
|
+
/**
|
|
81
|
+
* Id of a webhook endpoint registered by this organization, or null to deliver to every registered endpoint. Never a URL.
|
|
82
|
+
*
|
|
83
|
+
* @type {string}
|
|
84
|
+
* @memberof WatchRule
|
|
85
|
+
*/
|
|
86
|
+
webhookEndpointOverrideId: string | null;
|
|
87
|
+
/**
|
|
88
|
+
*
|
|
89
|
+
* @type {boolean}
|
|
90
|
+
* @memberof WatchRule
|
|
91
|
+
*/
|
|
92
|
+
enabled: boolean;
|
|
93
|
+
/**
|
|
94
|
+
* Why an automatically disabled rule was disabled — for example its creator no longer belongs to the organization.
|
|
95
|
+
*
|
|
96
|
+
* @type {string}
|
|
97
|
+
* @memberof WatchRule
|
|
98
|
+
*/
|
|
99
|
+
deactivatedReason: string | null;
|
|
100
|
+
/**
|
|
101
|
+
*
|
|
102
|
+
* @type {Date}
|
|
103
|
+
* @memberof WatchRule
|
|
104
|
+
*/
|
|
105
|
+
createdAt: Date;
|
|
106
|
+
/**
|
|
107
|
+
*
|
|
108
|
+
* @type {Date}
|
|
109
|
+
* @memberof WatchRule
|
|
110
|
+
*/
|
|
111
|
+
updatedAt: Date;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* @export
|
|
117
|
+
*/
|
|
118
|
+
export const WatchRuleCapacityClassEnum = {
|
|
119
|
+
Secure: 'secure',
|
|
120
|
+
Community: 'community'
|
|
121
|
+
} as const;
|
|
122
|
+
export type WatchRuleCapacityClassEnum = typeof WatchRuleCapacityClassEnum[keyof typeof WatchRuleCapacityClassEnum];
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* @export
|
|
126
|
+
*/
|
|
127
|
+
export const WatchRuleConditionKindEnum = {
|
|
128
|
+
PriceUnder: 'price_under',
|
|
129
|
+
InStock: 'in_stock',
|
|
130
|
+
CountAtLeast: 'count_at_least'
|
|
131
|
+
} as const;
|
|
132
|
+
export type WatchRuleConditionKindEnum = typeof WatchRuleConditionKindEnum[keyof typeof WatchRuleConditionKindEnum];
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* @export
|
|
136
|
+
*/
|
|
137
|
+
export const WatchRuleStateEnum = {
|
|
138
|
+
Armed: 'armed',
|
|
139
|
+
Fired: 'fired'
|
|
140
|
+
} as const;
|
|
141
|
+
export type WatchRuleStateEnum = typeof WatchRuleStateEnum[keyof typeof WatchRuleStateEnum];
|
|
142
|
+
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* Check if a given object implements the WatchRule interface.
|
|
146
|
+
*/
|
|
147
|
+
export function instanceOfWatchRule(value: object): value is WatchRule {
|
|
148
|
+
if (!('id' in value) || value['id'] === undefined) return false;
|
|
149
|
+
if ((!('gpuModel' in (value as Record<string, any>)) && !('gpu_model' in (value as Record<string, any>))) || ((value as Record<string, any>)['gpuModel'] === undefined && (value as Record<string, any>)['gpu_model'] === undefined)) return false;
|
|
150
|
+
if (!('region' in value) || value['region'] === undefined) return false;
|
|
151
|
+
if ((!('capacityClass' in (value as Record<string, any>)) && !('capacity_class' in (value as Record<string, any>))) || ((value as Record<string, any>)['capacityClass'] === undefined && (value as Record<string, any>)['capacity_class'] === undefined)) return false;
|
|
152
|
+
if ((!('conditionKind' in (value as Record<string, any>)) && !('condition_kind' in (value as Record<string, any>))) || ((value as Record<string, any>)['conditionKind'] === undefined && (value as Record<string, any>)['condition_kind'] === undefined)) return false;
|
|
153
|
+
if (!('threshold' in value) || value['threshold'] === undefined) return false;
|
|
154
|
+
if (!('state' in value) || value['state'] === undefined) return false;
|
|
155
|
+
if ((!('lastFiredAt' in (value as Record<string, any>)) && !('last_fired_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['lastFiredAt'] === undefined && (value as Record<string, any>)['last_fired_at'] === undefined)) return false;
|
|
156
|
+
if ((!('quietUntil' in (value as Record<string, any>)) && !('quiet_until' in (value as Record<string, any>))) || ((value as Record<string, any>)['quietUntil'] === undefined && (value as Record<string, any>)['quiet_until'] === undefined)) return false;
|
|
157
|
+
if ((!('webhookEndpointOverrideId' in (value as Record<string, any>)) && !('webhook_endpoint_override_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['webhookEndpointOverrideId'] === undefined && (value as Record<string, any>)['webhook_endpoint_override_id'] === undefined)) return false;
|
|
158
|
+
if (!('enabled' in value) || value['enabled'] === undefined) return false;
|
|
159
|
+
if ((!('deactivatedReason' in (value as Record<string, any>)) && !('deactivated_reason' in (value as Record<string, any>))) || ((value as Record<string, any>)['deactivatedReason'] === undefined && (value as Record<string, any>)['deactivated_reason'] === undefined)) return false;
|
|
160
|
+
if ((!('createdAt' in (value as Record<string, any>)) && !('created_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['createdAt'] === undefined && (value as Record<string, any>)['created_at'] === undefined)) return false;
|
|
161
|
+
if ((!('updatedAt' in (value as Record<string, any>)) && !('updated_at' in (value as Record<string, any>))) || ((value as Record<string, any>)['updatedAt'] === undefined && (value as Record<string, any>)['updated_at'] === undefined)) return false;
|
|
162
|
+
return true;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function WatchRuleFromJSON(json: any): WatchRule {
|
|
166
|
+
return WatchRuleFromJSONTyped(json, false);
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
export function WatchRuleFromJSONTyped(json: any, ignoreDiscriminator: boolean): WatchRule {
|
|
170
|
+
if (json == null) {
|
|
171
|
+
return json;
|
|
172
|
+
}
|
|
173
|
+
return {
|
|
174
|
+
|
|
175
|
+
'id': json['id'],
|
|
176
|
+
'gpuModel': json['gpu_model'],
|
|
177
|
+
'region': json['region'],
|
|
178
|
+
'capacityClass': json['capacity_class'],
|
|
179
|
+
'conditionKind': json['condition_kind'],
|
|
180
|
+
'threshold': json['threshold'],
|
|
181
|
+
'state': json['state'],
|
|
182
|
+
'lastFiredAt': (json['last_fired_at'] == null ? null : new Date(json['last_fired_at'])),
|
|
183
|
+
'quietUntil': (json['quiet_until'] == null ? null : new Date(json['quiet_until'])),
|
|
184
|
+
'webhookEndpointOverrideId': json['webhook_endpoint_override_id'],
|
|
185
|
+
'enabled': json['enabled'],
|
|
186
|
+
'deactivatedReason': json['deactivated_reason'],
|
|
187
|
+
'createdAt': (new Date(json['created_at'])),
|
|
188
|
+
'updatedAt': (new Date(json['updated_at'])),
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export function WatchRuleToJSON(json: any): WatchRule {
|
|
193
|
+
return WatchRuleToJSONTyped(json, false);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
export function WatchRuleToJSONTyped(value?: WatchRule | null, ignoreDiscriminator: boolean = false): any {
|
|
197
|
+
if (value == null) {
|
|
198
|
+
return value;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
return {
|
|
202
|
+
|
|
203
|
+
'id': value['id'],
|
|
204
|
+
'gpu_model': value['gpuModel'],
|
|
205
|
+
'region': value['region'],
|
|
206
|
+
'capacity_class': value['capacityClass'],
|
|
207
|
+
'condition_kind': value['conditionKind'],
|
|
208
|
+
'threshold': value['threshold'],
|
|
209
|
+
'state': value['state'],
|
|
210
|
+
'last_fired_at': value['lastFiredAt'] == null ? value['lastFiredAt'] : value['lastFiredAt'].toISOString(),
|
|
211
|
+
'quiet_until': value['quietUntil'] == null ? value['quietUntil'] : value['quietUntil'].toISOString(),
|
|
212
|
+
'webhook_endpoint_override_id': value['webhookEndpointOverrideId'],
|
|
213
|
+
'enabled': value['enabled'],
|
|
214
|
+
'deactivated_reason': value['deactivatedReason'],
|
|
215
|
+
'created_at': value['createdAt'].toISOString(),
|
|
216
|
+
'updated_at': value['updatedAt'].toISOString(),
|
|
217
|
+
};
|
|
218
|
+
}
|
|
219
|
+
|