@gpuai/sdk 0.3.18 → 0.4.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.
Files changed (187) hide show
  1. package/.openapi-generator/FILES +48 -0
  2. package/README.md +41 -2
  3. package/dist/apis/BillingApi.d.ts +70 -0
  4. package/dist/apis/BillingApi.js +197 -0
  5. package/dist/apis/FunctionsApi.d.ts +228 -0
  6. package/dist/apis/FunctionsApi.js +627 -0
  7. package/dist/apis/InstancesApi.d.ts +18 -0
  8. package/dist/apis/InstancesApi.js +49 -0
  9. package/dist/apis/index.d.ts +1 -0
  10. package/dist/apis/index.js +1 -0
  11. package/dist/esm/apis/BillingApi.d.ts +70 -0
  12. package/dist/esm/apis/BillingApi.js +197 -0
  13. package/dist/esm/apis/FunctionsApi.d.ts +228 -0
  14. package/dist/esm/apis/FunctionsApi.js +623 -0
  15. package/dist/esm/apis/InstancesApi.d.ts +18 -0
  16. package/dist/esm/apis/InstancesApi.js +49 -0
  17. package/dist/esm/apis/index.d.ts +1 -0
  18. package/dist/esm/apis/index.js +1 -0
  19. package/dist/esm/models/AutolaunchRule.d.ts +2 -1
  20. package/dist/esm/models/BillingDetails.d.ts +98 -0
  21. package/dist/esm/models/BillingDetails.js +85 -0
  22. package/dist/esm/models/CreateFunctionRequest.d.ts +32 -0
  23. package/dist/esm/models/CreateFunctionRequest.js +43 -0
  24. package/dist/esm/models/CreateFunctionRunRequest.d.ts +38 -0
  25. package/dist/esm/models/CreateFunctionRunRequest.js +45 -0
  26. package/dist/esm/models/CreateFunctionVersionRequest.d.ts +110 -0
  27. package/dist/esm/models/CreateFunctionVersionRequest.js +79 -0
  28. package/dist/esm/models/Function.d.ts +163 -0
  29. package/dist/esm/models/Function.js +109 -0
  30. package/dist/esm/models/FunctionList.d.ts +33 -0
  31. package/dist/esm/models/FunctionList.js +44 -0
  32. package/dist/esm/models/FunctionReplicaCounts.d.ts +44 -0
  33. package/dist/esm/models/FunctionReplicaCounts.js +51 -0
  34. package/dist/esm/models/FunctionRun.d.ts +130 -0
  35. package/dist/esm/models/FunctionRun.js +94 -0
  36. package/dist/esm/models/FunctionRunError.d.ts +44 -0
  37. package/dist/esm/models/FunctionRunError.js +49 -0
  38. package/dist/esm/models/FunctionRunList.d.ts +39 -0
  39. package/dist/esm/models/FunctionRunList.js +48 -0
  40. package/dist/esm/models/FunctionRunLogChunk.d.ts +59 -0
  41. package/dist/esm/models/FunctionRunLogChunk.js +63 -0
  42. package/dist/esm/models/FunctionRunLogs.d.ts +45 -0
  43. package/dist/esm/models/FunctionRunLogs.js +52 -0
  44. package/dist/esm/models/FunctionUpload.d.ts +51 -0
  45. package/dist/esm/models/FunctionUpload.js +59 -0
  46. package/dist/esm/models/FunctionVersion.d.ts +137 -0
  47. package/dist/esm/models/FunctionVersion.js +109 -0
  48. package/dist/esm/models/GpuSuggestion.d.ts +82 -0
  49. package/dist/esm/models/GpuSuggestion.js +77 -0
  50. package/dist/esm/models/GpuSuggestionCheaper.d.ts +62 -0
  51. package/dist/esm/models/GpuSuggestionCheaper.js +63 -0
  52. package/dist/esm/models/GpuSuggestionGpu.d.ts +50 -0
  53. package/dist/esm/models/GpuSuggestionGpu.js +55 -0
  54. package/dist/esm/models/Instance.d.ts +7 -0
  55. package/dist/esm/models/Instance.js +3 -0
  56. package/dist/esm/models/InstanceGpuMemory.d.ts +51 -0
  57. package/dist/esm/models/InstanceGpuMemory.js +55 -0
  58. package/dist/esm/models/Invoice.d.ts +68 -0
  59. package/dist/esm/models/Invoice.js +67 -0
  60. package/dist/esm/models/InvoiceList.d.ts +45 -0
  61. package/dist/esm/models/InvoiceList.js +50 -0
  62. package/dist/esm/models/ModelPricing.d.ts +46 -0
  63. package/dist/esm/models/ModelPricing.js +21 -0
  64. package/dist/esm/models/ModelRate.d.ts +62 -0
  65. package/dist/esm/models/ModelRate.js +51 -0
  66. package/dist/esm/models/PeakWindow.d.ts +38 -0
  67. package/dist/esm/models/PeakWindow.js +47 -0
  68. package/dist/esm/models/UpdateBillingDetailsRequest.d.ts +80 -0
  69. package/dist/esm/models/UpdateBillingDetailsRequest.js +57 -0
  70. package/dist/esm/models/index.d.ts +23 -0
  71. package/dist/esm/models/index.js +23 -0
  72. package/dist/esm/runtime.js +1 -1
  73. package/dist/models/AutolaunchRule.d.ts +2 -1
  74. package/dist/models/BillingDetails.d.ts +98 -0
  75. package/dist/models/BillingDetails.js +92 -0
  76. package/dist/models/CreateFunctionRequest.d.ts +32 -0
  77. package/dist/models/CreateFunctionRequest.js +50 -0
  78. package/dist/models/CreateFunctionRunRequest.d.ts +38 -0
  79. package/dist/models/CreateFunctionRunRequest.js +52 -0
  80. package/dist/models/CreateFunctionVersionRequest.d.ts +110 -0
  81. package/dist/models/CreateFunctionVersionRequest.js +86 -0
  82. package/dist/models/Function.d.ts +163 -0
  83. package/dist/models/Function.js +117 -0
  84. package/dist/models/FunctionList.d.ts +33 -0
  85. package/dist/models/FunctionList.js +51 -0
  86. package/dist/models/FunctionReplicaCounts.d.ts +44 -0
  87. package/dist/models/FunctionReplicaCounts.js +58 -0
  88. package/dist/models/FunctionRun.d.ts +130 -0
  89. package/dist/models/FunctionRun.js +102 -0
  90. package/dist/models/FunctionRunError.d.ts +44 -0
  91. package/dist/models/FunctionRunError.js +56 -0
  92. package/dist/models/FunctionRunList.d.ts +39 -0
  93. package/dist/models/FunctionRunList.js +55 -0
  94. package/dist/models/FunctionRunLogChunk.d.ts +59 -0
  95. package/dist/models/FunctionRunLogChunk.js +71 -0
  96. package/dist/models/FunctionRunLogs.d.ts +45 -0
  97. package/dist/models/FunctionRunLogs.js +59 -0
  98. package/dist/models/FunctionUpload.d.ts +51 -0
  99. package/dist/models/FunctionUpload.js +67 -0
  100. package/dist/models/FunctionVersion.d.ts +137 -0
  101. package/dist/models/FunctionVersion.js +117 -0
  102. package/dist/models/GpuSuggestion.d.ts +82 -0
  103. package/dist/models/GpuSuggestion.js +85 -0
  104. package/dist/models/GpuSuggestionCheaper.d.ts +62 -0
  105. package/dist/models/GpuSuggestionCheaper.js +70 -0
  106. package/dist/models/GpuSuggestionGpu.d.ts +50 -0
  107. package/dist/models/GpuSuggestionGpu.js +62 -0
  108. package/dist/models/Instance.d.ts +7 -0
  109. package/dist/models/Instance.js +3 -0
  110. package/dist/models/InstanceGpuMemory.d.ts +51 -0
  111. package/dist/models/InstanceGpuMemory.js +62 -0
  112. package/dist/models/Invoice.d.ts +68 -0
  113. package/dist/models/Invoice.js +74 -0
  114. package/dist/models/InvoiceList.d.ts +45 -0
  115. package/dist/models/InvoiceList.js +57 -0
  116. package/dist/models/ModelPricing.d.ts +46 -0
  117. package/dist/models/ModelPricing.js +22 -0
  118. package/dist/models/ModelRate.d.ts +62 -0
  119. package/dist/models/ModelRate.js +58 -0
  120. package/dist/models/PeakWindow.d.ts +38 -0
  121. package/dist/models/PeakWindow.js +54 -0
  122. package/dist/models/UpdateBillingDetailsRequest.d.ts +80 -0
  123. package/dist/models/UpdateBillingDetailsRequest.js +64 -0
  124. package/dist/models/index.d.ts +23 -0
  125. package/dist/models/index.js +23 -0
  126. package/dist/runtime.js +1 -1
  127. package/docs/BillingApi.md +299 -0
  128. package/docs/BillingDetails.md +56 -0
  129. package/docs/CreateFunctionRequest.md +34 -0
  130. package/docs/CreateFunctionRunRequest.md +36 -0
  131. package/docs/CreateFunctionVersionRequest.md +60 -0
  132. package/docs/Function.md +75 -0
  133. package/docs/FunctionList.md +34 -0
  134. package/docs/FunctionReplicaCounts.md +39 -0
  135. package/docs/FunctionRun.md +63 -0
  136. package/docs/FunctionRunError.md +38 -0
  137. package/docs/FunctionRunList.md +36 -0
  138. package/docs/FunctionRunLogChunk.md +40 -0
  139. package/docs/FunctionRunLogs.md +38 -0
  140. package/docs/FunctionUpload.md +38 -0
  141. package/docs/FunctionVersion.md +66 -0
  142. package/docs/FunctionsApi.md +880 -0
  143. package/docs/GpuSuggestion.md +47 -0
  144. package/docs/GpuSuggestionCheaper.md +45 -0
  145. package/docs/GpuSuggestionGpu.md +41 -0
  146. package/docs/Instance.md +2 -0
  147. package/docs/InstanceGpuMemory.md +41 -0
  148. package/docs/InstancesApi.md +75 -0
  149. package/docs/Invoice.md +46 -0
  150. package/docs/InvoiceList.md +38 -0
  151. package/docs/ModelPricing.md +12 -0
  152. package/docs/ModelRate.md +45 -0
  153. package/docs/PeakWindow.md +37 -0
  154. package/docs/UpdateBillingDetailsRequest.md +50 -0
  155. package/package.json +1 -1
  156. package/src/apis/BillingApi.ts +247 -0
  157. package/src/apis/FunctionsApi.ts +828 -0
  158. package/src/apis/InstancesApi.ts +64 -0
  159. package/src/apis/index.ts +1 -0
  160. package/src/models/AutolaunchRule.ts +2 -1
  161. package/src/models/BillingDetails.ts +164 -0
  162. package/src/models/CreateFunctionRequest.ts +66 -0
  163. package/src/models/CreateFunctionRunRequest.ts +74 -0
  164. package/src/models/CreateFunctionVersionRequest.ts +175 -0
  165. package/src/models/Function.ts +255 -0
  166. package/src/models/FunctionList.ts +74 -0
  167. package/src/models/FunctionReplicaCounts.ts +84 -0
  168. package/src/models/FunctionRun.ts +207 -0
  169. package/src/models/FunctionRunError.ts +83 -0
  170. package/src/models/FunctionRunList.ts +83 -0
  171. package/src/models/FunctionRunLogChunk.ts +105 -0
  172. package/src/models/FunctionRunLogs.ts +92 -0
  173. package/src/models/FunctionUpload.ts +96 -0
  174. package/src/models/FunctionVersion.ts +226 -0
  175. package/src/models/GpuSuggestion.ts +150 -0
  176. package/src/models/GpuSuggestionCheaper.ts +111 -0
  177. package/src/models/GpuSuggestionGpu.ts +93 -0
  178. package/src/models/Instance.ts +15 -0
  179. package/src/models/InstanceGpuMemory.ts +94 -0
  180. package/src/models/Invoice.ts +120 -0
  181. package/src/models/InvoiceList.ts +91 -0
  182. package/src/models/ModelPricing.ts +74 -0
  183. package/src/models/ModelRate.ts +105 -0
  184. package/src/models/PeakWindow.ts +75 -0
  185. package/src/models/UpdateBillingDetailsRequest.ts +129 -0
  186. package/src/models/index.ts +23 -0
  187. package/src/runtime.ts +1 -1
