@gpuai/sdk 0.5.3 → 0.5.4
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/README.md +2 -2
- package/dist/apis/BillingApi.d.ts +2 -2
- package/dist/apis/BillingApi.js +2 -2
- package/dist/esm/apis/BillingApi.d.ts +2 -2
- package/dist/esm/apis/BillingApi.js +2 -2
- package/dist/esm/models/Balance.d.ts +6 -0
- package/dist/esm/models/Balance.js +2 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +3 -0
- package/dist/esm/models/CreateWebhookEndpointRequest.js +4 -1
- package/dist/esm/models/WebhookEndpoint.d.ts +3 -0
- package/dist/esm/models/WebhookEndpoint.js +4 -1
- package/dist/esm/runtime.js +1 -1
- package/dist/models/Balance.d.ts +6 -0
- package/dist/models/Balance.js +2 -0
- package/dist/models/CreateWebhookEndpointRequest.d.ts +3 -0
- package/dist/models/CreateWebhookEndpointRequest.js +4 -1
- package/dist/models/WebhookEndpoint.d.ts +3 -0
- package/dist/models/WebhookEndpoint.js +4 -1
- package/dist/runtime.js +1 -1
- package/docs/Balance.md +2 -0
- package/docs/BillingApi.md +2 -2
- package/docs/InstancesApi.md +1 -1
- package/package.json +1 -1
- package/src/apis/BillingApi.ts +2 -2
- package/src/models/Balance.ts +8 -0
- package/src/models/CreateWebhookEndpointRequest.ts +4 -1
- package/src/models/WebhookEndpoint.ts +4 -1
- package/src/runtime.ts +1 -1
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# @gpuai/sdk@0.5.
|
|
1
|
+
# @gpuai/sdk@0.5.4
|
|
2
2
|
|
|
3
3
|
A TypeScript SDK client for the api.gpu.ai API.
|
|
4
4
|
|
|
@@ -290,7 +290,7 @@ and is automatically generated by the
|
|
|
290
290
|
[OpenAPI Generator](https://openapi-generator.tech) project:
|
|
291
291
|
|
|
292
292
|
- API version: `1.0.0`
|
|
293
|
-
- Package version: `0.5.
|
|
293
|
+
- Package version: `0.5.4`
|
|
294
294
|
- Generator version: `7.24.0`
|
|
295
295
|
- Build package: `org.openapitools.codegen.languages.TypeScriptFetchClientCodegen`
|
|
296
296
|
|
|
@@ -76,12 +76,12 @@ export declare class BillingApi extends runtime.BaseAPI {
|
|
|
76
76
|
*/
|
|
77
77
|
getBalanceRequestOpts(): Promise<runtime.RequestOpts>;
|
|
78
78
|
/**
|
|
79
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
79
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
80
80
|
* Get the org credit balance
|
|
81
81
|
*/
|
|
82
82
|
getBalanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>>;
|
|
83
83
|
/**
|
|
84
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
84
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
85
85
|
* Get the org credit balance
|
|
86
86
|
*/
|
|
87
87
|
getBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance>;
|
package/dist/apis/BillingApi.js
CHANGED
|
@@ -158,7 +158,7 @@ class BillingApi extends runtime.BaseAPI {
|
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
160
|
/**
|
|
161
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
161
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
162
162
|
* Get the org credit balance
|
|
163
163
|
*/
|
|
164
164
|
getBalanceRaw(initOverrides) {
|
|
@@ -169,7 +169,7 @@ class BillingApi extends runtime.BaseAPI {
|
|
|
169
169
|
});
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
172
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
173
173
|
* Get the org credit balance
|
|
174
174
|
*/
|
|
175
175
|
getBalance(initOverrides) {
|
|
@@ -76,12 +76,12 @@ export declare class BillingApi extends runtime.BaseAPI {
|
|
|
76
76
|
*/
|
|
77
77
|
getBalanceRequestOpts(): Promise<runtime.RequestOpts>;
|
|
78
78
|
/**
|
|
79
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
79
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
80
80
|
* Get the org credit balance
|
|
81
81
|
*/
|
|
82
82
|
getBalanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>>;
|
|
83
83
|
/**
|
|
84
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
84
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
85
85
|
* Get the org credit balance
|
|
86
86
|
*/
|
|
87
87
|
getBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance>;
|
|
@@ -155,7 +155,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
157
|
/**
|
|
158
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
158
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
159
159
|
* Get the org credit balance
|
|
160
160
|
*/
|
|
161
161
|
getBalanceRaw(initOverrides) {
|
|
@@ -166,7 +166,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
166
166
|
});
|
|
167
167
|
}
|
|
168
168
|
/**
|
|
169
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
169
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
170
170
|
* Get the org credit balance
|
|
171
171
|
*/
|
|
172
172
|
getBalance(initOverrides) {
|
|
@@ -54,6 +54,12 @@ export interface Balance {
|
|
|
54
54
|
* @memberof Balance
|
|
55
55
|
*/
|
|
56
56
|
burnCentsPerHour: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* How many hours the balance lasts at the current usage: the balance divided by `burn_cents_per_hour` plus serverless inference spend over the last hour, rounded to 2 places. `null` when nothing is running or the burn rate could not be determined; 0 when the balance is at or below $0 while burning. Machines stop when the balance reaches $0.
|
|
59
|
+
* @type {number}
|
|
60
|
+
* @memberof Balance
|
|
61
|
+
*/
|
|
62
|
+
runwayHours?: number | null;
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
59
65
|
* Check if a given object implements the Balance interface.
|
|
@@ -43,6 +43,7 @@ export function BalanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
43
43
|
'autoPayThresholdCents': json['auto_pay_threshold_cents'],
|
|
44
44
|
'autoPayAmountCents': json['auto_pay_amount_cents'],
|
|
45
45
|
'burnCentsPerHour': json['burn_cents_per_hour'],
|
|
46
|
+
'runwayHours': json['runway_hours'] === undefined ? undefined : json['runway_hours'] === null ? null : json['runway_hours'],
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
export function BalanceToJSON(json) {
|
|
@@ -59,5 +60,6 @@ export function BalanceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
59
60
|
'auto_pay_threshold_cents': value['autoPayThresholdCents'],
|
|
60
61
|
'auto_pay_amount_cents': value['autoPayAmountCents'],
|
|
61
62
|
'burn_cents_per_hour': value['burnCentsPerHour'],
|
|
63
|
+
'runway_hours': value['runwayHours'],
|
|
62
64
|
};
|
|
63
65
|
}
|
|
@@ -38,6 +38,9 @@ export declare const CreateWebhookEndpointRequestEventTypesEnum: {
|
|
|
38
38
|
readonly InstanceFailed: "instance.failed";
|
|
39
39
|
readonly VideoCompleted: "video.completed";
|
|
40
40
|
readonly VideoFailed: "video.failed";
|
|
41
|
+
readonly WatchAlertFired: "watch.alert.fired";
|
|
42
|
+
readonly BalanceLow: "balance.low";
|
|
43
|
+
readonly BalanceExhausted: "balance.exhausted";
|
|
41
44
|
};
|
|
42
45
|
export type CreateWebhookEndpointRequestEventTypesEnum = typeof CreateWebhookEndpointRequestEventTypesEnum[keyof typeof CreateWebhookEndpointRequestEventTypesEnum];
|
|
43
46
|
/**
|
|
@@ -20,7 +20,10 @@ export const CreateWebhookEndpointRequestEventTypesEnum = {
|
|
|
20
20
|
InstanceTerminated: 'instance.terminated',
|
|
21
21
|
InstanceFailed: 'instance.failed',
|
|
22
22
|
VideoCompleted: 'video.completed',
|
|
23
|
-
VideoFailed: 'video.failed'
|
|
23
|
+
VideoFailed: 'video.failed',
|
|
24
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
25
|
+
BalanceLow: 'balance.low',
|
|
26
|
+
BalanceExhausted: 'balance.exhausted'
|
|
24
27
|
};
|
|
25
28
|
/**
|
|
26
29
|
* Check if a given object implements the CreateWebhookEndpointRequest interface.
|
|
@@ -62,6 +62,9 @@ export declare const WebhookEndpointEventTypesEnum: {
|
|
|
62
62
|
readonly InstanceFailed: "instance.failed";
|
|
63
63
|
readonly VideoCompleted: "video.completed";
|
|
64
64
|
readonly VideoFailed: "video.failed";
|
|
65
|
+
readonly WatchAlertFired: "watch.alert.fired";
|
|
66
|
+
readonly BalanceLow: "balance.low";
|
|
67
|
+
readonly BalanceExhausted: "balance.exhausted";
|
|
65
68
|
};
|
|
66
69
|
export type WebhookEndpointEventTypesEnum = typeof WebhookEndpointEventTypesEnum[keyof typeof WebhookEndpointEventTypesEnum];
|
|
67
70
|
/**
|
|
@@ -20,7 +20,10 @@ export const WebhookEndpointEventTypesEnum = {
|
|
|
20
20
|
InstanceTerminated: 'instance.terminated',
|
|
21
21
|
InstanceFailed: 'instance.failed',
|
|
22
22
|
VideoCompleted: 'video.completed',
|
|
23
|
-
VideoFailed: 'video.failed'
|
|
23
|
+
VideoFailed: 'video.failed',
|
|
24
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
25
|
+
BalanceLow: 'balance.low',
|
|
26
|
+
BalanceExhausted: 'balance.exhausted'
|
|
24
27
|
};
|
|
25
28
|
/**
|
|
26
29
|
* Check if a given object implements the WebhookEndpoint interface.
|
package/dist/esm/runtime.js
CHANGED
|
@@ -61,7 +61,7 @@ export class Configuration {
|
|
|
61
61
|
return undefined;
|
|
62
62
|
}
|
|
63
63
|
get headers() {
|
|
64
|
-
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.
|
|
64
|
+
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.4' }, this.configuration.headers);
|
|
65
65
|
}
|
|
66
66
|
get credentials() {
|
|
67
67
|
return this.configuration.credentials;
|
package/dist/models/Balance.d.ts
CHANGED
|
@@ -54,6 +54,12 @@ export interface Balance {
|
|
|
54
54
|
* @memberof Balance
|
|
55
55
|
*/
|
|
56
56
|
burnCentsPerHour: number | null;
|
|
57
|
+
/**
|
|
58
|
+
* How many hours the balance lasts at the current usage: the balance divided by `burn_cents_per_hour` plus serverless inference spend over the last hour, rounded to 2 places. `null` when nothing is running or the burn rate could not be determined; 0 when the balance is at or below $0 while burning. Machines stop when the balance reaches $0.
|
|
59
|
+
* @type {number}
|
|
60
|
+
* @memberof Balance
|
|
61
|
+
*/
|
|
62
|
+
runwayHours?: number | null;
|
|
57
63
|
}
|
|
58
64
|
/**
|
|
59
65
|
* Check if a given object implements the Balance interface.
|
package/dist/models/Balance.js
CHANGED
|
@@ -50,6 +50,7 @@ function BalanceFromJSONTyped(json, ignoreDiscriminator) {
|
|
|
50
50
|
'autoPayThresholdCents': json['auto_pay_threshold_cents'],
|
|
51
51
|
'autoPayAmountCents': json['auto_pay_amount_cents'],
|
|
52
52
|
'burnCentsPerHour': json['burn_cents_per_hour'],
|
|
53
|
+
'runwayHours': json['runway_hours'] === undefined ? undefined : json['runway_hours'] === null ? null : json['runway_hours'],
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
function BalanceToJSON(json) {
|
|
@@ -66,5 +67,6 @@ function BalanceToJSONTyped(value, ignoreDiscriminator = false) {
|
|
|
66
67
|
'auto_pay_threshold_cents': value['autoPayThresholdCents'],
|
|
67
68
|
'auto_pay_amount_cents': value['autoPayAmountCents'],
|
|
68
69
|
'burn_cents_per_hour': value['burnCentsPerHour'],
|
|
70
|
+
'runway_hours': value['runwayHours'],
|
|
69
71
|
};
|
|
70
72
|
}
|
|
@@ -38,6 +38,9 @@ export declare const CreateWebhookEndpointRequestEventTypesEnum: {
|
|
|
38
38
|
readonly InstanceFailed: "instance.failed";
|
|
39
39
|
readonly VideoCompleted: "video.completed";
|
|
40
40
|
readonly VideoFailed: "video.failed";
|
|
41
|
+
readonly WatchAlertFired: "watch.alert.fired";
|
|
42
|
+
readonly BalanceLow: "balance.low";
|
|
43
|
+
readonly BalanceExhausted: "balance.exhausted";
|
|
41
44
|
};
|
|
42
45
|
export type CreateWebhookEndpointRequestEventTypesEnum = typeof CreateWebhookEndpointRequestEventTypesEnum[keyof typeof CreateWebhookEndpointRequestEventTypesEnum];
|
|
43
46
|
/**
|
|
@@ -28,7 +28,10 @@ exports.CreateWebhookEndpointRequestEventTypesEnum = {
|
|
|
28
28
|
InstanceTerminated: 'instance.terminated',
|
|
29
29
|
InstanceFailed: 'instance.failed',
|
|
30
30
|
VideoCompleted: 'video.completed',
|
|
31
|
-
VideoFailed: 'video.failed'
|
|
31
|
+
VideoFailed: 'video.failed',
|
|
32
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
33
|
+
BalanceLow: 'balance.low',
|
|
34
|
+
BalanceExhausted: 'balance.exhausted'
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* Check if a given object implements the CreateWebhookEndpointRequest interface.
|
|
@@ -62,6 +62,9 @@ export declare const WebhookEndpointEventTypesEnum: {
|
|
|
62
62
|
readonly InstanceFailed: "instance.failed";
|
|
63
63
|
readonly VideoCompleted: "video.completed";
|
|
64
64
|
readonly VideoFailed: "video.failed";
|
|
65
|
+
readonly WatchAlertFired: "watch.alert.fired";
|
|
66
|
+
readonly BalanceLow: "balance.low";
|
|
67
|
+
readonly BalanceExhausted: "balance.exhausted";
|
|
65
68
|
};
|
|
66
69
|
export type WebhookEndpointEventTypesEnum = typeof WebhookEndpointEventTypesEnum[keyof typeof WebhookEndpointEventTypesEnum];
|
|
67
70
|
/**
|
|
@@ -28,7 +28,10 @@ exports.WebhookEndpointEventTypesEnum = {
|
|
|
28
28
|
InstanceTerminated: 'instance.terminated',
|
|
29
29
|
InstanceFailed: 'instance.failed',
|
|
30
30
|
VideoCompleted: 'video.completed',
|
|
31
|
-
VideoFailed: 'video.failed'
|
|
31
|
+
VideoFailed: 'video.failed',
|
|
32
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
33
|
+
BalanceLow: 'balance.low',
|
|
34
|
+
BalanceExhausted: 'balance.exhausted'
|
|
32
35
|
};
|
|
33
36
|
/**
|
|
34
37
|
* Check if a given object implements the WebhookEndpoint interface.
|
package/dist/runtime.js
CHANGED
|
@@ -69,7 +69,7 @@ class Configuration {
|
|
|
69
69
|
return undefined;
|
|
70
70
|
}
|
|
71
71
|
get headers() {
|
|
72
|
-
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.
|
|
72
|
+
return Object.assign({ 'User-Agent': 'gpuai-sdk-ts/0.5.4' }, this.configuration.headers);
|
|
73
73
|
}
|
|
74
74
|
get credentials() {
|
|
75
75
|
return this.configuration.credentials;
|
package/docs/Balance.md
CHANGED
|
@@ -13,6 +13,7 @@ Name | Type
|
|
|
13
13
|
`autoPayThresholdCents` | number
|
|
14
14
|
`autoPayAmountCents` | number
|
|
15
15
|
`burnCentsPerHour` | number
|
|
16
|
+
`runwayHours` | number
|
|
16
17
|
|
|
17
18
|
## Example
|
|
18
19
|
|
|
@@ -27,6 +28,7 @@ const example = {
|
|
|
27
28
|
"autoPayThresholdCents": null,
|
|
28
29
|
"autoPayAmountCents": null,
|
|
29
30
|
"burnCentsPerHour": null,
|
|
31
|
+
"runwayHours": null,
|
|
30
32
|
} satisfies Balance
|
|
31
33
|
|
|
32
34
|
console.log(example)
|
package/docs/BillingApi.md
CHANGED
|
@@ -174,7 +174,7 @@ example().catch(console.error);
|
|
|
174
174
|
|
|
175
175
|
Get the org credit balance
|
|
176
176
|
|
|
177
|
-
Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
177
|
+
Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
178
178
|
|
|
179
179
|
### Example
|
|
180
180
|
|
|
@@ -226,7 +226,7 @@ This endpoint does not need any parameter.
|
|
|
226
226
|
### HTTP response details
|
|
227
227
|
| Status code | Description | Response headers |
|
|
228
228
|
|-------------|-------------|------------------|
|
|
229
|
-
| **200** | OK | - |
|
|
229
|
+
| **200** | OK | * GPUAI-Balance-Warning - <br> |
|
|
230
230
|
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
231
231
|
| **0** | Error response (RFC 7807) | - |
|
|
232
232
|
|
package/docs/InstancesApi.md
CHANGED
|
@@ -82,7 +82,7 @@ example().catch(console.error);
|
|
|
82
82
|
### HTTP response details
|
|
83
83
|
| Status code | Description | Response headers |
|
|
84
84
|
|-------------|-------------|------------------|
|
|
85
|
-
| **202** | Accepted; long-running operation | * Operation-Id - Use GET /operations/{id} to poll <br> * GPUAI-Hint - Advisory only, and absent on most launches. Sent when the request is a one-off batch run (a custom image with a command and auto_terminate_hours) to point at Jobs (POST /jobs), which start a machine for the work and shut it down a few minutes after it ends. It never changes the launch. <br> |
|
|
85
|
+
| **202** | Accepted; long-running operation | * Operation-Id - Use GET /operations/{id} to poll <br> * GPUAI-Hint - Advisory only, and absent on most launches. Sent when the request is a one-off batch run (a custom image with a command and auto_terminate_hours) to point at Jobs (POST /jobs), which start a machine for the work and shut it down a few minutes after it ends. It never changes the launch. <br> * GPUAI-Balance-Warning - <br> |
|
|
86
86
|
| **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
|
|
87
87
|
| **0** | Error response (RFC 7807) | - |
|
|
88
88
|
|
package/package.json
CHANGED
package/src/apis/BillingApi.ts
CHANGED
|
@@ -235,7 +235,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
235
235
|
}
|
|
236
236
|
|
|
237
237
|
/**
|
|
238
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
238
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
239
239
|
* Get the org credit balance
|
|
240
240
|
*/
|
|
241
241
|
async getBalanceRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Balance>> {
|
|
@@ -246,7 +246,7 @@ export class BillingApi extends runtime.BaseAPI {
|
|
|
246
246
|
}
|
|
247
247
|
|
|
248
248
|
/**
|
|
249
|
-
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`.
|
|
249
|
+
* Returns the organization\'s credit balance, its auto-pay configuration, and the live burn rate. Requires the `billing:read` scope. The organization is taken from the authenticated API key, never from a parameter. Divide `balance_cents` by `burn_cents_per_hour` for the remaining runway in hours. The quotient is undefined in three cases a caller must keep apart: `burn_cents_per_hour` is 0 (nothing running, so the balance funds unbounded idle time), it is `null` (the burn rate could not be determined — NOT the same as idle), or the balance is already at or below zero. This is the balance itself — for spend against a configured cap see `/billing/spending-limit`, and for past consumption see `/usage`. `runway_hours` does that division for you, adding serverless inference spend over the last hour to the burn. While it is under the low-balance threshold (2 hours by default) and auto-pay is off or failing, every authenticated response carries the `GPUAI-Balance-Warning` header.
|
|
250
250
|
* Get the org credit balance
|
|
251
251
|
*/
|
|
252
252
|
async getBalance(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Balance> {
|
package/src/models/Balance.ts
CHANGED
|
@@ -58,6 +58,12 @@ export interface Balance {
|
|
|
58
58
|
* @memberof Balance
|
|
59
59
|
*/
|
|
60
60
|
burnCentsPerHour: number | null;
|
|
61
|
+
/**
|
|
62
|
+
* How many hours the balance lasts at the current usage: the balance divided by `burn_cents_per_hour` plus serverless inference spend over the last hour, rounded to 2 places. `null` when nothing is running or the burn rate could not be determined; 0 when the balance is at or below $0 while burning. Machines stop when the balance reaches $0.
|
|
63
|
+
* @type {number}
|
|
64
|
+
* @memberof Balance
|
|
65
|
+
*/
|
|
66
|
+
runwayHours?: number | null;
|
|
61
67
|
}
|
|
62
68
|
|
|
63
69
|
/**
|
|
@@ -89,6 +95,7 @@ export function BalanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): B
|
|
|
89
95
|
'autoPayThresholdCents': json['auto_pay_threshold_cents'],
|
|
90
96
|
'autoPayAmountCents': json['auto_pay_amount_cents'],
|
|
91
97
|
'burnCentsPerHour': json['burn_cents_per_hour'],
|
|
98
|
+
'runwayHours': json['runway_hours'] === undefined ? undefined : json['runway_hours'] === null ? null : json['runway_hours'],
|
|
92
99
|
};
|
|
93
100
|
}
|
|
94
101
|
|
|
@@ -109,6 +116,7 @@ export function BalanceToJSONTyped(value?: Balance | null, ignoreDiscriminator:
|
|
|
109
116
|
'auto_pay_threshold_cents': value['autoPayThresholdCents'],
|
|
110
117
|
'auto_pay_amount_cents': value['autoPayAmountCents'],
|
|
111
118
|
'burn_cents_per_hour': value['burnCentsPerHour'],
|
|
119
|
+
'runway_hours': value['runwayHours'],
|
|
112
120
|
};
|
|
113
121
|
}
|
|
114
122
|
|
|
@@ -43,7 +43,10 @@ export const CreateWebhookEndpointRequestEventTypesEnum = {
|
|
|
43
43
|
InstanceTerminated: 'instance.terminated',
|
|
44
44
|
InstanceFailed: 'instance.failed',
|
|
45
45
|
VideoCompleted: 'video.completed',
|
|
46
|
-
VideoFailed: 'video.failed'
|
|
46
|
+
VideoFailed: 'video.failed',
|
|
47
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
48
|
+
BalanceLow: 'balance.low',
|
|
49
|
+
BalanceExhausted: 'balance.exhausted'
|
|
47
50
|
} as const;
|
|
48
51
|
export type CreateWebhookEndpointRequestEventTypesEnum = typeof CreateWebhookEndpointRequestEventTypesEnum[keyof typeof CreateWebhookEndpointRequestEventTypesEnum];
|
|
49
52
|
|
|
@@ -67,7 +67,10 @@ export const WebhookEndpointEventTypesEnum = {
|
|
|
67
67
|
InstanceTerminated: 'instance.terminated',
|
|
68
68
|
InstanceFailed: 'instance.failed',
|
|
69
69
|
VideoCompleted: 'video.completed',
|
|
70
|
-
VideoFailed: 'video.failed'
|
|
70
|
+
VideoFailed: 'video.failed',
|
|
71
|
+
WatchAlertFired: 'watch.alert.fired',
|
|
72
|
+
BalanceLow: 'balance.low',
|
|
73
|
+
BalanceExhausted: 'balance.exhausted'
|
|
71
74
|
} as const;
|
|
72
75
|
export type WebhookEndpointEventTypesEnum = typeof WebhookEndpointEventTypesEnum[keyof typeof WebhookEndpointEventTypesEnum];
|
|
73
76
|
|
package/src/runtime.ts
CHANGED
|
@@ -75,7 +75,7 @@ export class Configuration {
|
|
|
75
75
|
}
|
|
76
76
|
|
|
77
77
|
get headers(): HTTPHeaders | undefined {
|
|
78
|
-
return { 'User-Agent': 'gpuai-sdk-ts/0.5.
|
|
78
|
+
return { 'User-Agent': 'gpuai-sdk-ts/0.5.4', ...this.configuration.headers };
|
|
79
79
|
}
|
|
80
80
|
|
|
81
81
|
get credentials(): RequestCredentials | undefined {
|