@gpuai/sdk 0.1.4 → 0.2.1
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 +0 -6
- package/README.md +4 -15
- package/dist/apis/BillingApi.d.ts +0 -51
- package/dist/apis/BillingApi.js +0 -144
- package/dist/esm/apis/BillingApi.d.ts +0 -51
- package/dist/esm/apis/BillingApi.js +0 -144
- package/dist/esm/models/CreateInstanceRequest.d.ts +1 -1
- package/dist/esm/models/Problem.d.ts +1 -0
- package/dist/esm/models/Problem.js +1 -0
- package/dist/esm/models/index.d.ts +0 -3
- package/dist/esm/models/index.js +0 -3
- package/dist/models/CreateInstanceRequest.d.ts +1 -1
- package/dist/models/Problem.d.ts +1 -0
- package/dist/models/Problem.js +1 -0
- package/dist/models/index.d.ts +0 -3
- package/dist/models/index.js +0 -3
- package/docs/BillingApi.md +0 -220
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +0 -182
- package/src/models/CreateInstanceRequest.ts +1 -1
- package/src/models/Problem.ts +1 -0
- package/src/models/index.ts +0 -3
- package/dist/esm/models/CreateCryptoDepositRequest.d.ts +0 -64
- package/dist/esm/models/CreateCryptoDepositRequest.js +0 -68
- package/dist/esm/models/CryptoDeposit.d.ts +0 -114
- package/dist/esm/models/CryptoDeposit.js +0 -90
- package/dist/esm/models/ListDeposits200Response.d.ts +0 -39
- package/dist/esm/models/ListDeposits200Response.js +0 -48
- package/dist/models/CreateCryptoDepositRequest.d.ts +0 -64
- package/dist/models/CreateCryptoDepositRequest.js +0 -76
- package/dist/models/CryptoDeposit.d.ts +0 -114
- package/dist/models/CryptoDeposit.js +0 -98
- package/dist/models/ListDeposits200Response.d.ts +0 -39
- package/dist/models/ListDeposits200Response.js +0 -55
- package/docs/CreateCryptoDepositRequest.md +0 -38
- package/docs/CryptoDeposit.md +0 -55
- package/docs/ListDeposits200Response.md +0 -36
- package/src/models/CreateCryptoDepositRequest.ts +0 -108
- package/src/models/CryptoDeposit.ts +0 -177
- package/src/models/ListDeposits200Response.ts +0 -83
package/dist/esm/models/index.js
CHANGED
|
@@ -10,7 +10,6 @@ export * from './CommunityMachine';
|
|
|
10
10
|
export * from './CommunityMachineDelistResult';
|
|
11
11
|
export * from './CommunityMachineRegistration';
|
|
12
12
|
export * from './CommunitySupplier';
|
|
13
|
-
export * from './CreateCryptoDepositRequest';
|
|
14
13
|
export * from './CreateFineTuningJobRequest';
|
|
15
14
|
export * from './CreateFineTuningJobRequestGpuai';
|
|
16
15
|
export * from './CreateFineTuningJobRequestMethod';
|
|
@@ -18,7 +17,6 @@ export * from './CreateFineTuningJobRequestMethodLora';
|
|
|
18
17
|
export * from './CreateInstanceRequest';
|
|
19
18
|
export * from './CreateSshKeyRequest';
|
|
20
19
|
export * from './CreateWebhookEndpointRequest';
|
|
21
|
-
export * from './CryptoDeposit';
|
|
22
20
|
export * from './Environments';
|
|
23
21
|
export * from './FileObject';
|
|
24
22
|
export * from './FineTuningJob';
|
|
@@ -40,7 +38,6 @@ export * from './Instance';
|
|
|
40
38
|
export * from './InstanceConnection';
|
|
41
39
|
export * from './InstancePage';
|
|
42
40
|
export * from './ListCommunityMachines200Response';
|
|
43
|
-
export * from './ListDeposits200Response';
|
|
44
41
|
export * from './Model';
|
|
45
42
|
export * from './ModelList';
|
|
46
43
|
export * from './ModelParametersInner';
|
|
@@ -76,7 +76,7 @@ export interface CreateInstanceRequest {
|
|
|
76
76
|
*/
|
|
77
77
|
offeringId?: string;
|
|
78
78
|
/**
|
|
79
|
-
* Requested instance filesystem size in GB. Omit for the platform default (100 GB), which never narrows placement. Setting it is a hard requirement: placement narrows to capacity that can honor it (see `disk_configurable` on GET /v1/pricing), and a request no offering of the gpu_type can honor returns 422 `disk_unavailable` rather than launching with a different size. Disk beyond the included allowance (100 GB) is billed at the offering's `disk_price_per_gb_hour` (GET /v1/pricing), folded into the instance's single hourly rate. Bounds: at least 10, at most the platform ceiling (currently 1000) — outside them returns 422 `validation_failed`.
|
|
79
|
+
* Requested instance filesystem size in GB. Omit for the platform default (100 GB), which never narrows placement. Setting it is a hard requirement: placement narrows to capacity that can honor it (see `disk_configurable` on GET /v1/pricing), and a request no offering of the gpu_type can honor returns 422 `disk_unavailable` rather than launching with a different size. When the launch also pins an exact `offering_id`, a disk_gb larger than that offering's displayed `storage_gb` returns 422 `disk_exceeds_offering` rather than launching with a clamped filesystem. Disk beyond the included allowance (100 GB) is billed at the offering's `disk_price_per_gb_hour` (GET /v1/pricing), folded into the instance's single hourly rate. Bounds: at least 10, at most the platform ceiling (currently 1000) — outside them returns 422 `validation_failed`.
|
|
80
80
|
* @type {number}
|
|
81
81
|
* @memberof CreateInstanceRequest
|
|
82
82
|
*/
|
package/dist/models/Problem.d.ts
CHANGED
|
@@ -65,6 +65,7 @@ export declare const ProblemCodeEnum: {
|
|
|
65
65
|
readonly ValidationFailed: "validation_failed";
|
|
66
66
|
readonly InvalidGpuType: "invalid_gpu_type";
|
|
67
67
|
readonly DiskUnavailable: "disk_unavailable";
|
|
68
|
+
readonly DiskExceedsOffering: "disk_exceeds_offering";
|
|
68
69
|
readonly ModelTooLarge: "model_too_large";
|
|
69
70
|
readonly InsufficientBalance: "insufficient_balance";
|
|
70
71
|
readonly QuotaExceeded: "quota_exceeded";
|
package/dist/models/Problem.js
CHANGED
|
@@ -32,6 +32,7 @@ exports.ProblemCodeEnum = {
|
|
|
32
32
|
ValidationFailed: 'validation_failed',
|
|
33
33
|
InvalidGpuType: 'invalid_gpu_type',
|
|
34
34
|
DiskUnavailable: 'disk_unavailable',
|
|
35
|
+
DiskExceedsOffering: 'disk_exceeds_offering',
|
|
35
36
|
ModelTooLarge: 'model_too_large',
|
|
36
37
|
InsufficientBalance: 'insufficient_balance',
|
|
37
38
|
QuotaExceeded: 'quota_exceeded',
|
package/dist/models/index.d.ts
CHANGED
|
@@ -8,7 +8,6 @@ export * from './CommunityMachine';
|
|
|
8
8
|
export * from './CommunityMachineDelistResult';
|
|
9
9
|
export * from './CommunityMachineRegistration';
|
|
10
10
|
export * from './CommunitySupplier';
|
|
11
|
-
export * from './CreateCryptoDepositRequest';
|
|
12
11
|
export * from './CreateFineTuningJobRequest';
|
|
13
12
|
export * from './CreateFineTuningJobRequestGpuai';
|
|
14
13
|
export * from './CreateFineTuningJobRequestMethod';
|
|
@@ -16,7 +15,6 @@ export * from './CreateFineTuningJobRequestMethodLora';
|
|
|
16
15
|
export * from './CreateInstanceRequest';
|
|
17
16
|
export * from './CreateSshKeyRequest';
|
|
18
17
|
export * from './CreateWebhookEndpointRequest';
|
|
19
|
-
export * from './CryptoDeposit';
|
|
20
18
|
export * from './Environments';
|
|
21
19
|
export * from './FileObject';
|
|
22
20
|
export * from './FineTuningJob';
|
|
@@ -38,7 +36,6 @@ export * from './Instance';
|
|
|
38
36
|
export * from './InstanceConnection';
|
|
39
37
|
export * from './InstancePage';
|
|
40
38
|
export * from './ListCommunityMachines200Response';
|
|
41
|
-
export * from './ListDeposits200Response';
|
|
42
39
|
export * from './Model';
|
|
43
40
|
export * from './ModelList';
|
|
44
41
|
export * from './ModelParametersInner';
|
package/dist/models/index.js
CHANGED
|
@@ -26,7 +26,6 @@ __exportStar(require("./CommunityMachine"), exports);
|
|
|
26
26
|
__exportStar(require("./CommunityMachineDelistResult"), exports);
|
|
27
27
|
__exportStar(require("./CommunityMachineRegistration"), exports);
|
|
28
28
|
__exportStar(require("./CommunitySupplier"), exports);
|
|
29
|
-
__exportStar(require("./CreateCryptoDepositRequest"), exports);
|
|
30
29
|
__exportStar(require("./CreateFineTuningJobRequest"), exports);
|
|
31
30
|
__exportStar(require("./CreateFineTuningJobRequestGpuai"), exports);
|
|
32
31
|
__exportStar(require("./CreateFineTuningJobRequestMethod"), exports);
|
|
@@ -34,7 +33,6 @@ __exportStar(require("./CreateFineTuningJobRequestMethodLora"), exports);
|
|
|
34
33
|
__exportStar(require("./CreateInstanceRequest"), exports);
|
|
35
34
|
__exportStar(require("./CreateSshKeyRequest"), exports);
|
|
36
35
|
__exportStar(require("./CreateWebhookEndpointRequest"), exports);
|
|
37
|
-
__exportStar(require("./CryptoDeposit"), exports);
|
|
38
36
|
__exportStar(require("./Environments"), exports);
|
|
39
37
|
__exportStar(require("./FileObject"), exports);
|
|
40
38
|
__exportStar(require("./FineTuningJob"), exports);
|
|
@@ -56,7 +54,6 @@ __exportStar(require("./Instance"), exports);
|
|
|
56
54
|
__exportStar(require("./InstanceConnection"), exports);
|
|
57
55
|
__exportStar(require("./InstancePage"), exports);
|
|
58
56
|
__exportStar(require("./ListCommunityMachines200Response"), exports);
|
|
59
|
-
__exportStar(require("./ListDeposits200Response"), exports);
|
|
60
57
|
__exportStar(require("./Model"), exports);
|
|
61
58
|
__exportStar(require("./ModelList"), exports);
|
|
62
59
|
__exportStar(require("./ModelParametersInner"), exports);
|
package/docs/BillingApi.md
CHANGED
|
@@ -4,165 +4,11 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
4
4
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
|
-
| [**createCryptoDeposit**](BillingApi.md#createcryptodepositoperation) | **POST** /billing/deposits/crypto | Create a stablecoin deposit |
|
|
8
|
-
| [**getDeposit**](BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit |
|
|
9
7
|
| [**getSpendingLimit**](BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit |
|
|
10
|
-
| [**listDeposits**](BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits |
|
|
11
8
|
| [**updateSpendingLimit**](BillingApi.md#updatespendinglimitoperation) | **PUT** /billing/spending-limit | Set the org spending limit |
|
|
12
9
|
|
|
13
10
|
|
|
14
11
|
|
|
15
|
-
## createCryptoDeposit
|
|
16
|
-
|
|
17
|
-
> CryptoDeposit createCryptoDeposit(createCryptoDepositRequest)
|
|
18
|
-
|
|
19
|
-
Create a stablecoin deposit
|
|
20
|
-
|
|
21
|
-
Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
22
|
-
|
|
23
|
-
### Example
|
|
24
|
-
|
|
25
|
-
```ts
|
|
26
|
-
import {
|
|
27
|
-
Configuration,
|
|
28
|
-
BillingApi,
|
|
29
|
-
} from '@gpuai/sdk';
|
|
30
|
-
import type { CreateCryptoDepositOperationRequest } from '@gpuai/sdk';
|
|
31
|
-
|
|
32
|
-
async function example() {
|
|
33
|
-
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
34
|
-
const config = new Configuration({
|
|
35
|
-
// Configure HTTP bearer authorization: bearerAuth
|
|
36
|
-
accessToken: "YOUR BEARER TOKEN",
|
|
37
|
-
});
|
|
38
|
-
const api = new BillingApi(config);
|
|
39
|
-
|
|
40
|
-
const body = {
|
|
41
|
-
// CreateCryptoDepositRequest
|
|
42
|
-
createCryptoDepositRequest: ...,
|
|
43
|
-
} satisfies CreateCryptoDepositOperationRequest;
|
|
44
|
-
|
|
45
|
-
try {
|
|
46
|
-
const data = await api.createCryptoDeposit(body);
|
|
47
|
-
console.log(data);
|
|
48
|
-
} catch (error) {
|
|
49
|
-
console.error(error);
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
// Run the test
|
|
54
|
-
example().catch(console.error);
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
### Parameters
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
| Name | Type | Description | Notes |
|
|
61
|
-
|------------- | ------------- | ------------- | -------------|
|
|
62
|
-
| **createCryptoDepositRequest** | [CreateCryptoDepositRequest](CreateCryptoDepositRequest.md) | | |
|
|
63
|
-
|
|
64
|
-
### Return type
|
|
65
|
-
|
|
66
|
-
[**CryptoDeposit**](CryptoDeposit.md)
|
|
67
|
-
|
|
68
|
-
### Authorization
|
|
69
|
-
|
|
70
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
71
|
-
|
|
72
|
-
### HTTP request headers
|
|
73
|
-
|
|
74
|
-
- **Content-Type**: `application/json`
|
|
75
|
-
- **Accept**: `application/json`, `application/problem+json`
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
### HTTP response details
|
|
79
|
-
| Status code | Description | Response headers |
|
|
80
|
-
|-------------|-------------|------------------|
|
|
81
|
-
| **201** | Created | - |
|
|
82
|
-
| **400** | `validation-error` — `amount_cents` is below the configured minimum. `unsupported-chain-asset` — the chain/asset pair is not available. `invalid-request` — malformed JSON body. | - |
|
|
83
|
-
| **403** | `org-frozen` — the organization cannot add funds; contact support. | - |
|
|
84
|
-
| **404** | Error response (RFC 7807) | - |
|
|
85
|
-
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
86
|
-
| **503** | `payment-source-unavailable` — deposits are temporarily unavailable; retry shortly. | - |
|
|
87
|
-
| **0** | Error response (RFC 7807) | - |
|
|
88
|
-
|
|
89
|
-
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
## getDeposit
|
|
93
|
-
|
|
94
|
-
> CryptoDeposit getDeposit(id)
|
|
95
|
-
|
|
96
|
-
Get one stablecoin deposit
|
|
97
|
-
|
|
98
|
-
Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
|
|
99
|
-
|
|
100
|
-
### Example
|
|
101
|
-
|
|
102
|
-
```ts
|
|
103
|
-
import {
|
|
104
|
-
Configuration,
|
|
105
|
-
BillingApi,
|
|
106
|
-
} from '@gpuai/sdk';
|
|
107
|
-
import type { GetDepositRequest } from '@gpuai/sdk';
|
|
108
|
-
|
|
109
|
-
async function example() {
|
|
110
|
-
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
111
|
-
const config = new Configuration({
|
|
112
|
-
// Configure HTTP bearer authorization: bearerAuth
|
|
113
|
-
accessToken: "YOUR BEARER TOKEN",
|
|
114
|
-
});
|
|
115
|
-
const api = new BillingApi(config);
|
|
116
|
-
|
|
117
|
-
const body = {
|
|
118
|
-
// string | The deposit id.
|
|
119
|
-
id: id_example,
|
|
120
|
-
} satisfies GetDepositRequest;
|
|
121
|
-
|
|
122
|
-
try {
|
|
123
|
-
const data = await api.getDeposit(body);
|
|
124
|
-
console.log(data);
|
|
125
|
-
} catch (error) {
|
|
126
|
-
console.error(error);
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
// Run the test
|
|
131
|
-
example().catch(console.error);
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Parameters
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| Name | Type | Description | Notes |
|
|
138
|
-
|------------- | ------------- | ------------- | -------------|
|
|
139
|
-
| **id** | `string` | The deposit id. | [Defaults to `undefined`] |
|
|
140
|
-
|
|
141
|
-
### Return type
|
|
142
|
-
|
|
143
|
-
[**CryptoDeposit**](CryptoDeposit.md)
|
|
144
|
-
|
|
145
|
-
### Authorization
|
|
146
|
-
|
|
147
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
148
|
-
|
|
149
|
-
### HTTP request headers
|
|
150
|
-
|
|
151
|
-
- **Content-Type**: Not defined
|
|
152
|
-
- **Accept**: `application/json`, `application/problem+json`
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
### HTTP response details
|
|
156
|
-
| Status code | Description | Response headers |
|
|
157
|
-
|-------------|-------------|------------------|
|
|
158
|
-
| **200** | OK | - |
|
|
159
|
-
| **404** | `deposit-not-found` — no such deposit, or it belongs to another organization. `not-found` — the feature is not enabled. | - |
|
|
160
|
-
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
161
|
-
| **0** | Error response (RFC 7807) | - |
|
|
162
|
-
|
|
163
|
-
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
164
|
-
|
|
165
|
-
|
|
166
12
|
## getSpendingLimit
|
|
167
13
|
|
|
168
14
|
> SpendingLimit getSpendingLimit()
|
|
@@ -229,72 +75,6 @@ This endpoint does not need any parameter.
|
|
|
229
75
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
230
76
|
|
|
231
77
|
|
|
232
|
-
## listDeposits
|
|
233
|
-
|
|
234
|
-
> ListDeposits200Response listDeposits()
|
|
235
|
-
|
|
236
|
-
List stablecoin deposits
|
|
237
|
-
|
|
238
|
-
Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
239
|
-
|
|
240
|
-
### Example
|
|
241
|
-
|
|
242
|
-
```ts
|
|
243
|
-
import {
|
|
244
|
-
Configuration,
|
|
245
|
-
BillingApi,
|
|
246
|
-
} from '@gpuai/sdk';
|
|
247
|
-
import type { ListDepositsRequest } from '@gpuai/sdk';
|
|
248
|
-
|
|
249
|
-
async function example() {
|
|
250
|
-
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
251
|
-
const config = new Configuration({
|
|
252
|
-
// Configure HTTP bearer authorization: bearerAuth
|
|
253
|
-
accessToken: "YOUR BEARER TOKEN",
|
|
254
|
-
});
|
|
255
|
-
const api = new BillingApi(config);
|
|
256
|
-
|
|
257
|
-
try {
|
|
258
|
-
const data = await api.listDeposits();
|
|
259
|
-
console.log(data);
|
|
260
|
-
} catch (error) {
|
|
261
|
-
console.error(error);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
|
|
265
|
-
// Run the test
|
|
266
|
-
example().catch(console.error);
|
|
267
|
-
```
|
|
268
|
-
|
|
269
|
-
### Parameters
|
|
270
|
-
|
|
271
|
-
This endpoint does not need any parameter.
|
|
272
|
-
|
|
273
|
-
### Return type
|
|
274
|
-
|
|
275
|
-
[**ListDeposits200Response**](ListDeposits200Response.md)
|
|
276
|
-
|
|
277
|
-
### Authorization
|
|
278
|
-
|
|
279
|
-
[bearerAuth](../README.md#bearerAuth)
|
|
280
|
-
|
|
281
|
-
### HTTP request headers
|
|
282
|
-
|
|
283
|
-
- **Content-Type**: Not defined
|
|
284
|
-
- **Accept**: `application/json`, `application/problem+json`
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
### HTTP response details
|
|
288
|
-
| Status code | Description | Response headers |
|
|
289
|
-
|-------------|-------------|------------------|
|
|
290
|
-
| **200** | OK | - |
|
|
291
|
-
| **404** | Error response (RFC 7807) | - |
|
|
292
|
-
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
293
|
-
| **0** | Error response (RFC 7807) | - |
|
|
294
|
-
|
|
295
|
-
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
296
|
-
|
|
297
|
-
|
|
298
78
|
## updateSpendingLimit
|
|
299
79
|
|
|
300
80
|
> SpendingLimit updateSpendingLimit(updateSpendingLimitRequest)
|
package/package.json
CHANGED
package/src/apis/BillingApi.ts
CHANGED
|
@@ -13,21 +13,6 @@
|
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
15
|
import * as runtime from '../runtime';
|
|
16
|
-
import {
|
|
17
|
-
type CreateCryptoDepositRequest,
|
|
18
|
-
CreateCryptoDepositRequestFromJSON,
|
|
19
|
-
CreateCryptoDepositRequestToJSON,
|
|
20
|
-
} from '../models/CreateCryptoDepositRequest';
|
|
21
|
-
import {
|
|
22
|
-
type CryptoDeposit,
|
|
23
|
-
CryptoDepositFromJSON,
|
|
24
|
-
CryptoDepositToJSON,
|
|
25
|
-
} from '../models/CryptoDeposit';
|
|
26
|
-
import {
|
|
27
|
-
type ListDeposits200Response,
|
|
28
|
-
ListDeposits200ResponseFromJSON,
|
|
29
|
-
ListDeposits200ResponseToJSON,
|
|
30
|
-
} from '../models/ListDeposits200Response';
|
|
31
16
|
import {
|
|
32
17
|
type Problem,
|
|
33
18
|
ProblemFromJSON,
|
|
@@ -44,14 +29,6 @@ import {
|
|
|
44
29
|
UpdateSpendingLimitRequestToJSON,
|
|
45
30
|
} from '../models/UpdateSpendingLimitRequest';
|
|
46
31
|
|
|
47
|
-
export interface CreateCryptoDepositOperationRequest {
|
|
48
|
-
createCryptoDepositRequest: CreateCryptoDepositRequest;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export interface GetDepositRequest {
|
|
52
|
-
id: string;
|
|
53
|
-
}
|
|
54
|
-
|
|
55
32
|
export interface UpdateSpendingLimitOperationRequest {
|
|
56
33
|
updateSpendingLimitRequest: UpdateSpendingLimitRequest;
|
|
57
34
|
}
|
|
@@ -61,118 +38,6 @@ export interface UpdateSpendingLimitOperationRequest {
|
|
|
61
38
|
*/
|
|
62
39
|
export class BillingApi extends runtime.BaseAPI {
|
|
63
40
|
|
|
64
|
-
/**
|
|
65
|
-
* Creates request options for createCryptoDeposit without sending the request
|
|
66
|
-
*/
|
|
67
|
-
async createCryptoDepositRequestOpts(requestParameters: CreateCryptoDepositOperationRequest): Promise<runtime.RequestOpts> {
|
|
68
|
-
if (requestParameters['createCryptoDepositRequest'] == null) {
|
|
69
|
-
throw new runtime.RequiredError(
|
|
70
|
-
'createCryptoDepositRequest',
|
|
71
|
-
'Required parameter "createCryptoDepositRequest" was null or undefined when calling createCryptoDeposit().'
|
|
72
|
-
);
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
const queryParameters: any = {};
|
|
76
|
-
|
|
77
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
78
|
-
|
|
79
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
80
|
-
|
|
81
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
82
|
-
const token = this.configuration.accessToken;
|
|
83
|
-
const tokenString = await token("bearerAuth", []);
|
|
84
|
-
|
|
85
|
-
if (tokenString) {
|
|
86
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
|
|
90
|
-
let urlPath = `/billing/deposits/crypto`;
|
|
91
|
-
|
|
92
|
-
return {
|
|
93
|
-
path: urlPath,
|
|
94
|
-
method: 'POST',
|
|
95
|
-
headers: headerParameters,
|
|
96
|
-
query: queryParameters,
|
|
97
|
-
body: CreateCryptoDepositRequestToJSON(requestParameters['createCryptoDepositRequest']),
|
|
98
|
-
};
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
/**
|
|
102
|
-
* Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
103
|
-
* Create a stablecoin deposit
|
|
104
|
-
*/
|
|
105
|
-
async createCryptoDepositRaw(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>> {
|
|
106
|
-
const requestOptions = await this.createCryptoDepositRequestOpts(requestParameters);
|
|
107
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
108
|
-
|
|
109
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CryptoDepositFromJSON(jsonValue));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Creates a deposit intent and returns the payment address and the exact token amount to send. Requires the `billing:write` scope; any member of the organization may add funds. Send the exact `pay_amount` of `asset` on `chain` and no other network — funds sent on a different network are not detected automatically. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
114
|
-
* Create a stablecoin deposit
|
|
115
|
-
*/
|
|
116
|
-
async createCryptoDeposit(requestParameters: CreateCryptoDepositOperationRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit> {
|
|
117
|
-
const response = await this.createCryptoDepositRaw(requestParameters, initOverrides);
|
|
118
|
-
return await response.value();
|
|
119
|
-
}
|
|
120
|
-
|
|
121
|
-
/**
|
|
122
|
-
* Creates request options for getDeposit without sending the request
|
|
123
|
-
*/
|
|
124
|
-
async getDepositRequestOpts(requestParameters: GetDepositRequest): Promise<runtime.RequestOpts> {
|
|
125
|
-
if (requestParameters['id'] == null) {
|
|
126
|
-
throw new runtime.RequiredError(
|
|
127
|
-
'id',
|
|
128
|
-
'Required parameter "id" was null or undefined when calling getDeposit().'
|
|
129
|
-
);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
const queryParameters: any = {};
|
|
133
|
-
|
|
134
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
135
|
-
|
|
136
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
137
|
-
const token = this.configuration.accessToken;
|
|
138
|
-
const tokenString = await token("bearerAuth", []);
|
|
139
|
-
|
|
140
|
-
if (tokenString) {
|
|
141
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
let urlPath = `/billing/deposits/{id}`;
|
|
146
|
-
urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
|
|
147
|
-
|
|
148
|
-
return {
|
|
149
|
-
path: urlPath,
|
|
150
|
-
method: 'GET',
|
|
151
|
-
headers: headerParameters,
|
|
152
|
-
query: queryParameters,
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
|
|
158
|
-
* Get one stablecoin deposit
|
|
159
|
-
*/
|
|
160
|
-
async getDepositRaw(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<CryptoDeposit>> {
|
|
161
|
-
const requestOptions = await this.getDepositRequestOpts(requestParameters);
|
|
162
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
163
|
-
|
|
164
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => CryptoDepositFromJSON(jsonValue));
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
/**
|
|
168
|
-
* Returns a single deposit belonging to the caller\'s organization. Requires the `billing:read` scope. A deposit belonging to another organization returns the same `404 deposit-not-found` as one that does not exist — deliberately, so this endpoint cannot be used to test whether a deposit id is real. Also 404 when stablecoin deposits are not enabled for this deployment.
|
|
169
|
-
* Get one stablecoin deposit
|
|
170
|
-
*/
|
|
171
|
-
async getDeposit(requestParameters: GetDepositRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<CryptoDeposit> {
|
|
172
|
-
const response = await this.getDepositRaw(requestParameters, initOverrides);
|
|
173
|
-
return await response.value();
|
|
174
|
-
}
|
|
175
|
-
|
|
176
41
|
/**
|
|
177
42
|
* Creates request options for getSpendingLimit without sending the request
|
|
178
43
|
*/
|
|
@@ -220,53 +85,6 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
220
85
|
return await response.value();
|
|
221
86
|
}
|
|
222
87
|
|
|
223
|
-
/**
|
|
224
|
-
* Creates request options for listDeposits without sending the request
|
|
225
|
-
*/
|
|
226
|
-
async listDepositsRequestOpts(): Promise<runtime.RequestOpts> {
|
|
227
|
-
const queryParameters: any = {};
|
|
228
|
-
|
|
229
|
-
const headerParameters: runtime.HTTPHeaders = {};
|
|
230
|
-
|
|
231
|
-
if (this.configuration && this.configuration.accessToken) {
|
|
232
|
-
const token = this.configuration.accessToken;
|
|
233
|
-
const tokenString = await token("bearerAuth", []);
|
|
234
|
-
|
|
235
|
-
if (tokenString) {
|
|
236
|
-
headerParameters["Authorization"] = `Bearer ${tokenString}`;
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
let urlPath = `/billing/deposits`;
|
|
241
|
-
|
|
242
|
-
return {
|
|
243
|
-
path: urlPath,
|
|
244
|
-
method: 'GET',
|
|
245
|
-
headers: headerParameters,
|
|
246
|
-
query: queryParameters,
|
|
247
|
-
};
|
|
248
|
-
}
|
|
249
|
-
|
|
250
|
-
/**
|
|
251
|
-
* Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
252
|
-
* List stablecoin deposits
|
|
253
|
-
*/
|
|
254
|
-
async listDepositsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ListDeposits200Response>> {
|
|
255
|
-
const requestOptions = await this.listDepositsRequestOpts();
|
|
256
|
-
const response = await this.request(requestOptions, initOverrides);
|
|
257
|
-
|
|
258
|
-
return new runtime.JSONApiResponse(response, (jsonValue) => ListDeposits200ResponseFromJSON(jsonValue));
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
/**
|
|
262
|
-
* Returns the organization\'s stablecoin deposits, newest first, capped at 50. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Returns 404 when stablecoin deposits are not enabled for this deployment.
|
|
263
|
-
* List stablecoin deposits
|
|
264
|
-
*/
|
|
265
|
-
async listDeposits(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ListDeposits200Response> {
|
|
266
|
-
const response = await this.listDepositsRaw(initOverrides);
|
|
267
|
-
return await response.value();
|
|
268
|
-
}
|
|
269
|
-
|
|
270
88
|
/**
|
|
271
89
|
* Creates request options for updateSpendingLimit without sending the request
|
|
272
90
|
*/
|
|
@@ -80,7 +80,7 @@ export interface CreateInstanceRequest {
|
|
|
80
80
|
*/
|
|
81
81
|
offeringId?: string;
|
|
82
82
|
/**
|
|
83
|
-
* Requested instance filesystem size in GB. Omit for the platform default (100 GB), which never narrows placement. Setting it is a hard requirement: placement narrows to capacity that can honor it (see `disk_configurable` on GET /v1/pricing), and a request no offering of the gpu_type can honor returns 422 `disk_unavailable` rather than launching with a different size. Disk beyond the included allowance (100 GB) is billed at the offering's `disk_price_per_gb_hour` (GET /v1/pricing), folded into the instance's single hourly rate. Bounds: at least 10, at most the platform ceiling (currently 1000) — outside them returns 422 `validation_failed`.
|
|
83
|
+
* Requested instance filesystem size in GB. Omit for the platform default (100 GB), which never narrows placement. Setting it is a hard requirement: placement narrows to capacity that can honor it (see `disk_configurable` on GET /v1/pricing), and a request no offering of the gpu_type can honor returns 422 `disk_unavailable` rather than launching with a different size. When the launch also pins an exact `offering_id`, a disk_gb larger than that offering's displayed `storage_gb` returns 422 `disk_exceeds_offering` rather than launching with a clamped filesystem. Disk beyond the included allowance (100 GB) is billed at the offering's `disk_price_per_gb_hour` (GET /v1/pricing), folded into the instance's single hourly rate. Bounds: at least 10, at most the platform ceiling (currently 1000) — outside them returns 422 `validation_failed`.
|
|
84
84
|
* @type {number}
|
|
85
85
|
* @memberof CreateInstanceRequest
|
|
86
86
|
*/
|
package/src/models/Problem.ts
CHANGED
|
@@ -71,6 +71,7 @@ export const ProblemCodeEnum = {
|
|
|
71
71
|
ValidationFailed: 'validation_failed',
|
|
72
72
|
InvalidGpuType: 'invalid_gpu_type',
|
|
73
73
|
DiskUnavailable: 'disk_unavailable',
|
|
74
|
+
DiskExceedsOffering: 'disk_exceeds_offering',
|
|
74
75
|
ModelTooLarge: 'model_too_large',
|
|
75
76
|
InsufficientBalance: 'insufficient_balance',
|
|
76
77
|
QuotaExceeded: 'quota_exceeded',
|
package/src/models/index.ts
CHANGED
|
@@ -10,7 +10,6 @@ export * from './CommunityMachine';
|
|
|
10
10
|
export * from './CommunityMachineDelistResult';
|
|
11
11
|
export * from './CommunityMachineRegistration';
|
|
12
12
|
export * from './CommunitySupplier';
|
|
13
|
-
export * from './CreateCryptoDepositRequest';
|
|
14
13
|
export * from './CreateFineTuningJobRequest';
|
|
15
14
|
export * from './CreateFineTuningJobRequestGpuai';
|
|
16
15
|
export * from './CreateFineTuningJobRequestMethod';
|
|
@@ -18,7 +17,6 @@ export * from './CreateFineTuningJobRequestMethodLora';
|
|
|
18
17
|
export * from './CreateInstanceRequest';
|
|
19
18
|
export * from './CreateSshKeyRequest';
|
|
20
19
|
export * from './CreateWebhookEndpointRequest';
|
|
21
|
-
export * from './CryptoDeposit';
|
|
22
20
|
export * from './Environments';
|
|
23
21
|
export * from './FileObject';
|
|
24
22
|
export * from './FineTuningJob';
|
|
@@ -40,7 +38,6 @@ export * from './Instance';
|
|
|
40
38
|
export * from './InstanceConnection';
|
|
41
39
|
export * from './InstancePage';
|
|
42
40
|
export * from './ListCommunityMachines200Response';
|
|
43
|
-
export * from './ListDeposits200Response';
|
|
44
41
|
export * from './Model';
|
|
45
42
|
export * from './ModelList';
|
|
46
43
|
export * from './ModelParametersInner';
|
|
@@ -1,64 +0,0 @@
|
|
|
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 CreateCryptoDepositRequest
|
|
16
|
-
*/
|
|
17
|
-
export interface CreateCryptoDepositRequest {
|
|
18
|
-
/**
|
|
19
|
-
* Amount to deposit in USD cents. Must be at least the configured minimum (500 = $5.00 by default).
|
|
20
|
-
*
|
|
21
|
-
* @type {number}
|
|
22
|
-
* @memberof CreateCryptoDepositRequest
|
|
23
|
-
*/
|
|
24
|
-
amountCents: number;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {CreateCryptoDepositRequestChainEnum}
|
|
28
|
-
* @memberof CreateCryptoDepositRequest
|
|
29
|
-
*/
|
|
30
|
-
chain: CreateCryptoDepositRequestChainEnum;
|
|
31
|
-
/**
|
|
32
|
-
*
|
|
33
|
-
* @type {CreateCryptoDepositRequestAssetEnum}
|
|
34
|
-
* @memberof CreateCryptoDepositRequest
|
|
35
|
-
*/
|
|
36
|
-
asset: CreateCryptoDepositRequestAssetEnum;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* @export
|
|
40
|
-
*/
|
|
41
|
-
export declare const CreateCryptoDepositRequestChainEnum: {
|
|
42
|
-
readonly Ethereum: "ethereum";
|
|
43
|
-
readonly Base: "base";
|
|
44
|
-
readonly Arbitrum: "arbitrum";
|
|
45
|
-
readonly Polygon: "polygon";
|
|
46
|
-
readonly Solana: "solana";
|
|
47
|
-
};
|
|
48
|
-
export type CreateCryptoDepositRequestChainEnum = typeof CreateCryptoDepositRequestChainEnum[keyof typeof CreateCryptoDepositRequestChainEnum];
|
|
49
|
-
/**
|
|
50
|
-
* @export
|
|
51
|
-
*/
|
|
52
|
-
export declare const CreateCryptoDepositRequestAssetEnum: {
|
|
53
|
-
readonly Usdc: "usdc";
|
|
54
|
-
readonly Usdt: "usdt";
|
|
55
|
-
};
|
|
56
|
-
export type CreateCryptoDepositRequestAssetEnum = typeof CreateCryptoDepositRequestAssetEnum[keyof typeof CreateCryptoDepositRequestAssetEnum];
|
|
57
|
-
/**
|
|
58
|
-
* Check if a given object implements the CreateCryptoDepositRequest interface.
|
|
59
|
-
*/
|
|
60
|
-
export declare function instanceOfCreateCryptoDepositRequest(value: object): value is CreateCryptoDepositRequest;
|
|
61
|
-
export declare function CreateCryptoDepositRequestFromJSON(json: any): CreateCryptoDepositRequest;
|
|
62
|
-
export declare function CreateCryptoDepositRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): CreateCryptoDepositRequest;
|
|
63
|
-
export declare function CreateCryptoDepositRequestToJSON(json: any): CreateCryptoDepositRequest;
|
|
64
|
-
export declare function CreateCryptoDepositRequestToJSONTyped(value?: CreateCryptoDepositRequest | null, ignoreDiscriminator?: boolean): any;
|