@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
|
@@ -12,6 +12,8 @@
|
|
|
12
12
|
import * as runtime from '../runtime';
|
|
13
13
|
import { type ChatCompletionRequest } from '../models/ChatCompletionRequest';
|
|
14
14
|
import { type ChatCompletionResponse } from '../models/ChatCompletionResponse';
|
|
15
|
+
import { type EmbeddingsRequest } from '../models/EmbeddingsRequest';
|
|
16
|
+
import { type EmbeddingsResponse } from '../models/EmbeddingsResponse';
|
|
15
17
|
import { type ImagesGenerationsRequest } from '../models/ImagesGenerationsRequest';
|
|
16
18
|
import { type ImagesResponse } from '../models/ImagesResponse';
|
|
17
19
|
import { type Model } from '../models/Model';
|
|
@@ -25,6 +27,9 @@ export interface CancelVideoRequest {
|
|
|
25
27
|
export interface CreateChatCompletionRequest {
|
|
26
28
|
chatCompletionRequest: ChatCompletionRequest;
|
|
27
29
|
}
|
|
30
|
+
export interface CreateEmbeddingsRequest {
|
|
31
|
+
embeddingsRequest: EmbeddingsRequest;
|
|
32
|
+
}
|
|
28
33
|
export interface CreateImageRequest {
|
|
29
34
|
imagesGenerationsRequest: ImagesGenerationsRequest;
|
|
30
35
|
idempotencyKey?: string;
|
|
@@ -77,6 +82,20 @@ export declare class InferenceApi extends runtime.BaseAPI {
|
|
|
77
82
|
* Create a chat completion (OpenAI-compatible)
|
|
78
83
|
*/
|
|
79
84
|
createChatCompletion(requestParameters: CreateChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse>;
|
|
85
|
+
/**
|
|
86
|
+
* Creates request options for createEmbeddings without sending the request
|
|
87
|
+
*/
|
|
88
|
+
createEmbeddingsRequestOpts(requestParameters: CreateEmbeddingsRequest): Promise<runtime.RequestOpts>;
|
|
89
|
+
/**
|
|
90
|
+
* Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
|
|
91
|
+
* Create embeddings (OpenAI-compatible)
|
|
92
|
+
*/
|
|
93
|
+
createEmbeddingsRaw(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EmbeddingsResponse>>;
|
|
94
|
+
/**
|
|
95
|
+
* Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
|
|
96
|
+
* Create embeddings (OpenAI-compatible)
|
|
97
|
+
*/
|
|
98
|
+
createEmbeddings(requestParameters: CreateEmbeddingsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EmbeddingsResponse>;
|
|
80
99
|
/**
|
|
81
100
|
* Creates request options for createImage without sending the request
|
|
82
101
|
*/
|
|
@@ -26,6 +26,8 @@ exports.ListModelsModalityEnum = exports.InferenceApi = void 0;
|
|
|
26
26
|
const runtime = require("../runtime");
|
|
27
27
|
const ChatCompletionRequest_1 = require("../models/ChatCompletionRequest");
|
|
28
28
|
const ChatCompletionResponse_1 = require("../models/ChatCompletionResponse");
|
|
29
|
+
const EmbeddingsRequest_1 = require("../models/EmbeddingsRequest");
|
|
30
|
+
const EmbeddingsResponse_1 = require("../models/EmbeddingsResponse");
|
|
29
31
|
const ImagesGenerationsRequest_1 = require("../models/ImagesGenerationsRequest");
|
|
30
32
|
const ImagesResponse_1 = require("../models/ImagesResponse");
|
|
31
33
|
const Model_1 = require("../models/Model");
|
|
@@ -130,6 +132,55 @@ class InferenceApi extends runtime.BaseAPI {
|
|
|
130
132
|
return yield response.value();
|
|
131
133
|
});
|
|
132
134
|
}
|
|
135
|
+
/**
|
|
136
|
+
* Creates request options for createEmbeddings without sending the request
|
|
137
|
+
*/
|
|
138
|
+
createEmbeddingsRequestOpts(requestParameters) {
|
|
139
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
140
|
+
if (requestParameters['embeddingsRequest'] == null) {
|
|
141
|
+
throw new runtime.RequiredError('embeddingsRequest', 'Required parameter "embeddingsRequest" was null or undefined when calling createEmbeddings().');
|
|
142
|
+
}
|
|
143
|
+
const queryParameters = {};
|
|
144
|
+
const headerParameters = {};
|
|
145
|
+
headerParameters['Content-Type'] = 'application/json';
|
|
146
|
+
if (this.configuration && this.configuration.accessToken) {
|
|
147
|
+
const token = this.configuration.accessToken;
|
|
148
|
+
const tokenString = yield token("bearerAuth", []);
|
|
149
|
+
if (tokenString) {
|
|
150
|
+
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
let urlPath = `/embeddings`;
|
|
154
|
+
return {
|
|
155
|
+
path: urlPath,
|
|
156
|
+
method: 'POST',
|
|
157
|
+
headers: headerParameters,
|
|
158
|
+
query: queryParameters,
|
|
159
|
+
body: (0, EmbeddingsRequest_1.EmbeddingsRequestToJSON)(requestParameters['embeddingsRequest']),
|
|
160
|
+
};
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
|
|
165
|
+
* Create embeddings (OpenAI-compatible)
|
|
166
|
+
*/
|
|
167
|
+
createEmbeddingsRaw(requestParameters, initOverrides) {
|
|
168
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
169
|
+
const requestOptions = yield this.createEmbeddingsRequestOpts(requestParameters);
|
|
170
|
+
const response = yield this.request(requestOptions, initOverrides);
|
|
171
|
+
return new runtime.JSONApiResponse(response, (jsonValue) => (0, EmbeddingsResponse_1.EmbeddingsResponseFromJSON)(jsonValue));
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Synchronous text embeddings. Accepts a single string or an array of up to 2048 strings, bounded so the response stays under 64 MiB (about 680 inputs at 4096 dimensions; fewer at a larger `dimensions` value) — over-limit requests are rejected with 400 before any processing. Returns one float vector per input, in request order. Billed on the upstream\'s reported prompt tokens at the model\'s listed input rate, rounded up to the next whole cent per request; an embeddings call emits no completion tokens, so `usage` carries `prompt_tokens` and `total_tokens` only. `encoding_format` accepts only `float` — a value of `base64` is rejected with `unsupported_parameter`. A chat model id on this route returns 404 `model_not_found`: the id is valid, but not on this surface.
|
|
176
|
+
* Create embeddings (OpenAI-compatible)
|
|
177
|
+
*/
|
|
178
|
+
createEmbeddings(requestParameters, initOverrides) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
const response = yield this.createEmbeddingsRaw(requestParameters, initOverrides);
|
|
181
|
+
return yield response.value();
|
|
182
|
+
});
|
|
183
|
+
}
|
|
133
184
|
/**
|
|
134
185
|
* Creates request options for createImage without sending the request
|
|
135
186
|
*/
|
|
@@ -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
|
+
}
|