@@ -0,0 +1,50 @@
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
+ * A GPU model at an hourly price.
14
+ * @export
15
+ * @interface GpuSuggestionGpu
16
+ */
17
+ export interface GpuSuggestionGpu {
18
+ /**
19
+ * The GPU model id, as in GET /v1/gpu-types.
20
+ * @type {string}
21
+ * @memberof GpuSuggestionGpu
22
+ */
23
+ gpuType: string;
24
+ /**
25
+ * The GPU model's display name.
26
+ * @type {string}
27
+ * @memberof GpuSuggestionGpu
28
+ */
29
+ gpuName: string;
30
+ /**
31
+ * Memory per GPU, in GB.
32
+ * @type {number}
33
+ * @memberof GpuSuggestionGpu
34
+ */
35
+ vramGb: number;
36
+ /**
37
+ * Hourly price for the same number of GPUs as the instance.
38
+ * @type {number}
39
+ * @memberof GpuSuggestionGpu
40
+ */
41
+ pricePerHour: number;
42
+ }
43
+ /**
44
+ * Check if a given object implements the GpuSuggestionGpu interface.
45
+ */
46
+ export declare function instanceOfGpuSuggestionGpu(value: object): value is GpuSuggestionGpu;
47
+ export declare function GpuSuggestionGpuFromJSON(json: any): GpuSuggestionGpu;
48
+ export declare function GpuSuggestionGpuFromJSONTyped(json: any, ignoreDiscriminator: boolean): GpuSuggestionGpu;
49
+ export declare function GpuSuggestionGpuToJSON(json: any): GpuSuggestionGpu;
50
+ export declare function GpuSuggestionGpuToJSONTyped(value?: GpuSuggestionGpu | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfGpuSuggestionGpu = instanceOfGpuSuggestionGpu;
17
+ exports.GpuSuggestionGpuFromJSON = GpuSuggestionGpuFromJSON;
18
+ exports.GpuSuggestionGpuFromJSONTyped = GpuSuggestionGpuFromJSONTyped;
19
+ exports.GpuSuggestionGpuToJSON = GpuSuggestionGpuToJSON;
20
+ exports.GpuSuggestionGpuToJSONTyped = GpuSuggestionGpuToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the GpuSuggestionGpu interface.
23
+ */
24
+ function instanceOfGpuSuggestionGpu(value) {
25
+ if ((!('gpuType' in value) && !('gpu_type' in value)) || (value['gpuType'] === undefined && value['gpu_type'] === undefined))
26
+ return false;
27
+ if ((!('gpuName' in value) && !('gpu_name' in value)) || (value['gpuName'] === undefined && value['gpu_name'] === undefined))
28
+ return false;
29
+ if ((!('vramGb' in value) && !('vram_gb' in value)) || (value['vramGb'] === undefined && value['vram_gb'] === undefined))
30
+ return false;
31
+ if ((!('pricePerHour' in value) && !('price_per_hour' in value)) || (value['pricePerHour'] === undefined && value['price_per_hour'] === undefined))
32
+ return false;
33
+ return true;
34
+ }
35
+ function GpuSuggestionGpuFromJSON(json) {
36
+ return GpuSuggestionGpuFromJSONTyped(json, false);
37
+ }
38
+ function GpuSuggestionGpuFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'gpuType': json['gpu_type'],
44
+ 'gpuName': json['gpu_name'],
45
+ 'vramGb': json['vram_gb'],
46
+ 'pricePerHour': json['price_per_hour'],
47
+ };
48
+ }
49
+ function GpuSuggestionGpuToJSON(json) {
50
+ return GpuSuggestionGpuToJSONTyped(json, false);
51
+ }
52
+ function GpuSuggestionGpuToJSONTyped(value, ignoreDiscriminator = false) {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+ 'gpu_type': value['gpuType'],
58
+ 'gpu_name': value['gpuName'],
59
+ 'vram_gb': value['vramGb'],
60
+ 'price_per_hour': value['pricePerHour'],
61
+ };
62
+ }
@@ -10,6 +10,7 @@
10
10
  * Do not edit the class manually.
