@gpuai/sdk 0.2.5 → 0.3.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 +6 -6
- package/README.md +15 -10
- package/dist/apis/BillingApi.d.ts +51 -0
- package/dist/apis/BillingApi.js +144 -0
- package/dist/apis/CommunityApi.d.ts +0 -55
- package/dist/apis/CommunityApi.js +0 -151
- package/dist/esm/apis/BillingApi.d.ts +51 -0
- package/dist/esm/apis/BillingApi.js +144 -0
- package/dist/esm/apis/CommunityApi.d.ts +0 -55
- package/dist/esm/apis/CommunityApi.js +0 -151
- package/dist/esm/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/esm/models/CreateCryptoDepositRequest.js +68 -0
- package/dist/esm/models/CryptoDeposit.d.ts +114 -0
- package/dist/esm/models/CryptoDeposit.js +90 -0
- package/dist/esm/models/Instance.d.ts +8 -1
- package/dist/esm/models/Instance.js +3 -0
- package/dist/esm/models/ListDeposits200Response.d.ts +39 -0
- package/dist/esm/models/ListDeposits200Response.js +48 -0
- package/dist/esm/models/index.d.ts +3 -3
- package/dist/esm/models/index.js +3 -3
- package/dist/models/CreateCryptoDepositRequest.d.ts +64 -0
- package/dist/models/CreateCryptoDepositRequest.js +76 -0
- package/dist/models/CryptoDeposit.d.ts +114 -0
- package/dist/models/CryptoDeposit.js +98 -0
- package/dist/models/Instance.d.ts +8 -1
- package/dist/models/Instance.js +3 -0
- package/dist/models/ListDeposits200Response.d.ts +39 -0
- package/dist/models/ListDeposits200Response.js +55 -0
- package/dist/models/index.d.ts +3 -3
- package/dist/models/index.js +3 -3
- package/docs/BillingApi.md +220 -0
- package/docs/CommunityApi.md +0 -230
- package/docs/CreateCryptoDepositRequest.md +38 -0
- package/docs/CryptoDeposit.md +55 -0
- package/docs/Instance.md +2 -0
- package/docs/InstancesApi.md +2 -2
- package/docs/ListDeposits200Response.md +36 -0
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +182 -0
- package/src/apis/CommunityApi.ts +0 -199
- package/src/models/CreateCryptoDepositRequest.ts +108 -0
- package/src/models/CryptoDeposit.ts +177 -0
- package/src/models/Instance.ts +10 -1
- package/src/models/ListDeposits200Response.ts +83 -0
- package/src/models/index.ts +3 -3
|
@@ -0,0 +1,177 @@
|
|
|
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 stablecoin deposit. Mirrors the Go DTO field for field. Like that struct, this schema deliberately has NO payment-processor property — the processor is an implementation detail and is structurally absent from the customer contract, not merely filtered out.
|
|
18
|
+
*
|
|
19
|
+
* @export
|
|
20
|
+
* @interface CryptoDeposit
|
|
21
|
+
*/
|
|
22
|
+
export interface CryptoDeposit {
|
|
23
|
+
/**
|
|
24
|
+
*
|
|
25
|
+
* @type {string}
|
|
26
|
+
* @memberof CryptoDeposit
|
|
27
|
+
*/
|
|
28
|
+
depositId: string;
|
|
29
|
+
/**
|
|
30
|
+
* Lifecycle state: created, detected, confirming, settled, screening, held_screening, credited, credited_underpaid, credited_overpaid, expired, expired_received, failed, failed_screening.
|
|
31
|
+
*
|
|
32
|
+
* @type {string}
|
|
33
|
+
* @memberof CryptoDeposit
|
|
34
|
+
*/
|
|
35
|
+
status: string;
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @type {CryptoDepositChainEnum}
|
|
39
|
+
* @memberof CryptoDeposit
|
|
40
|
+
*/
|
|
41
|
+
chain: CryptoDepositChainEnum;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* @type {CryptoDepositAssetEnum}
|
|
45
|
+
* @memberof CryptoDeposit
|
|
46
|
+
*/
|
|
47
|
+
asset: CryptoDepositAssetEnum;
|
|
48
|
+
/**
|
|
49
|
+
* The address to send funds to. Unique to this deposit.
|
|
50
|
+
* @type {string}
|
|
51
|
+
* @memberof CryptoDeposit
|
|
52
|
+
*/
|
|
53
|
+
payAddress?: string;
|
|
54
|
+
/**
|
|
55
|
+
* The exact token amount to send, as a decimal string (never a number — the value must not round-trip through a float).
|
|
56
|
+
*
|
|
57
|
+
* @type {string}
|
|
58
|
+
* @memberof CryptoDeposit
|
|
59
|
+
*/
|
|
60
|
+
payAmount?: string;
|
|
61
|
+
/**
|
|
62
|
+
* The amount requested, in USD cents. Never the settled or credited value.
|
|
63
|
+
* @type {number}
|
|
64
|
+
* @memberof CryptoDeposit
|
|
65
|
+
*/
|
|
66
|
+
amountUsdCents: number;
|
|
67
|
+
/**
|
|
68
|
+
* USD cents actually credited to the balance. Absent until credited.
|
|
69
|
+
* @type {number}
|
|
70
|
+
* @memberof CryptoDeposit
|
|
71
|
+
*/
|
|
72
|
+
creditedCents?: number;
|
|
73
|
+
/**
|
|
74
|
+
*
|
|
75
|
+
* @type {string}
|
|
76
|
+
* @memberof CryptoDeposit
|
|
77
|
+
*/
|
|
78
|
+
txHash?: string;
|
|
79
|
+
/**
|
|
80
|
+
* RFC3339 UTC. After this, send nothing to pay_address.
|
|
81
|
+
* @type {Date}
|
|
82
|
+
* @memberof CryptoDeposit
|
|
83
|
+
*/
|
|
84
|
+
expiresAt?: Date;
|
|
85
|
+
/**
|
|
86
|
+
*
|
|
87
|
+
* @type {Date}
|
|
88
|
+
* @memberof CryptoDeposit
|
|
89
|
+
*/
|
|
90
|
+
createdAt: Date;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* @export
|
|
96
|
+
*/
|
|
97
|
+
export const CryptoDepositChainEnum = {
|
|
98
|
+
Ethereum: 'ethereum',
|
|
99
|
+
Base: 'base',
|
|
100
|
+
Arbitrum: 'arbitrum',
|
|
101
|
+
Polygon: 'polygon',
|
|
102
|
+
Solana: 'solana'
|
|
103
|
+
} as const;
|
|
104
|
+
export type CryptoDepositChainEnum = typeof CryptoDepositChainEnum[keyof typeof CryptoDepositChainEnum];
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* @export
|
|
108
|
+
*/
|
|
109
|
+
export const CryptoDepositAssetEnum = {
|
|
110
|
+
Usdc: 'usdc',
|
|
111
|
+
Usdt: 'usdt'
|
|
112
|
+
} as const;
|
|
113
|
+
export type CryptoDepositAssetEnum = typeof CryptoDepositAssetEnum[keyof typeof CryptoDepositAssetEnum];
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Check if a given object implements the CryptoDeposit interface.
|
|
118
|
+
*/
|
|
119
|
+
export function instanceOfCryptoDeposit(value: object): value is CryptoDeposit {
|
|
120
|
+
if ((!('depositId' in (value as Record<string, any>)) && !('deposit_id' in (value as Record<string, any>))) || ((value as Record<string, any>)['depositId'] === undefined && (value as Record<string, any>)['deposit_id'] === undefined)) return false;
|
|
121
|
+
if (!('status' in value) || value['status'] === undefined) return false;
|
|
122
|
+
if (!('chain' in value) || value['chain'] === undefined) return false;
|
|
123
|
+
if (!('asset' in value) || value['asset'] === undefined) return false;
|
|
124
|
+
if ((!('amountUsdCents' in (value as Record<string, any>)) && !('amount_usd_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['amountUsdCents'] === undefined && (value as Record<string, any>)['amount_usd_cents'] === undefined)) return false;
|
|
125
|
+
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;
|
|
126
|
+
return true;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
export function CryptoDepositFromJSON(json: any): CryptoDeposit {
|
|
130
|
+
return CryptoDepositFromJSONTyped(json, false);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export function CryptoDepositFromJSONTyped(json: any, ignoreDiscriminator: boolean): CryptoDeposit {
|
|
134
|
+
if (json == null) {
|
|
135
|
+
return json;
|
|
136
|
+
}
|
|
137
|
+
return {
|
|
138
|
+
|
|
139
|
+
'depositId': json['deposit_id'],
|
|
140
|
+
'status': json['status'],
|
|
141
|
+
'chain': json['chain'],
|
|
142
|
+
'asset': json['asset'],
|
|
143
|
+
'payAddress': json['pay_address'] == null ? undefined : json['pay_address'],
|
|
144
|
+
'payAmount': json['pay_amount'] == null ? undefined : json['pay_amount'],
|
|
145
|
+
'amountUsdCents': json['amount_usd_cents'],
|
|
146
|
+
'creditedCents': json['credited_cents'] == null ? undefined : json['credited_cents'],
|
|
147
|
+
'txHash': json['tx_hash'] == null ? undefined : json['tx_hash'],
|
|
148
|
+
'expiresAt': json['expires_at'] == null ? undefined : (new Date(json['expires_at'])),
|
|
149
|
+
'createdAt': (new Date(json['created_at'])),
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
export function CryptoDepositToJSON(json: any): CryptoDeposit {
|
|
154
|
+
return CryptoDepositToJSONTyped(json, false);
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export function CryptoDepositToJSONTyped(value?: CryptoDeposit | null, ignoreDiscriminator: boolean = false): any {
|
|
158
|
+
if (value == null) {
|
|
159
|
+
return value;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
return {
|
|
163
|
+
|
|
164
|
+
'deposit_id': value['depositId'],
|
|
165
|
+
'status': value['status'],
|
|
166
|
+
'chain': value['chain'],
|
|
167
|
+
'asset': value['asset'],
|
|
168
|
+
'pay_address': value['payAddress'],
|
|
169
|
+
'pay_amount': value['payAmount'],
|
|
170
|
+
'amount_usd_cents': value['amountUsdCents'],
|
|
171
|
+
'credited_cents': value['creditedCents'],
|
|
172
|
+
'tx_hash': value['txHash'],
|
|
173
|
+
'expires_at': value['expiresAt'] == null ? value['expiresAt'] : value['expiresAt'].toISOString(),
|
|
174
|
+
'created_at': value['createdAt'].toISOString(),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
|
package/src/models/Instance.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface Instance {
|
|
|
40
40
|
*/
|
|
41
41
|
name?: string;
|
|
42
42
|
/**
|
|
43
|
-
* Customer-facing lifecycle status. "allocating" = the GPU is still being acquired from the provider (slow-boot capacity such as baremetal can take ~15 min); "starting" = the node exists and is booting; "running" = ready to use.
|
|
43
|
+
* Customer-facing lifecycle status. "allocating" = the GPU is still being acquired from the provider (slow-boot capacity such as baremetal can take ~15 min); "starting" = the node exists and is booting; "running" = ready to use. "unreachable" = the platform's tunnel probe has confirmed the SSH path is down while the machine may still be up: the instance is NOT usable right now, billing for the confirmed-dead window is auto-credited back, and the instance either recovers to "running" on its own or is failed after a grace window. It is a degraded reading of a running instance, not a separate lifecycle state — see unreachable_since.
|
|
44
44
|
* @type {InstanceStatusEnum}
|
|
45
45
|
* @memberof Instance
|
|
46
46
|
*/
|
|
@@ -117,6 +117,12 @@ export interface Instance {
|
|
|
117
117
|
* @memberof Instance
|
|
118
118
|
*/
|
|
119
119
|
lastReachableAt?: Date;
|
|
120
|
+
/**
|
|
121
|
+
* Start of the confirmed tunnel outage the instance is currently in. Present exactly when status is "unreachable", absent otherwise. It is the timestamp the auto-credit for the dead window is computed from, so a ledger credit can be reconciled against it.
|
|
122
|
+
* @type {Date}
|
|
123
|
+
* @memberof Instance
|
|
124
|
+
*/
|
|
125
|
+
unreachableSince?: Date;
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
|
|
@@ -130,6 +136,7 @@ export const InstanceStatusEnum = {
|
|
|
130
136
|
Stopping: 'stopping',
|
|
131
137
|
Stopped: 'stopped',
|
|
132
138
|
Terminated: 'terminated',
|
|
139
|
+
Unreachable: 'unreachable',
|
|
133
140
|
Error: 'error'
|
|
134
141
|
} as const;
|
|
135
142
|
export type InstanceStatusEnum = typeof InstanceStatusEnum[keyof typeof InstanceStatusEnum];
|
|
@@ -184,6 +191,7 @@ export function InstanceFromJSONTyped(json: any, ignoreDiscriminator: boolean):
|
|
|
184
191
|
'readyAt': json['ready_at'] == null ? undefined : (new Date(json['ready_at'])),
|
|
185
192
|
'terminatedAt': json['terminated_at'] == null ? undefined : (new Date(json['terminated_at'])),
|
|
186
193
|
'lastReachableAt': json['last_reachable_at'] == null ? undefined : (new Date(json['last_reachable_at'])),
|
|
194
|
+
'unreachableSince': json['unreachable_since'] == null ? undefined : (new Date(json['unreachable_since'])),
|
|
187
195
|
};
|
|
188
196
|
}
|
|
189
197
|
|
|
@@ -213,6 +221,7 @@ export function InstanceToJSONTyped(value?: Instance | null, ignoreDiscriminator
|
|
|
213
221
|
'ready_at': value['readyAt'] == null ? value['readyAt'] : value['readyAt'].toISOString(),
|
|
214
222
|
'terminated_at': value['terminatedAt'] == null ? value['terminatedAt'] : value['terminatedAt'].toISOString(),
|
|
215
223
|
'last_reachable_at': value['lastReachableAt'] == null ? value['lastReachableAt'] : value['lastReachableAt'].toISOString(),
|
|
224
|
+
'unreachable_since': value['unreachableSince'] == null ? value['unreachableSince'] : value['unreachableSince'].toISOString(),
|
|
216
225
|
};
|
|
217
226
|
}
|
|
218
227
|
|
|
@@ -0,0 +1,83 @@
|
|
|
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 { CryptoDeposit } from './CryptoDeposit';
|
|
17
|
+
import {
|
|
18
|
+
CryptoDepositFromJSON,
|
|
19
|
+
CryptoDepositFromJSONTyped,
|
|
20
|
+
CryptoDepositToJSON,
|
|
21
|
+
CryptoDepositToJSONTyped,
|
|
22
|
+
} from './CryptoDeposit';
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
*
|
|
26
|
+
* @export
|
|
27
|
+
* @interface ListDeposits200Response
|
|
28
|
+
*/
|
|
29
|
+
export interface ListDeposits200Response {
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @type {Array<CryptoDeposit>}
|
|
33
|
+
* @memberof ListDeposits200Response
|
|
34
|
+
*/
|
|
35
|
+
deposits: Array<CryptoDeposit>;
|
|
36
|
+
/**
|
|
37
|
+
* The effective minimum deposit in USD cents (admin override, else the deployment's configured floor). Validate amounts against this live value rather than hardcoding the default.
|
|
38
|
+
* @type {number}
|
|
39
|
+
* @memberof ListDeposits200Response
|
|
40
|
+
*/
|
|
41
|
+
minDepositCents: number;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Check if a given object implements the ListDeposits200Response interface.
|
|
46
|
+
*/
|
|
47
|
+
export function instanceOfListDeposits200Response(value: object): value is ListDeposits200Response {
|
|
48
|
+
if (!('deposits' in value) || value['deposits'] === undefined) return false;
|
|
49
|
+
if ((!('minDepositCents' in (value as Record<string, any>)) && !('min_deposit_cents' in (value as Record<string, any>))) || ((value as Record<string, any>)['minDepositCents'] === undefined && (value as Record<string, any>)['min_deposit_cents'] === undefined)) return false;
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export function ListDeposits200ResponseFromJSON(json: any): ListDeposits200Response {
|
|
54
|
+
return ListDeposits200ResponseFromJSONTyped(json, false);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export function ListDeposits200ResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): ListDeposits200Response {
|
|
58
|
+
if (json == null) {
|
|
59
|
+
return json;
|
|
60
|
+
}
|
|
61
|
+
return {
|
|
62
|
+
|
|
63
|
+
'deposits': ((json['deposits'] as Array<any>).map(CryptoDepositFromJSON)),
|
|
64
|
+
'minDepositCents': json['min_deposit_cents'],
|
|
65
|
+
};
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export function ListDeposits200ResponseToJSON(json: any): ListDeposits200Response {
|
|
69
|
+
return ListDeposits200ResponseToJSONTyped(json, false);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export function ListDeposits200ResponseToJSONTyped(value?: ListDeposits200Response | null, ignoreDiscriminator: boolean = false): any {
|
|
73
|
+
if (value == null) {
|
|
74
|
+
return value;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
return {
|
|
78
|
+
|
|
79
|
+
'deposits': ((value['deposits'] as Array<any>).map(CryptoDepositToJSON)),
|
|
80
|
+
'min_deposit_cents': value['minDepositCents'],
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
|
package/src/models/index.ts
CHANGED
|
@@ -4,12 +4,11 @@ export * from './ChatChoice';
|
|
|
4
4
|
export * from './ChatCompletionRequest';
|
|
5
5
|
export * from './ChatCompletionResponse';
|
|
6
6
|
export * from './ChatMessage';
|
|
7
|
-
export * from './CommunityEarnings';
|
|
8
|
-
export * from './CommunityEarningsEntry';
|
|
9
7
|
export * from './CommunityMachine';
|
|
10
8
|
export * from './CommunityMachineDelistResult';
|
|
11
9
|
export * from './CommunityMachineRegistration';
|
|
12
10
|
export * from './CommunitySupplier';
|
|
11
|
+
export * from './CreateCryptoDepositRequest';
|
|
13
12
|
export * from './CreateFineTuningJobRequest';
|
|
14
13
|
export * from './CreateFineTuningJobRequestGpuai';
|
|
15
14
|
export * from './CreateFineTuningJobRequestMethod';
|
|
@@ -17,6 +16,7 @@ export * from './CreateFineTuningJobRequestMethodLora';
|
|
|
17
16
|
export * from './CreateInstanceRequest';
|
|
18
17
|
export * from './CreateSshKeyRequest';
|
|
19
18
|
export * from './CreateWebhookEndpointRequest';
|
|
19
|
+
export * from './CryptoDeposit';
|
|
20
20
|
export * from './Environments';
|
|
21
21
|
export * from './FileObject';
|
|
22
22
|
export * from './FineTuningJob';
|
|
@@ -38,6 +38,7 @@ export * from './Instance';
|
|
|
38
38
|
export * from './InstanceConnection';
|
|
39
39
|
export * from './InstancePage';
|
|
40
40
|
export * from './ListCommunityMachines200Response';
|
|
41
|
+
export * from './ListDeposits200Response';
|
|
41
42
|
export * from './Model';
|
|
42
43
|
export * from './ModelList';
|
|
43
44
|
export * from './ModelParametersInner';
|
|
@@ -60,7 +61,6 @@ export * from './Template';
|
|
|
60
61
|
export * from './TemplateEnvInner';
|
|
61
62
|
export * from './TemplateList';
|
|
62
63
|
export * from './TemplatePortsInner';
|
|
63
|
-
export * from './UpdateCommunityMachineRequest';
|
|
64
64
|
export * from './UpdateInstanceRequest';
|
|
65
65
|
export * from './UpdateSpendingLimitRequest';
|
|
66
66
|
export * from './Usage';
|