@gpuai/sdk 0.3.18 → 0.4.0
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 +40 -0
- package/README.md +36 -2
- package/dist/apis/BillingApi.d.ts +70 -0
- package/dist/apis/BillingApi.js +197 -0
- package/dist/apis/FunctionsApi.d.ts +228 -0
- package/dist/apis/FunctionsApi.js +627 -0
- package/dist/apis/index.d.ts +1 -0
- package/dist/apis/index.js +1 -0
- package/dist/esm/apis/BillingApi.d.ts +70 -0
- package/dist/esm/apis/BillingApi.js +197 -0
- package/dist/esm/apis/FunctionsApi.d.ts +228 -0
- package/dist/esm/apis/FunctionsApi.js +623 -0
- package/dist/esm/apis/index.d.ts +1 -0
- package/dist/esm/apis/index.js +1 -0
- package/dist/esm/models/AutolaunchRule.d.ts +2 -1
- package/dist/esm/models/BillingDetails.d.ts +98 -0
- package/dist/esm/models/BillingDetails.js +85 -0
- package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
- package/dist/esm/models/CreateFunctionRequest.js +43 -0
- package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
- package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
- package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
- package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
- package/dist/esm/models/Function.d.ts +163 -0
- package/dist/esm/models/Function.js +109 -0
- package/dist/esm/models/FunctionList.d.ts +33 -0
- package/dist/esm/models/FunctionList.js +44 -0
- package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
- package/dist/esm/models/FunctionReplicaCounts.js +51 -0
- package/dist/esm/models/FunctionRun.d.ts +130 -0
- package/dist/esm/models/FunctionRun.js +94 -0
- package/dist/esm/models/FunctionRunError.d.ts +44 -0
- package/dist/esm/models/FunctionRunError.js +49 -0
- package/dist/esm/models/FunctionRunList.d.ts +39 -0
- package/dist/esm/models/FunctionRunList.js +48 -0
- package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
- package/dist/esm/models/FunctionRunLogChunk.js +63 -0
- package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
- package/dist/esm/models/FunctionRunLogs.js +52 -0
- package/dist/esm/models/FunctionUpload.d.ts +51 -0
- package/dist/esm/models/FunctionUpload.js +59 -0
- package/dist/esm/models/FunctionVersion.d.ts +137 -0
- package/dist/esm/models/FunctionVersion.js +109 -0
- package/dist/esm/models/Invoice.d.ts +68 -0
- package/dist/esm/models/Invoice.js +67 -0
- package/dist/esm/models/InvoiceList.d.ts +45 -0
- package/dist/esm/models/InvoiceList.js +50 -0
- package/dist/esm/models/ModelPricing.d.ts +46 -0
- package/dist/esm/models/ModelPricing.js +21 -0
- package/dist/esm/models/ModelRate.d.ts +62 -0
- package/dist/esm/models/ModelRate.js +51 -0
- package/dist/esm/models/PeakWindow.d.ts +38 -0
- package/dist/esm/models/PeakWindow.js +47 -0
- package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
- package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
- package/dist/esm/models/index.d.ts +19 -0
- package/dist/esm/models/index.js +19 -0
- package/dist/esm/runtime.js +1 -1
- package/dist/models/AutolaunchRule.d.ts +2 -1
- package/dist/models/BillingDetails.d.ts +98 -0
- package/dist/models/BillingDetails.js +92 -0
- package/dist/models/CreateFunctionRequest.d.ts +32 -0
- package/dist/models/CreateFunctionRequest.js +50 -0
- package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
- package/dist/models/CreateFunctionRunRequest.js +52 -0
- package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
- package/dist/models/CreateFunctionVersionRequest.js +86 -0
- package/dist/models/Function.d.ts +163 -0
- package/dist/models/Function.js +117 -0
- package/dist/models/FunctionList.d.ts +33 -0
- package/dist/models/FunctionList.js +51 -0
- package/dist/models/FunctionReplicaCounts.d.ts +44 -0
- package/dist/models/FunctionReplicaCounts.js +58 -0
- package/dist/models/FunctionRun.d.ts +130 -0
- package/dist/models/FunctionRun.js +102 -0
- package/dist/models/FunctionRunError.d.ts +44 -0
- package/dist/models/FunctionRunError.js +56 -0
- package/dist/models/FunctionRunList.d.ts +39 -0
- package/dist/models/FunctionRunList.js +55 -0
- package/dist/models/FunctionRunLogChunk.d.ts +59 -0
- package/dist/models/FunctionRunLogChunk.js +71 -0
- package/dist/models/FunctionRunLogs.d.ts +45 -0
- package/dist/models/FunctionRunLogs.js +59 -0
- package/dist/models/FunctionUpload.d.ts +51 -0
- package/dist/models/FunctionUpload.js +67 -0
- package/dist/models/FunctionVersion.d.ts +137 -0
- package/dist/models/FunctionVersion.js +117 -0
- package/dist/models/Invoice.d.ts +68 -0
- package/dist/models/Invoice.js +74 -0
- package/dist/models/InvoiceList.d.ts +45 -0
- package/dist/models/InvoiceList.js +57 -0
- package/dist/models/ModelPricing.d.ts +46 -0
- package/dist/models/ModelPricing.js +22 -0
- package/dist/models/ModelRate.d.ts +62 -0
- package/dist/models/ModelRate.js +58 -0
- package/dist/models/PeakWindow.d.ts +38 -0
- package/dist/models/PeakWindow.js +54 -0
- package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
- package/dist/models/UpdateBillingDetailsRequest.js +64 -0
- package/dist/models/index.d.ts +19 -0
- package/dist/models/index.js +19 -0
- package/dist/runtime.js +1 -1
- package/docs/BillingApi.md +299 -0
- package/docs/BillingDetails.md +56 -0
- package/docs/CreateFunctionRequest.md +34 -0
- package/docs/CreateFunctionRunRequest.md +36 -0
- package/docs/CreateFunctionVersionRequest.md +60 -0
- package/docs/Function.md +75 -0
- package/docs/FunctionList.md +34 -0
- package/docs/FunctionReplicaCounts.md +39 -0
- package/docs/FunctionRun.md +63 -0
- package/docs/FunctionRunError.md +38 -0
- package/docs/FunctionRunList.md +36 -0
- package/docs/FunctionRunLogChunk.md +40 -0
- package/docs/FunctionRunLogs.md +38 -0
- package/docs/FunctionUpload.md +38 -0
- package/docs/FunctionVersion.md +66 -0
- package/docs/FunctionsApi.md +880 -0
- package/docs/Invoice.md +46 -0
- package/docs/InvoiceList.md +38 -0
- package/docs/ModelPricing.md +12 -0
- package/docs/ModelRate.md +45 -0
- package/docs/PeakWindow.md +37 -0
- package/docs/UpdateBillingDetailsRequest.md +50 -0
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +247 -0
- package/src/apis/FunctionsApi.ts +828 -0
- package/src/apis/index.ts +1 -0
- package/src/models/AutolaunchRule.ts +2 -1
- package/src/models/BillingDetails.ts +164 -0
- package/src/models/CreateFunctionRequest.ts +66 -0
- package/src/models/CreateFunctionRunRequest.ts +74 -0
- package/src/models/CreateFunctionVersionRequest.ts +175 -0
- package/src/models/Function.ts +255 -0
- package/src/models/FunctionList.ts +74 -0
- package/src/models/FunctionReplicaCounts.ts +84 -0
- package/src/models/FunctionRun.ts +207 -0
- package/src/models/FunctionRunError.ts +83 -0
- package/src/models/FunctionRunList.ts +83 -0
- package/src/models/FunctionRunLogChunk.ts +105 -0
- package/src/models/FunctionRunLogs.ts +92 -0
- package/src/models/FunctionUpload.ts +96 -0
- package/src/models/FunctionVersion.ts +226 -0
- package/src/models/Invoice.ts +120 -0
- package/src/models/InvoiceList.ts +91 -0
- package/src/models/ModelPricing.ts +74 -0
- package/src/models/ModelRate.ts +105 -0
- package/src/models/PeakWindow.ts +75 -0
- package/src/models/UpdateBillingDetailsRequest.ts +129 -0
- package/src/models/index.ts +19 -0
- package/src/runtime.ts +1 -1
package/docs/BillingApi.md
CHANGED
|
@@ -5,10 +5,14 @@ All URIs are relative to *https://api.gpu.ai/v1*
|
|
|
5
5
|
| Method | HTTP request | Description |
|
|
6
6
|
|------------- | ------------- | -------------|
|
|
7
7
|
| [**createCryptoDeposit**](BillingApi.md#createcryptodepositoperation) | **POST** /billing/deposits/crypto | Create a stablecoin deposit |
|
|
8
|
+
| [**downloadInvoicePdf**](BillingApi.md#downloadinvoicepdf) | **GET** /billing/invoices/{id}/pdf | Download an invoice PDF |
|
|
8
9
|
| [**getBalance**](BillingApi.md#getbalance) | **GET** /billing/balance | Get the org credit balance |
|
|
10
|
+
| [**getBillingDetails**](BillingApi.md#getbillingdetails) | **GET** /billing/details | Get billing details |
|
|
9
11
|
| [**getDeposit**](BillingApi.md#getdeposit) | **GET** /billing/deposits/{id} | Get one stablecoin deposit |
|
|
10
12
|
| [**getSpendingLimit**](BillingApi.md#getspendinglimit) | **GET** /billing/spending-limit | Get the org spending limit |
|
|
11
13
|
| [**listDeposits**](BillingApi.md#listdeposits) | **GET** /billing/deposits | List stablecoin deposits |
|
|
14
|
+
| [**listInvoices**](BillingApi.md#listinvoices) | **GET** /billing/invoices | List invoices |
|
|
15
|
+
| [**updateBillingDetails**](BillingApi.md#updatebillingdetailsoperation) | **PATCH** /billing/details | Update billing details |
|
|
12
16
|
| [**updateSpendingLimit**](BillingApi.md#updatespendinglimitoperation) | **PUT** /billing/spending-limit | Set the org spending limit |
|
|
13
17
|
|
|
14
18
|
|
|
@@ -90,6 +94,80 @@ example().catch(console.error);
|
|
|
90
94
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
91
95
|
|
|
92
96
|
|
|
97
|
+
## downloadInvoicePdf
|
|
98
|
+
|
|
99
|
+
> Blob downloadInvoicePdf(id)
|
|
100
|
+
|
|
101
|
+
Download an invoice PDF
|
|
102
|
+
|
|
103
|
+
Returns one invoice as a PDF, including the organization\'s billing details and full Tax ID. Requires the `billing:read` scope. An invoice belonging to another organization returns the same 404 as one that does not exist.
|
|
104
|
+
|
|
105
|
+
### Example
|
|
106
|
+
|
|
107
|
+
```ts
|
|
108
|
+
import {
|
|
109
|
+
Configuration,
|
|
110
|
+
BillingApi,
|
|
111
|
+
} from '@gpuai/sdk';
|
|
112
|
+
import type { DownloadInvoicePdfRequest } from '@gpuai/sdk';
|
|
113
|
+
|
|
114
|
+
async function example() {
|
|
115
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
116
|
+
const config = new Configuration({
|
|
117
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
118
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
119
|
+
});
|
|
120
|
+
const api = new BillingApi(config);
|
|
121
|
+
|
|
122
|
+
const body = {
|
|
123
|
+
// string | The invoice id.
|
|
124
|
+
id: id_example,
|
|
125
|
+
} satisfies DownloadInvoicePdfRequest;
|
|
126
|
+
|
|
127
|
+
try {
|
|
128
|
+
const data = await api.downloadInvoicePdf(body);
|
|
129
|
+
console.log(data);
|
|
130
|
+
} catch (error) {
|
|
131
|
+
console.error(error);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// Run the test
|
|
136
|
+
example().catch(console.error);
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Parameters
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
| Name | Type | Description | Notes |
|
|
143
|
+
|------------- | ------------- | ------------- | -------------|
|
|
144
|
+
| **id** | `string` | The invoice id. | [Defaults to `undefined`] |
|
|
145
|
+
|
|
146
|
+
### Return type
|
|
147
|
+
|
|
148
|
+
**Blob**
|
|
149
|
+
|
|
150
|
+
### Authorization
|
|
151
|
+
|
|
152
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
153
|
+
|
|
154
|
+
### HTTP request headers
|
|
155
|
+
|
|
156
|
+
- **Content-Type**: Not defined
|
|
157
|
+
- **Accept**: `application/pdf`, `application/problem+json`
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
### HTTP response details
|
|
161
|
+
| Status code | Description | Response headers |
|
|
162
|
+
|-------------|-------------|------------------|
|
|
163
|
+
| **200** | The invoice PDF. | - |
|
|
164
|
+
| **404** | Error response (RFC 7807) | - |
|
|
165
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
166
|
+
| **0** | Error response (RFC 7807) | - |
|
|
167
|
+
|
|
168
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
169
|
+
|
|
170
|
+
|
|
93
171
|
## getBalance
|
|
94
172
|
|
|
95
173
|
> Balance getBalance()
|
|
@@ -155,6 +233,71 @@ This endpoint does not need any parameter.
|
|
|
155
233
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
156
234
|
|
|
157
235
|
|
|
236
|
+
## getBillingDetails
|
|
237
|
+
|
|
238
|
+
> BillingDetails getBillingDetails()
|
|
239
|
+
|
|
240
|
+
Get billing details
|
|
241
|
+
|
|
242
|
+
Returns the company name, address and Tax ID printed on the organization\'s invoices. Requires the `billing:read` scope. The Tax ID is stored encrypted and is only ever returned masked (`tax_id_masked`); the full value is printed on the organization\'s own invoice PDFs and nowhere else.
|
|
243
|
+
|
|
244
|
+
### Example
|
|
245
|
+
|
|
246
|
+
```ts
|
|
247
|
+
import {
|
|
248
|
+
Configuration,
|
|
249
|
+
BillingApi,
|
|
250
|
+
} from '@gpuai/sdk';
|
|
251
|
+
import type { GetBillingDetailsRequest } from '@gpuai/sdk';
|
|
252
|
+
|
|
253
|
+
async function example() {
|
|
254
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
255
|
+
const config = new Configuration({
|
|
256
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
257
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
258
|
+
});
|
|
259
|
+
const api = new BillingApi(config);
|
|
260
|
+
|
|
261
|
+
try {
|
|
262
|
+
const data = await api.getBillingDetails();
|
|
263
|
+
console.log(data);
|
|
264
|
+
} catch (error) {
|
|
265
|
+
console.error(error);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
// Run the test
|
|
270
|
+
example().catch(console.error);
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Parameters
|
|
274
|
+
|
|
275
|
+
This endpoint does not need any parameter.
|
|
276
|
+
|
|
277
|
+
### Return type
|
|
278
|
+
|
|
279
|
+
[**BillingDetails**](BillingDetails.md)
|
|
280
|
+
|
|
281
|
+
### Authorization
|
|
282
|
+
|
|
283
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
284
|
+
|
|
285
|
+
### HTTP request headers
|
|
286
|
+
|
|
287
|
+
- **Content-Type**: Not defined
|
|
288
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
289
|
+
|
|
290
|
+
|
|
291
|
+
### HTTP response details
|
|
292
|
+
| Status code | Description | Response headers |
|
|
293
|
+
|-------------|-------------|------------------|
|
|
294
|
+
| **200** | OK | - |
|
|
295
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
296
|
+
| **0** | Error response (RFC 7807) | - |
|
|
297
|
+
|
|
298
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
299
|
+
|
|
300
|
+
|
|
158
301
|
## getDeposit
|
|
159
302
|
|
|
160
303
|
> CryptoDeposit getDeposit(id)
|
|
@@ -361,6 +504,162 @@ This endpoint does not need any parameter.
|
|
|
361
504
|
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
362
505
|
|
|
363
506
|
|
|
507
|
+
## listInvoices
|
|
508
|
+
|
|
509
|
+
> InvoiceList listInvoices(limit, cursor)
|
|
510
|
+
|
|
511
|
+
List invoices
|
|
512
|
+
|
|
513
|
+
Returns the organization\'s invoices, newest first. Every payment (card purchase, auto-pay top up, stablecoin deposit) has one; promotional credit does not. Requires the `billing:read` scope.
|
|
514
|
+
|
|
515
|
+
### Example
|
|
516
|
+
|
|
517
|
+
```ts
|
|
518
|
+
import {
|
|
519
|
+
Configuration,
|
|
520
|
+
BillingApi,
|
|
521
|
+
} from '@gpuai/sdk';
|
|
522
|
+
import type { ListInvoicesRequest } from '@gpuai/sdk';
|
|
523
|
+
|
|
524
|
+
async function example() {
|
|
525
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
526
|
+
const config = new Configuration({
|
|
527
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
528
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
529
|
+
});
|
|
530
|
+
const api = new BillingApi(config);
|
|
531
|
+
|
|
532
|
+
const body = {
|
|
533
|
+
// number (optional)
|
|
534
|
+
limit: 56,
|
|
535
|
+
// string | The `next_cursor` from the previous page. (optional)
|
|
536
|
+
cursor: cursor_example,
|
|
537
|
+
} satisfies ListInvoicesRequest;
|
|
538
|
+
|
|
539
|
+
try {
|
|
540
|
+
const data = await api.listInvoices(body);
|
|
541
|
+
console.log(data);
|
|
542
|
+
} catch (error) {
|
|
543
|
+
console.error(error);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
// Run the test
|
|
548
|
+
example().catch(console.error);
|
|
549
|
+
```
|
|
550
|
+
|
|
551
|
+
### Parameters
|
|
552
|
+
|
|
553
|
+
|
|
554
|
+
| Name | Type | Description | Notes |
|
|
555
|
+
|------------- | ------------- | ------------- | -------------|
|
|
556
|
+
| **limit** | `number` | | [Optional] [Defaults to `25`] |
|
|
557
|
+
| **cursor** | `string` | The `next_cursor` from the previous page. | [Optional] [Defaults to `undefined`] |
|
|
558
|
+
|
|
559
|
+
### Return type
|
|
560
|
+
|
|
561
|
+
[**InvoiceList**](InvoiceList.md)
|
|
562
|
+
|
|
563
|
+
### Authorization
|
|
564
|
+
|
|
565
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
566
|
+
|
|
567
|
+
### HTTP request headers
|
|
568
|
+
|
|
569
|
+
- **Content-Type**: Not defined
|
|
570
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
571
|
+
|
|
572
|
+
|
|
573
|
+
### HTTP response details
|
|
574
|
+
| Status code | Description | Response headers |
|
|
575
|
+
|-------------|-------------|------------------|
|
|
576
|
+
| **200** | OK | - |
|
|
577
|
+
| **400** | Error response (RFC 7807) | - |
|
|
578
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
579
|
+
| **0** | Error response (RFC 7807) | - |
|
|
580
|
+
|
|
581
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
582
|
+
|
|
583
|
+
|
|
584
|
+
## updateBillingDetails
|
|
585
|
+
|
|
586
|
+
> BillingDetails updateBillingDetails(updateBillingDetailsRequest, idempotencyKey)
|
|
587
|
+
|
|
588
|
+
Update billing details
|
|
589
|
+
|
|
590
|
+
Updates the billing details printed on invoices. Requires the `billing:write` scope and an org admin\'s key. Omitted fields keep their value. `tax_id` replaces the stored Tax ID (and needs `tax_id_type` unless one is already stored); an empty `tax_id` removes it. Returns 503 `tax-id-unavailable` when this deployment cannot store a Tax ID.
|
|
591
|
+
|
|
592
|
+
### Example
|
|
593
|
+
|
|
594
|
+
```ts
|
|
595
|
+
import {
|
|
596
|
+
Configuration,
|
|
597
|
+
BillingApi,
|
|
598
|
+
} from '@gpuai/sdk';
|
|
599
|
+
import type { UpdateBillingDetailsOperationRequest } from '@gpuai/sdk';
|
|
600
|
+
|
|
601
|
+
async function example() {
|
|
602
|
+
console.log("🚀 Testing @gpuai/sdk SDK...");
|
|
603
|
+
const config = new Configuration({
|
|
604
|
+
// Configure HTTP bearer authorization: bearerAuth
|
|
605
|
+
accessToken: "YOUR BEARER TOKEN",
|
|
606
|
+
});
|
|
607
|
+
const api = new BillingApi(config);
|
|
608
|
+
|
|
609
|
+
const body = {
|
|
610
|
+
// UpdateBillingDetailsRequest
|
|
611
|
+
updateBillingDetailsRequest: ...,
|
|
612
|
+
// string (optional)
|
|
613
|
+
idempotencyKey: idempotencyKey_example,
|
|
614
|
+
} satisfies UpdateBillingDetailsOperationRequest;
|
|
615
|
+
|
|
616
|
+
try {
|
|
617
|
+
const data = await api.updateBillingDetails(body);
|
|
618
|
+
console.log(data);
|
|
619
|
+
} catch (error) {
|
|
620
|
+
console.error(error);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
// Run the test
|
|
625
|
+
example().catch(console.error);
|
|
626
|
+
```
|
|
627
|
+
|
|
628
|
+
### Parameters
|
|
629
|
+
|
|
630
|
+
|
|
631
|
+
| Name | Type | Description | Notes |
|
|
632
|
+
|------------- | ------------- | ------------- | -------------|
|
|
633
|
+
| **updateBillingDetailsRequest** | [UpdateBillingDetailsRequest](UpdateBillingDetailsRequest.md) | | |
|
|
634
|
+
| **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
|
|
635
|
+
|
|
636
|
+
### Return type
|
|
637
|
+
|
|
638
|
+
[**BillingDetails**](BillingDetails.md)
|
|
639
|
+
|
|
640
|
+
### Authorization
|
|
641
|
+
|
|
642
|
+
[bearerAuth](../README.md#bearerAuth)
|
|
643
|
+
|
|
644
|
+
### HTTP request headers
|
|
645
|
+
|
|
646
|
+
- **Content-Type**: `application/json`
|
|
647
|
+
- **Accept**: `application/json`, `application/problem+json`
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
### HTTP response details
|
|
651
|
+
| Status code | Description | Response headers |
|
|
652
|
+
|-------------|-------------|------------------|
|
|
653
|
+
| **200** | OK | - |
|
|
654
|
+
| **400** | Error response (RFC 7807) | - |
|
|
655
|
+
| **403** | Error response (RFC 7807) | - |
|
|
656
|
+
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
657
|
+
| **503** | Error response (RFC 7807) | - |
|
|
658
|
+
| **0** | Error response (RFC 7807) | - |
|
|
659
|
+
|
|
660
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
661
|
+
|
|
662
|
+
|
|
364
663
|
## updateSpendingLimit
|
|
365
664
|
|
|
366
665
|
> SpendingLimit updateSpendingLimit(updateSpendingLimitRequest)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
|
|
2
|
+
# BillingDetails
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`legalName` | string
|
|
10
|
+
`addressLine1` | string
|
|
11
|
+
`addressLine2` | string
|
|
12
|
+
`city` | string
|
|
13
|
+
`region` | string
|
|
14
|
+
`postalCode` | string
|
|
15
|
+
`country` | string
|
|
16
|
+
`taxIdType` | string
|
|
17
|
+
`taxIdMasked` | string
|
|
18
|
+
`hasTaxId` | boolean
|
|
19
|
+
`taxIdEnabled` | boolean
|
|
20
|
+
`updatedAt` | Date
|
|
21
|
+
|
|
22
|
+
## Example
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import type { BillingDetails } from '@gpuai/sdk'
|
|
26
|
+
|
|
27
|
+
// TODO: Update the object below with actual values
|
|
28
|
+
const example = {
|
|
29
|
+
"legalName": Acme GmbH,
|
|
30
|
+
"addressLine1": null,
|
|
31
|
+
"addressLine2": null,
|
|
32
|
+
"city": null,
|
|
33
|
+
"region": null,
|
|
34
|
+
"postalCode": null,
|
|
35
|
+
"country": DE,
|
|
36
|
+
"taxIdType": null,
|
|
37
|
+
"taxIdMasked": ••••6789,
|
|
38
|
+
"hasTaxId": null,
|
|
39
|
+
"taxIdEnabled": null,
|
|
40
|
+
"updatedAt": null,
|
|
41
|
+
} satisfies BillingDetails
|
|
42
|
+
|
|
43
|
+
console.log(example)
|
|
44
|
+
|
|
45
|
+
// Convert the instance to a JSON string
|
|
46
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
47
|
+
console.log(exampleJSON)
|
|
48
|
+
|
|
49
|
+
// Parse the JSON string back to an object
|
|
50
|
+
const exampleParsed = JSON.parse(exampleJSON) as BillingDetails
|
|
51
|
+
console.log(exampleParsed)
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
55
|
+
|
|
56
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# CreateFunctionRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`name` | string
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { CreateFunctionRequest } from '@gpuai/sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"name": null,
|
|
19
|
+
} satisfies CreateFunctionRequest
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as CreateFunctionRequest
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
|
|
2
|
+
# CreateFunctionRunRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`versionId` | string
|
|
10
|
+
`input` | string
|
|
11
|
+
|
|
12
|
+
## Example
|
|
13
|
+
|
|
14
|
+
```typescript
|
|
15
|
+
import type { CreateFunctionRunRequest } from '@gpuai/sdk'
|
|
16
|
+
|
|
17
|
+
// TODO: Update the object below with actual values
|
|
18
|
+
const example = {
|
|
19
|
+
"versionId": null,
|
|
20
|
+
"input": null,
|
|
21
|
+
} satisfies CreateFunctionRunRequest
|
|
22
|
+
|
|
23
|
+
console.log(example)
|
|
24
|
+
|
|
25
|
+
// Convert the instance to a JSON string
|
|
26
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
27
|
+
console.log(exampleJSON)
|
|
28
|
+
|
|
29
|
+
// Parse the JSON string back to an object
|
|
30
|
+
const exampleParsed = JSON.parse(exampleJSON) as CreateFunctionRunRequest
|
|
31
|
+
console.log(exampleParsed)
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
35
|
+
|
|
36
|
+
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
|
|
2
|
+
# CreateFunctionVersionRequest
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`contentHash` | string
|
|
10
|
+
`bundleSha256` | string
|
|
11
|
+
`bundleBytes` | number
|
|
12
|
+
`pythonVersion` | string
|
|
13
|
+
`cloudpickleVersion` | string
|
|
14
|
+
`pip` | Array<string>
|
|
15
|
+
`gpu` | string
|
|
16
|
+
`gpuCount` | number
|
|
17
|
+
`minVramGb` | number
|
|
18
|
+
`regions` | Array<string>
|
|
19
|
+
`maxPricePerHour` | number
|
|
20
|
+
`timeout` | number
|
|
21
|
+
`idleTimeout` | number
|
|
22
|
+
`maxConcurrency` | number
|
|
23
|
+
|
|
24
|
+
## Example
|
|
25
|
+
|
|
26
|
+
```typescript
|
|
27
|
+
import type { CreateFunctionVersionRequest } from '@gpuai/sdk'
|
|
28
|
+
|
|
29
|
+
// TODO: Update the object below with actual values
|
|
30
|
+
const example = {
|
|
31
|
+
"contentHash": null,
|
|
32
|
+
"bundleSha256": null,
|
|
33
|
+
"bundleBytes": null,
|
|
34
|
+
"pythonVersion": null,
|
|
35
|
+
"cloudpickleVersion": null,
|
|
36
|
+
"pip": null,
|
|
37
|
+
"gpu": null,
|
|
38
|
+
"gpuCount": null,
|
|
39
|
+
"minVramGb": null,
|
|
40
|
+
"regions": null,
|
|
41
|
+
"maxPricePerHour": null,
|
|
42
|
+
"timeout": null,
|
|
43
|
+
"idleTimeout": null,
|
|
44
|
+
"maxConcurrency": null,
|
|
45
|
+
} satisfies CreateFunctionVersionRequest
|
|
46
|
+
|
|
47
|
+
console.log(example)
|
|
48
|
+
|
|
49
|
+
// Convert the instance to a JSON string
|
|
50
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
51
|
+
console.log(exampleJSON)
|
|
52
|
+
|
|
53
|
+
// Parse the JSON string back to an object
|
|
54
|
+
const exampleParsed = JSON.parse(exampleJSON) as CreateFunctionVersionRequest
|
|
55
|
+
console.log(exampleParsed)
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
59
|
+
|
|
60
|
+
|
package/docs/Function.md
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
|
|
2
|
+
# Function
|
|
3
|
+
|
|
4
|
+
A Python function registered with GPU.ai. The settings are those of its current version and are null until the first version is uploaded.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`id` | string
|
|
11
|
+
`name` | string
|
|
12
|
+
`status` | string
|
|
13
|
+
`currentVersionId` | string
|
|
14
|
+
`gpu` | string
|
|
15
|
+
`gpuCount` | number
|
|
16
|
+
`minVramGb` | number
|
|
17
|
+
`regions` | Array<string>
|
|
18
|
+
`maxPricePerHour` | number
|
|
19
|
+
`pythonVersion` | string
|
|
20
|
+
`pip` | Array<string>
|
|
21
|
+
`timeout` | number
|
|
22
|
+
`idleTimeout` | number
|
|
23
|
+
`maxConcurrency` | number
|
|
24
|
+
`replicas` | [FunctionReplicaCounts](FunctionReplicaCounts.md)
|
|
25
|
+
`runsQueued` | number
|
|
26
|
+
`runs24h` | number
|
|
27
|
+
`runCost24hUsd` | number
|
|
28
|
+
`machineCost24hUsd` | number
|
|
29
|
+
`lastRunAt` | Date
|
|
30
|
+
`createdAt` | Date
|
|
31
|
+
|
|
32
|
+
## Example
|
|
33
|
+
|
|
34
|
+
```typescript
|
|
35
|
+
import type { Function } from '@gpuai/sdk'
|
|
36
|
+
|
|
37
|
+
// TODO: Update the object below with actual values
|
|
38
|
+
const example = {
|
|
39
|
+
"id": null,
|
|
40
|
+
"name": null,
|
|
41
|
+
"status": null,
|
|
42
|
+
"currentVersionId": null,
|
|
43
|
+
"gpu": null,
|
|
44
|
+
"gpuCount": null,
|
|
45
|
+
"minVramGb": null,
|
|
46
|
+
"regions": null,
|
|
47
|
+
"maxPricePerHour": null,
|
|
48
|
+
"pythonVersion": null,
|
|
49
|
+
"pip": null,
|
|
50
|
+
"timeout": null,
|
|
51
|
+
"idleTimeout": null,
|
|
52
|
+
"maxConcurrency": null,
|
|
53
|
+
"replicas": null,
|
|
54
|
+
"runsQueued": null,
|
|
55
|
+
"runs24h": null,
|
|
56
|
+
"runCost24hUsd": null,
|
|
57
|
+
"machineCost24hUsd": null,
|
|
58
|
+
"lastRunAt": null,
|
|
59
|
+
"createdAt": null,
|
|
60
|
+
} satisfies Function
|
|
61
|
+
|
|
62
|
+
console.log(example)
|
|
63
|
+
|
|
64
|
+
// Convert the instance to a JSON string
|
|
65
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
66
|
+
console.log(exampleJSON)
|
|
67
|
+
|
|
68
|
+
// Parse the JSON string back to an object
|
|
69
|
+
const exampleParsed = JSON.parse(exampleJSON) as Function
|
|
70
|
+
console.log(exampleParsed)
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
74
|
+
|
|
75
|
+
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
|
|
2
|
+
# FunctionList
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
## Properties
|
|
6
|
+
|
|
7
|
+
Name | Type
|
|
8
|
+
------------ | -------------
|
|
9
|
+
`data` | [Array<Function>](Function.md)
|
|
10
|
+
|
|
11
|
+
## Example
|
|
12
|
+
|
|
13
|
+
```typescript
|
|
14
|
+
import type { FunctionList } from '@gpuai/sdk'
|
|
15
|
+
|
|
16
|
+
// TODO: Update the object below with actual values
|
|
17
|
+
const example = {
|
|
18
|
+
"data": null,
|
|
19
|
+
} satisfies FunctionList
|
|
20
|
+
|
|
21
|
+
console.log(example)
|
|
22
|
+
|
|
23
|
+
// Convert the instance to a JSON string
|
|
24
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
25
|
+
console.log(exampleJSON)
|
|
26
|
+
|
|
27
|
+
// Parse the JSON string back to an object
|
|
28
|
+
const exampleParsed = JSON.parse(exampleJSON) as FunctionList
|
|
29
|
+
console.log(exampleParsed)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
33
|
+
|
|
34
|
+
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
|
|
2
|
+
# FunctionReplicaCounts
|
|
3
|
+
|
|
4
|
+
How many machines a function has in each state.
|
|
5
|
+
|
|
6
|
+
## Properties
|
|
7
|
+
|
|
8
|
+
Name | Type
|
|
9
|
+
------------ | -------------
|
|
10
|
+
`starting` | number
|
|
11
|
+
`warm` | number
|
|
12
|
+
`running` | number
|
|
13
|
+
|
|
14
|
+
## Example
|
|
15
|
+
|
|
16
|
+
```typescript
|
|
17
|
+
import type { FunctionReplicaCounts } from '@gpuai/sdk'
|
|
18
|
+
|
|
19
|
+
// TODO: Update the object below with actual values
|
|
20
|
+
const example = {
|
|
21
|
+
"starting": null,
|
|
22
|
+
"warm": null,
|
|
23
|
+
"running": null,
|
|
24
|
+
} satisfies FunctionReplicaCounts
|
|
25
|
+
|
|
26
|
+
console.log(example)
|
|
27
|
+
|
|
28
|
+
// Convert the instance to a JSON string
|
|
29
|
+
const exampleJSON: string = JSON.stringify(example)
|
|
30
|
+
console.log(exampleJSON)
|
|
31
|
+
|
|
32
|
+
// Parse the JSON string back to an object
|
|
33
|
+
const exampleParsed = JSON.parse(exampleJSON) as FunctionReplicaCounts
|
|
34
|
+
console.log(exampleParsed)
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
[[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
|
|
38
|
+
|
|
39
|
+
|