11
11
  */
12
12
  import type { InstanceConnection } from './InstanceConnection';
13
+ import type { InstanceGpuMemory } from './InstanceGpuMemory';
13
14
  /**
14
15
  *
15
16
  * @export
@@ -64,6 +65,12 @@ export interface Instance {
64
65
  * @memberof Instance
65
66
  */
66
67
  pricePerHour: number;
68
+ /**
69
+ *
70
+ * @type {InstanceGpuMemory}
71
+ * @memberof Instance
72
+ */
73
+ gpuMemory?: InstanceGpuMemory;
67
74
  /**
68
75
  *
69
76
  * @type {InstanceConnection}
@@ -20,6 +20,7 @@ exports.InstanceFromJSONTyped = InstanceFromJSONTyped;
20
20
  exports.InstanceToJSON = InstanceToJSON;
21
21
  exports.InstanceToJSONTyped = InstanceToJSONTyped;
22
22
  const InstanceConnection_1 = require("./InstanceConnection");
23
+ const InstanceGpuMemory_1 = require("./InstanceGpuMemory");
23
24
  /**
24
25
  * @export
25
26
  */
@@ -78,6 +79,7 @@ function InstanceFromJSONTyped(json, ignoreDiscriminator) {
78
79
  'region': json['region'],
79
80
  'tier': json['tier'],
80
81
  'pricePerHour': json['price_per_hour'],
82
+ 'gpuMemory': json['gpu_memory'] == null ? undefined : (0, InstanceGpuMemory_1.InstanceGpuMemoryFromJSON)(json['gpu_memory']),
81
83
  'connection': json['connection'] == null ? undefined : (0, InstanceConnection_1.InstanceConnectionFromJSON)(json['connection']),
82
84
  'diskGb': json['disk_gb'] == null ? undefined : json['disk_gb'],
83
85
  'image': json['image'] == null ? undefined : json['image'],
@@ -107,6 +109,7 @@ function InstanceToJSONTyped(value, ignoreDiscriminator = false) {
107
109
  'region': value['region'],
108
110
  'tier': value['tier'],
109
111
  'price_per_hour': value['pricePerHour'],
112
+ 'gpu_memory': (0, InstanceGpuMemory_1.InstanceGpuMemoryToJSON)(value['gpuMemory']),
110
113
  'connection': (0, InstanceConnection_1.InstanceConnectionToJSON)(value['connection']),
111
114
  'disk_gb': value['diskGb'],
112
115
  'image': value['image'],
@@ -0,0 +1,51 @@
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
+ * The highest GPU memory use seen on an instance since launch, from the telemetry every instance reports about every two minutes. On an instance with several GPUs it is the busiest GPU. Absent on an instance until its first sample arrives.
14
+ *
15
+ * @export
16
+ * @interface InstanceGpuMemory
17
+ */
18
+ export interface InstanceGpuMemory {
19
+ /**
20
+ * Highest memory in use on the GPU, in MiB.
21
+ * @type {number}
22
+ * @memberof InstanceGpuMemory
23
+ */
24
+ peakUsedMb: number;
25
+ /**
26
+ * The GPU's total memory, in MiB.
27
+ * @type {number}
28
+ * @memberof InstanceGpuMemory
29
+ */
30
+ totalMb: number;
31
+ /**
32
+ * How many telemetry samples the peak is taken from.
33
+ * @type {number}
34
+ * @memberof InstanceGpuMemory
35
+ */
36
+ samples: number;
37
+ /**
38
+ *
39
+ * @type {Date}
40
+ * @memberof InstanceGpuMemory
41
+ */
42
+ lastSampleAt: Date;
43
+ }
44
+ /**
45
+ * Check if a given object implements the InstanceGpuMemory interface.
46
+ */
47
+ export declare function instanceOfInstanceGpuMemory(value: object): value is InstanceGpuMemory;
48
+ export declare function InstanceGpuMemoryFromJSON(json: any): InstanceGpuMemory;
49
+ export declare function InstanceGpuMemoryFromJSONTyped(json: any, ignoreDiscriminator: boolean): InstanceGpuMemory;
50
+ export declare function InstanceGpuMemoryToJSON(json: any): InstanceGpuMemory;
51
+ export declare function InstanceGpuMemoryToJSONTyped(value?: InstanceGpuMemory | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfInstanceGpuMemory = instanceOfInstanceGpuMemory;
17
+ exports.InstanceGpuMemoryFromJSON = InstanceGpuMemoryFromJSON;
18
+ exports.InstanceGpuMemoryFromJSONTyped = InstanceGpuMemoryFromJSONTyped;
19
+ exports.InstanceGpuMemoryToJSON = InstanceGpuMemoryToJSON;
20
+ exports.InstanceGpuMemoryToJSONTyped = InstanceGpuMemoryToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the InstanceGpuMemory interface.
23
+ */
24
+ function instanceOfInstanceGpuMemory(value) {
25
+ if ((!('peakUsedMb' in value) && !('peak_used_mb' in value)) || (value['peakUsedMb'] === undefined && value['peak_used_mb'] === undefined))
26
+ return false;
27
+ if ((!('totalMb' in value) && !('total_mb' in value)) || (value['totalMb'] === undefined && value['total_mb'] === undefined))
28
+ return false;
29
+ if (!('samples' in value) || value['samples'] === undefined)
30
+ return false;
31
+ if ((!('lastSampleAt' in value) && !('last_sample_at' in value)) || (value['lastSampleAt'] === undefined && value['last_sample_at'] === undefined))
32
+ return false;
33
+ return true;
34
+ }
35
+ function InstanceGpuMemoryFromJSON(json) {
36
+ return InstanceGpuMemoryFromJSONTyped(json, false);
37
+ }
38
+ function InstanceGpuMemoryFromJSONTyped(json, ignoreDiscriminator) {
39
+ if (json == null) {
40
+ return json;
41
+ }
42
+ return {
43
+ 'peakUsedMb': json['peak_used_mb'],
44
+ 'totalMb': json['total_mb'],
45
+ 'samples': json['samples'],
46
+ 'lastSampleAt': (new Date(json['last_sample_at'])),
47
+ };
48
+ }
49
+ function InstanceGpuMemoryToJSON(json) {
50
+ return InstanceGpuMemoryToJSONTyped(json, false);
51
+ }
52
+ function InstanceGpuMemoryToJSONTyped(value, ignoreDiscriminator = false) {
53
+ if (value == null) {
54
+ return value;
55
+ }
56
+ return {
57
+ 'peak_used_mb': value['peakUsedMb'],
58
+ 'total_mb': value['totalMb'],
59
+ 'samples': value['samples'],
60
+ 'last_sample_at': value['lastSampleAt'].toISOString(),
61
+ };
62
+ }
@@ -0,0 +1,68 @@
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 Invoice
16
+ */
17
+ export interface Invoice {
18
+ /**
19
+ *
20
+ * @type {string}
21
+ * @memberof Invoice
22
+ */
23
+ id: string;
24
+ /**
25
+ *
26
+ * @type {string}
27
+ * @memberof Invoice
28
+ */
29
+ number: string;
30
+ /**
31
+ * The payment date, which is also the invoice date.
32
+ * @type {Date}
33
+ * @memberof Invoice
34
+ */
35
+ issuedAt: Date;
36
+ /**
37
+ *
38
+ * @type {number}
39
+ * @memberof Invoice
40
+ */
41
+ amountCents: number;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof Invoice
46
+ */
47
+ currency: string;
48
+ /**
49
+ *
50
+ * @type {string}
51
+ * @memberof Invoice
52
+ */
53
+ paymentMethod: string;
54
+ /**
55
+ *
56
+ * @type {string}
57
+ * @memberof Invoice
58
+ */
59
+ description: string;
60
+ }
61
+ /**
62
+ * Check if a given object implements the Invoice interface.
63
+ */
64
+ export declare function instanceOfInvoice(value: object): value is Invoice;
65
+ export declare function InvoiceFromJSON(json: any): Invoice;
66
+ export declare function InvoiceFromJSONTyped(json: any, ignoreDiscriminator: boolean): Invoice;
67
+ export declare function InvoiceToJSON(json: any): Invoice;
68
+ export declare function InvoiceToJSONTyped(value?: Invoice | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,74 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfInvoice = instanceOfInvoice;
17
+ exports.InvoiceFromJSON = InvoiceFromJSON;
18
+ exports.InvoiceFromJSONTyped = InvoiceFromJSONTyped;
19
+ exports.InvoiceToJSON = InvoiceToJSON;
20
+ exports.InvoiceToJSONTyped = InvoiceToJSONTyped;
21
+ /**
22
+ * Check if a given object implements the Invoice interface.
23
+ */
24
+ function instanceOfInvoice(value) {
25
+ if (!('id' in value) || value['id'] === undefined)
26
+ return false;
27
+ if (!('number' in value) || value['number'] === undefined)
28
+ return false;
29
+ if ((!('issuedAt' in value) && !('issued_at' in value)) || (value['issuedAt'] === undefined && value['issued_at'] === undefined))
30
+ return false;
31
+ if ((!('amountCents' in value) && !('amount_cents' in value)) || (value['amountCents'] === undefined && value['amount_cents'] === undefined))
32
+ return false;
33
+ if (!('currency' in value) || value['currency'] === undefined)
34
+ return false;
35
+ if ((!('paymentMethod' in value) && !('payment_method' in value)) || (value['paymentMethod'] === undefined && value['payment_method'] === undefined))
36
+ return false;
37
+ if (!('description' in value) || value['description'] === undefined)
38
+ return false;
39
+ return true;
40
+ }
41
+ function InvoiceFromJSON(json) {
42
+ return InvoiceFromJSONTyped(json, false);
43
+ }
44
+ function InvoiceFromJSONTyped(json, ignoreDiscriminator) {
45
+ if (json == null) {
46
+ return json;
47
+ }
48
+ return {
49
+ 'id': json['id'],
50
+ 'number': json['number'],
51
+ 'issuedAt': (new Date(json['issued_at'])),
52
+ 'amountCents': json['amount_cents'],
53
+ 'currency': json['currency'],
54
+ 'paymentMethod': json['payment_method'],
55
+ 'description': json['description'],
56
+ };
57
+ }
58
+ function InvoiceToJSON(json) {
59
+ return InvoiceToJSONTyped(json, false);
60
+ }
61
+ function InvoiceToJSONTyped(value, ignoreDiscriminator = false) {
62
+ if (value == null) {
63
+ return value;
64
+ }
65
+ return {
66
+ 'id': value['id'],
67
+ 'number': value['number'],
68
+ 'issued_at': value['issuedAt'].toISOString(),
69
+ 'amount_cents': value['amountCents'],
70
+ 'currency': value['currency'],
71
+ 'payment_method': value['paymentMethod'],
72
+ 'description': value['description'],
73
+ };
74
+ }
@@ -0,0 +1,45 @@
1
+ /**
2
+ * GPU.ai Public Developer API
3
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
4
+ *
5
+ * The version of the OpenAPI document: 1.0.0
6
+ * Contact: support@gpu.ai
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ import type { Invoice } from './Invoice';
13
+ /**
14
+ *
15
+ * @export
16
+ * @interface InvoiceList
17
+ */
18
+ export interface InvoiceList {
19
+ /**
20
+ *
21
+ * @type {Array<Invoice>}
22
+ * @memberof InvoiceList
23
+ */
24
+ invoices: Array<Invoice>;
25
+ /**
26
+ *
27
+ * @type {boolean}
28
+ * @memberof InvoiceList
29
+ */
30
+ hasMore: boolean;
31
+ /**
32
+ *
33
+ * @type {string}
34
+ * @memberof InvoiceList
35
+ */
36
+ nextCursor?: string;
37
+ }
38
+ /**
39
+ * Check if a given object implements the InvoiceList interface.
40
+ */
41
+ export declare function instanceOfInvoiceList(value: object): value is InvoiceList;
42
+ export declare function InvoiceListFromJSON(json: any): InvoiceList;
43
+ export declare function InvoiceListFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvoiceList;
44
+ export declare function InvoiceListToJSON(json: any): InvoiceList;
45
+ export declare function InvoiceListToJSONTyped(value?: InvoiceList | null, ignoreDiscriminator?: boolean): any;
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * GPU.ai Public Developer API
6
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
7
+ *
8
+ * The version of the OpenAPI document: 1.0.0
9
+ * Contact: support@gpu.ai
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.instanceOfInvoiceList = instanceOfInvoiceList;
17
+ exports.InvoiceListFromJSON = InvoiceListFromJSON;
18
+ exports.InvoiceListFromJSONTyped = InvoiceListFromJSONTyped;
19
+ exports.InvoiceListToJSON = InvoiceListToJSON;
20
+ exports.InvoiceListToJSONTyped = InvoiceListToJSONTyped;
21
+ const Invoice_1 = require("./Invoice");
22
+ /**
23
+ * Check if a given object implements the InvoiceList interface.
24
+ */
25
+ function instanceOfInvoiceList(value) {
26
+ if (!('invoices' in value) || value['invoices'] === undefined)
27
+ return false;
28
+ if ((!('hasMore' in value) && !('has_more' in value)) || (value['hasMore'] === undefined && value['has_more'] === undefined))
29
+ return false;
30
+ return true;
31
+ }
32
+ function InvoiceListFromJSON(json) {
33
+ return InvoiceListFromJSONTyped(json, false);
34
+ }
35
+ function InvoiceListFromJSONTyped(json, ignoreDiscriminator) {
36
+ if (json == null) {
37
+ return json;
38
+ }
39
+ return {
40
+ 'invoices': (json['invoices'].map(Invoice_1.InvoiceFromJSON)),
41
+ 'hasMore': json['has_more'],
42
+ 'nextCursor': json['next_cursor'] == null ? undefined : json['next_cursor'],
43
+ };
44
+ }
45
+ function InvoiceListToJSON(json) {
46
+ return InvoiceListToJSONTyped(json, false);
47
+ }
48
+ function InvoiceListToJSONTyped(value, ignoreDiscriminator = false) {
49
+ if (value == null) {
50
+ return value;
51
+ }
52
+ return {
53
+ 'invoices': (value['invoices'].map(Invoice_1.InvoiceToJSON)),
54
+ 'has_more': value['hasMore'],
55
+ 'next_cursor': value['nextCursor'],
56
+ };
57
+ }
@@ -9,6 +9,8 @@
9
9
  * https://openapi-generator.tech
10
10
  * Do not edit the class manually.
11
11
  */
12
+ import type { ModelRate } from './ModelRate';
13
+ import type { PeakWindow } from './PeakWindow';
12
14
  /**
13
15
  *
14
16
  * @export
@@ -33,6 +35,18 @@ export interface ModelPricing {
33
35
  * @memberof ModelPricing
34
36
  */
35
37
  outputPer1mTokensCents?: number;
38
+ /**
39
+ * Exact per-1M-token rate in micro-cents (1e-6 cent) for the cache-HIT part of a chat prompt (usage.prompt_tokens_details.cached_tokens). Present only on models with a published cached-input rate; absent means no discount — every prompt token bills at input_per_1m_tokens_cents. Treat this field as the presence signal: cached rates are routinely sub-cent, so the rounded cents field below is often omitted.
40
+ * @type {number}
41
+ * @memberof ModelPricing
42
+ */
43
+ cachedInputPer1mTokensMicrocents?: number;
44
+ /**
45
+ * cached_input_per_1m_tokens_microcents rounded to whole cents; omitted when the exact rate rounds below half a cent.
46
+ * @type {number}
47
+ * @memberof ModelPricing
48
+ */
49
+ cachedInputPer1mTokensCents?: number;
36
50
  /**
37
51
  *
38
52
  * @type {number}
@@ -69,7 +83,39 @@ export interface ModelPricing {
69
83
  * @memberof ModelPricing
70
84
  */
71
85
  perVideoSecondMicrocents?: number;
86
+ /**
87
+ * Present only on a model priced by time of day. Which side of the peak schedule the instant this response was rendered falls on; the flat rate fields above are the rates in effect at that instant. A request is billed at the rate in effect when it ARRIVES (UTC), so a caller planning a call for later should price it from `peak` / `off_peak` and `peak_windows_utc`.
88
+ * @type {ModelPricingPeriodEnum}
89
+ * @memberof ModelPricing
90
+ */
91
+ period?: ModelPricingPeriodEnum;
92
+ /**
93
+ * The daily UTC ranges during which the `peak` rates apply, start inclusive and end exclusive ("24:00" is a valid end; a range whose end sorts before its start wraps midnight). Present only on a model priced by time of day.
94
+ * @type {Array<PeakWindow>}
95
+ * @memberof ModelPricing
96
+ */
97
+ peakWindowsUtc?: Array<PeakWindow>;
98
+ /**
99
+ *
100
+ * @type {ModelRate}
101
+ * @memberof ModelPricing
102
+ */
103
+ peak?: ModelRate;
104
+ /**
105
+ *
106
+ * @type {ModelRate}
107
+ * @memberof ModelPricing
108
+ */
109
+ offPeak?: ModelRate;
72
110
  }
111
+ /**
112
+ * @export
113
+ */
114
+ export declare const ModelPricingPeriodEnum: {
115
+ readonly Peak: "peak";
116
+ readonly OffPeak: "off_peak";
117
+ };
118
+ export type ModelPricingPeriodEnum = typeof ModelPricingPeriodEnum[keyof typeof ModelPricingPeriodEnum];
73
119
  /**
74
120
  * Check if a given object implements the ModelPricing interface.
75
121
  */
@@ -13,11 +13,21 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.ModelPricingPeriodEnum = void 0;
16
17
  exports.instanceOfModelPricing = instanceOfModelPricing;
17
18
  exports.ModelPricingFromJSON = ModelPricingFromJSON;
18
19
  exports.ModelPricingFromJSONTyped = ModelPricingFromJSONTyped;
19
20
  exports.ModelPricingToJSON = ModelPricingToJSON;
20
21
  exports.ModelPricingToJSONTyped = ModelPricingToJSONTyped;
22
+ const ModelRate_1 = require("./ModelRate");
23
+ const PeakWindow_1 = require("./PeakWindow");
24
+ /**
25
+ * @export
26
+ */
27
+ exports.ModelPricingPeriodEnum = {
28
+ Peak: 'peak',
29
+ OffPeak: 'off_peak'
30
+ };
21
31
  /**
22
32
  * Check if a given object implements the ModelPricing interface.
23
33
  */
@@ -35,12 +45,18 @@ function ModelPricingFromJSONTyped(json, ignoreDiscriminator) {
35
45
  'currency': json['currency'] == null ? undefined : json['currency'],
36
46
  'inputPer1mTokensCents': json['input_per_1m_tokens_cents'] == null ? undefined : json['input_per_1m_tokens_cents'],
37
47
  'outputPer1mTokensCents': json['output_per_1m_tokens_cents'] == null ? undefined : json['output_per_1m_tokens_cents'],
48
+ 'cachedInputPer1mTokensMicrocents': json['cached_input_per_1m_tokens_microcents'] == null ? undefined : json['cached_input_per_1m_tokens_microcents'],
49
+ 'cachedInputPer1mTokensCents': json['cached_input_per_1m_tokens_cents'] == null ? undefined : json['cached_input_per_1m_tokens_cents'],
38
50
  'perImageCents': json['per_image_cents'] == null ? undefined : json['per_image_cents'],
39
51
  'perImageMicrocents': json['per_image_microcents'] == null ? undefined : json['per_image_microcents'],
40
52
  'perMpxlMicrocents': json['per_mpxl_microcents'] == null ? undefined : json['per_mpxl_microcents'],
41
53
  'perVideoMicrocents': json['per_video_microcents'] == null ? undefined : json['per_video_microcents'],
42
54
  'perVideoSecondCents': json['per_video_second_cents'] == null ? undefined : json['per_video_second_cents'],
43
55
  'perVideoSecondMicrocents': json['per_video_second_microcents'] == null ? undefined : json['per_video_second_microcents'],
56
+ 'period': json['period'] == null ? undefined : json['period'],
57
+ 'peakWindowsUtc': json['peak_windows_utc'] == null ? undefined : (json['peak_windows_utc'].map(PeakWindow_1.PeakWindowFromJSON)),
58
+ 'peak': json['peak'] == null ? undefined : (0, ModelRate_1.ModelRateFromJSON)(json['peak']),
59
+ 'offPeak': json['off_peak'] == null ? undefined : (0, ModelRate_1.ModelRateFromJSON)(json['off_peak']),
44
60
  };
45
61
  }
46
62
  function ModelPricingToJSON(json) {
@@ -54,11 +70,17 @@ function ModelPricingToJSONTyped(value, ignoreDiscriminator = false) {
54
70
  'currency': value['currency'],
55
71
  'input_per_1m_tokens_cents': value['inputPer1mTokensCents'],
56
72
  'output_per_1m_tokens_cents': value['outputPer1mTokensCents'],
73
+ 'cached_input_per_1m_tokens_microcents': value['cachedInputPer1mTokensMicrocents'],
74
+ 'cached_input_per_1m_tokens_cents': value['cachedInputPer1mTokensCents'],
57
75
  'per_image_cents': value['perImageCents'],
58
76
  'per_image_microcents': value['perImageMicrocents'],
59
77
  'per_mpxl_microcents': value['perMpxlMicrocents'],
60
78
  'per_video_microcents': value['perVideoMicrocents'],
61
79
  'per_video_second_cents': value['perVideoSecondCents'],
62
80
  'per_video_second_microcents': value['perVideoSecondMicrocents'],
81
+ 'period': value['period'],
82
+ 'peak_windows_utc': value['peakWindowsUtc'] == null ? undefined : (value['peakWindowsUtc'].map(PeakWindow_1.PeakWindowToJSON)),
83
+ 'peak': (0, ModelRate_1.ModelRateToJSON)(value['peak']),
84
+ 'off_peak': (0, ModelRate_1.ModelRateToJSON)(value['offPeak']),
63
85
  };
64
86
  }