@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,91 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ import type { Invoice } from './Invoice';
17
+ import {
18
+ InvoiceFromJSON,
19
+ InvoiceFromJSONTyped,
20
+ InvoiceToJSON,
21
+ InvoiceToJSONTyped,
22
+ } from './Invoice';
23
+
24
+ /**
25
+ *
26
+ * @export
27
+ * @interface InvoiceList
28
+ */
29
+ export interface InvoiceList {
30
+ /**
31
+ *
32
+ * @type {Array<Invoice>}
33
+ * @memberof InvoiceList
34
+ */
35
+ invoices: Array<Invoice>;
36
+ /**
37
+ *
38
+ * @type {boolean}
39
+ * @memberof InvoiceList
40
+ */
41
+ hasMore: boolean;
42
+ /**
43
+ *
44
+ * @type {string}
45
+ * @memberof InvoiceList
46
+ */
47
+ nextCursor?: string;
48
+ }
49
+
50
+ /**
51
+ * Check if a given object implements the InvoiceList interface.
52
+ */
53
+ export function instanceOfInvoiceList(value: object): value is InvoiceList {
54
+ if (!('invoices' in value) || value['invoices'] === undefined) return false;
55
+ if ((!('hasMore' in (value as Record<string, any>)) && !('has_more' in (value as Record<string, any>))) || ((value as Record<string, any>)['hasMore'] === undefined && (value as Record<string, any>)['has_more'] === undefined)) return false;
56
+ return true;
57
+ }
58
+
59
+ export function InvoiceListFromJSON(json: any): InvoiceList {
60
+ return InvoiceListFromJSONTyped(json, false);
61
+ }
62
+
63
+ export function InvoiceListFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvoiceList {
64
+ if (json == null) {
65
+ return json;
66
+ }
67
+ return {
68
+
69
+ 'invoices': ((json['invoices'] as Array<any>).map(InvoiceFromJSON)),
70
+ 'hasMore': json['has_more'],
71
+ 'nextCursor': json['next_cursor'] == null ? undefined : json['next_cursor'],
72
+ };
73
+ }
74
+
75
+ export function InvoiceListToJSON(json: any): InvoiceList {
76
+ return InvoiceListToJSONTyped(json, false);
77
+ }
78
+
79
+ export function InvoiceListToJSONTyped(value?: InvoiceList | null, ignoreDiscriminator: boolean = false): any {
80
+ if (value == null) {
81
+ return value;
82
+ }
83
+
84
+ return {
85
+
86
+ 'invoices': ((value['invoices'] as Array<any>).map(InvoiceToJSON)),
87
+ 'has_more': value['hasMore'],
88
+ 'next_cursor': value['nextCursor'],
89
+ };
90
+ }
91
+
@@ -13,6 +13,21 @@
13
13
  */
14
14
 
15
15
  import { mapValues } from '../runtime';
16
+ import type { ModelRate } from './ModelRate';
17
+ import {
18
+ ModelRateFromJSON,
19
+ ModelRateFromJSONTyped,
20
+ ModelRateToJSON,
21
+ ModelRateToJSONTyped,
22
+ } from './ModelRate';
23
+ import type { PeakWindow } from './PeakWindow';
24
+ import {
25
+ PeakWindowFromJSON,
26
+ PeakWindowFromJSONTyped,
27
+ PeakWindowToJSON,
28
+ PeakWindowToJSONTyped,
29
+ } from './PeakWindow';
30
+
16
31
  /**
17
32
  *
18
33
  * @export
@@ -37,6 +52,18 @@ export interface ModelPricing {
37
52
  * @memberof ModelPricing
38
53
  */
39
54
  outputPer1mTokensCents?: number;
55
+ /**
56
+ * 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.
57
+ * @type {number}
58
+ * @memberof ModelPricing
59
+ */
60
+ cachedInputPer1mTokensMicrocents?: number;
61
+ /**
62
+ * cached_input_per_1m_tokens_microcents rounded to whole cents; omitted when the exact rate rounds below half a cent.
63
+ * @type {number}
64
+ * @memberof ModelPricing
65
+ */
66
+ cachedInputPer1mTokensCents?: number;
40
67
  /**
41
68
  *
42
69
  * @type {number}
@@ -73,8 +100,43 @@ export interface ModelPricing {
73
100
  * @memberof ModelPricing
74
101
  */
75
102
  perVideoSecondMicrocents?: number;
103
+ /**
104
+ * 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`.
105
+ * @type {ModelPricingPeriodEnum}
106
+ * @memberof ModelPricing
107
+ */
108
+ period?: ModelPricingPeriodEnum;
109
+ /**
110
+ * 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.
111
+ * @type {Array<PeakWindow>}
112
+ * @memberof ModelPricing
113
+ */
114
+ peakWindowsUtc?: Array<PeakWindow>;
115
+ /**
116
+ *
117
+ * @type {ModelRate}
118
+ * @memberof ModelPricing
119
+ */
120
+ peak?: ModelRate;
121
+ /**
122
+ *
123
+ * @type {ModelRate}
124
+ * @memberof ModelPricing
125
+ */
126
+ offPeak?: ModelRate;
76
127
  }
77
128
 
129
+
130
+ /**
131
+ * @export
132
+ */
133
+ export const ModelPricingPeriodEnum = {
134
+ Peak: 'peak',
135
+ OffPeak: 'off_peak'
136
+ } as const;
137
+ export type ModelPricingPeriodEnum = typeof ModelPricingPeriodEnum[keyof typeof ModelPricingPeriodEnum];
138
+
139
+
78
140
  /**
79
141
  * Check if a given object implements the ModelPricing interface.
80
142
  */
@@ -95,12 +157,18 @@ export function ModelPricingFromJSONTyped(json: any, ignoreDiscriminator: boolea
95
157
  'currency': json['currency'] == null ? undefined : json['currency'],
96
158
  'inputPer1mTokensCents': json['input_per_1m_tokens_cents'] == null ? undefined : json['input_per_1m_tokens_cents'],
97
159
  'outputPer1mTokensCents': json['output_per_1m_tokens_cents'] == null ? undefined : json['output_per_1m_tokens_cents'],
160
+ 'cachedInputPer1mTokensMicrocents': json['cached_input_per_1m_tokens_microcents'] == null ? undefined : json['cached_input_per_1m_tokens_microcents'],
161
+ 'cachedInputPer1mTokensCents': json['cached_input_per_1m_tokens_cents'] == null ? undefined : json['cached_input_per_1m_tokens_cents'],
98
162
  'perImageCents': json['per_image_cents'] == null ? undefined : json['per_image_cents'],
99
163
  'perImageMicrocents': json['per_image_microcents'] == null ? undefined : json['per_image_microcents'],
100
164
  'perMpxlMicrocents': json['per_mpxl_microcents'] == null ? undefined : json['per_mpxl_microcents'],
101
165
  'perVideoMicrocents': json['per_video_microcents'] == null ? undefined : json['per_video_microcents'],
102
166
  'perVideoSecondCents': json['per_video_second_cents'] == null ? undefined : json['per_video_second_cents'],
103
167
  'perVideoSecondMicrocents': json['per_video_second_microcents'] == null ? undefined : json['per_video_second_microcents'],
168
+ 'period': json['period'] == null ? undefined : json['period'],
169
+ 'peakWindowsUtc': json['peak_windows_utc'] == null ? undefined : ((json['peak_windows_utc'] as Array<any>).map(PeakWindowFromJSON)),
170
+ 'peak': json['peak'] == null ? undefined : ModelRateFromJSON(json['peak']),
171
+ 'offPeak': json['off_peak'] == null ? undefined : ModelRateFromJSON(json['off_peak']),
104
172
  };
105
173
  }
106
174
 
@@ -118,12 +186,18 @@ export function ModelPricingToJSONTyped(value?: ModelPricing | null, ignoreDiscr
118
186
  'currency': value['currency'],
119
187
  'input_per_1m_tokens_cents': value['inputPer1mTokensCents'],
120
188
  'output_per_1m_tokens_cents': value['outputPer1mTokensCents'],
189
+ 'cached_input_per_1m_tokens_microcents': value['cachedInputPer1mTokensMicrocents'],
190
+ 'cached_input_per_1m_tokens_cents': value['cachedInputPer1mTokensCents'],
121
191
  'per_image_cents': value['perImageCents'],
122
192
  'per_image_microcents': value['perImageMicrocents'],
123
193
  'per_mpxl_microcents': value['perMpxlMicrocents'],
124
194
  'per_video_microcents': value['perVideoMicrocents'],
125
195
  'per_video_second_cents': value['perVideoSecondCents'],
126
196
  'per_video_second_microcents': value['perVideoSecondMicrocents'],
197
+ 'period': value['period'],
198
+ 'peak_windows_utc': value['peakWindowsUtc'] == null ? undefined : ((value['peakWindowsUtc'] as Array<any>).map(PeakWindowToJSON)),
199
+ 'peak': ModelRateToJSON(value['peak']),
200
+ 'off_peak': ModelRateToJSON(value['offPeak']),
127
201
  };
128
202
  }
129
203
 
@@ -0,0 +1,105 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One per-1M-token rate triple, in rounded cents and exact micro-cents (1e-6 cent). Prefer the micro-cent fields for arithmetic; cached rates are routinely sub-cent and their cents field is then omitted.
18
+ * @export
19
+ * @interface ModelRate
20
+ */
21
+ export interface ModelRate {
22
+ /**
23
+ *
24
+ * @type {number}
25
+ * @memberof ModelRate
26
+ */
27
+ inputPer1mTokensCents?: number;
28
+ /**
29
+ *
30
+ * @type {number}
31
+ * @memberof ModelRate
32
+ */
33
+ inputPer1mTokensMicrocents?: number;
34
+ /**
35
+ *
36
+ * @type {number}
37
+ * @memberof ModelRate
38
+ */
39
+ cachedInputPer1mTokensCents?: number;
40
+ /**
41
+ *
42
+ * @type {number}
43
+ * @memberof ModelRate
44
+ */
45
+ cachedInputPer1mTokensMicrocents?: number;
46
+ /**
47
+ *
48
+ * @type {number}
49
+ * @memberof ModelRate
50
+ */
51
+ outputPer1mTokensCents?: number;
52
+ /**
53
+ *
54
+ * @type {number}
55
+ * @memberof ModelRate
56
+ */
57
+ outputPer1mTokensMicrocents?: number;
58
+ }
59
+
60
+ /**
61
+ * Check if a given object implements the ModelRate interface.
62
+ */
63
+ export function instanceOfModelRate(value: object): value is ModelRate {
64
+ return true;
65
+ }
66
+
67
+ export function ModelRateFromJSON(json: any): ModelRate {
68
+ return ModelRateFromJSONTyped(json, false);
69
+ }
70
+
71
+ export function ModelRateFromJSONTyped(json: any, ignoreDiscriminator: boolean): ModelRate {
72
+ if (json == null) {
73
+ return json;
74
+ }
75
+ return {
76
+
77
+ 'inputPer1mTokensCents': json['input_per_1m_tokens_cents'] == null ? undefined : json['input_per_1m_tokens_cents'],
78
+ 'inputPer1mTokensMicrocents': json['input_per_1m_tokens_microcents'] == null ? undefined : json['input_per_1m_tokens_microcents'],
79
+ 'cachedInputPer1mTokensCents': json['cached_input_per_1m_tokens_cents'] == null ? undefined : json['cached_input_per_1m_tokens_cents'],
80
+ 'cachedInputPer1mTokensMicrocents': json['cached_input_per_1m_tokens_microcents'] == null ? undefined : json['cached_input_per_1m_tokens_microcents'],
81
+ 'outputPer1mTokensCents': json['output_per_1m_tokens_cents'] == null ? undefined : json['output_per_1m_tokens_cents'],
82
+ 'outputPer1mTokensMicrocents': json['output_per_1m_tokens_microcents'] == null ? undefined : json['output_per_1m_tokens_microcents'],
83
+ };
84
+ }
85
+
86
+ export function ModelRateToJSON(json: any): ModelRate {
87
+ return ModelRateToJSONTyped(json, false);
88
+ }
89
+
90
+ export function ModelRateToJSONTyped(value?: ModelRate | null, ignoreDiscriminator: boolean = false): any {
91
+ if (value == null) {
92
+ return value;
93
+ }
94
+
95
+ return {
96
+
97
+ 'input_per_1m_tokens_cents': value['inputPer1mTokensCents'],
98
+ 'input_per_1m_tokens_microcents': value['inputPer1mTokensMicrocents'],
99
+ 'cached_input_per_1m_tokens_cents': value['cachedInputPer1mTokensCents'],
100
+ 'cached_input_per_1m_tokens_microcents': value['cachedInputPer1mTokensMicrocents'],
101
+ 'output_per_1m_tokens_cents': value['outputPer1mTokensCents'],
102
+ 'output_per_1m_tokens_microcents': value['outputPer1mTokensMicrocents'],
103
+ };
104
+ }
105
+
@@ -0,0 +1,75 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ * One daily UTC time range during which a model's peak rates apply.
18
+ * @export
19
+ * @interface PeakWindow
20
+ */
21
+ export interface PeakWindow {
22
+ /**
23
+ * "HH:MM" UTC, inclusive.
24
+ * @type {string}
25
+ * @memberof PeakWindow
26
+ */
27
+ start: string;
28
+ /**
29
+ * "HH:MM" UTC, exclusive ("24:00" means until midnight).
30
+ * @type {string}
31
+ * @memberof PeakWindow
32
+ */
33
+ end: string;
34
+ }
35
+
36
+ /**
37
+ * Check if a given object implements the PeakWindow interface.
38
+ */
39
+ export function instanceOfPeakWindow(value: object): value is PeakWindow {
40
+ if (!('start' in value) || value['start'] === undefined) return false;
41
+ if (!('end' in value) || value['end'] === undefined) return false;
42
+ return true;
43
+ }
44
+
45
+ export function PeakWindowFromJSON(json: any): PeakWindow {
46
+ return PeakWindowFromJSONTyped(json, false);
47
+ }
48
+
49
+ export function PeakWindowFromJSONTyped(json: any, ignoreDiscriminator: boolean): PeakWindow {
50
+ if (json == null) {
51
+ return json;
52
+ }
53
+ return {
54
+
55
+ 'start': json['start'],
56
+ 'end': json['end'],
57
+ };
58
+ }
59
+
60
+ export function PeakWindowToJSON(json: any): PeakWindow {
61
+ return PeakWindowToJSONTyped(json, false);
62
+ }
63
+
64
+ export function PeakWindowToJSONTyped(value?: PeakWindow | null, ignoreDiscriminator: boolean = false): any {
65
+ if (value == null) {
66
+ return value;
67
+ }
68
+
69
+ return {
70
+
71
+ 'start': value['start'],
72
+ 'end': value['end'],
73
+ };
74
+ }
75
+
@@ -0,0 +1,129 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * GPU.ai Public Developer API
5
+ * Programmatic API for GPU.ai. Authenticate with API keys minted from the dashboard. See https://gpu.ai/docs for details.
6
+ *
7
+ * The version of the OpenAPI document: 1.0.0
8
+ * Contact: support@gpu.ai
9
+ *
10
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
11
+ * https://openapi-generator.tech
12
+ * Do not edit the class manually.
13
+ */
14
+
15
+ import { mapValues } from '../runtime';
16
+ /**
17
+ *
18
+ * @export
19
+ * @interface UpdateBillingDetailsRequest
20
+ */
21
+ export interface UpdateBillingDetailsRequest {
22
+ /**
23
+ *
24
+ * @type {string}
25
+ * @memberof UpdateBillingDetailsRequest
26
+ */
27
+ legalName?: string;
28
+ /**
29
+ *
30
+ * @type {string}
31
+ * @memberof UpdateBillingDetailsRequest
32
+ */
33
+ addressLine1?: string;
34
+ /**
35
+ *
36
+ * @type {string}
37
+ * @memberof UpdateBillingDetailsRequest
38
+ */
39
+ addressLine2?: string;
40
+ /**
41
+ *
42
+ * @type {string}
43
+ * @memberof UpdateBillingDetailsRequest
44
+ */
45
+ city?: string;
46
+ /**
47
+ *
48
+ * @type {string}
49
+ * @memberof UpdateBillingDetailsRequest
50
+ */
51
+ region?: string;
52
+ /**
53
+ *
54
+ * @type {string}
55
+ * @memberof UpdateBillingDetailsRequest
56
+ */
57
+ postalCode?: string;
58
+ /**
59
+ * ISO 3166-1 alpha-2 code; empty clears it.
60
+ * @type {string}
61
+ * @memberof UpdateBillingDetailsRequest
62
+ */
63
+ country?: string;
64
+ /**
65
+ *
66
+ * @type {string}
67
+ * @memberof UpdateBillingDetailsRequest
68
+ */
69
+ taxIdType?: string;
70
+ /**
71
+ * Write only. Stored encrypted and never returned in full. Empty removes the stored Tax ID.
72
+ * @type {string}
73
+ * @memberof UpdateBillingDetailsRequest
74
+ */
75
+ taxId?: string;
76
+ }
77
+
78
+ /**
79
+ * Check if a given object implements the UpdateBillingDetailsRequest interface.
80
+ */
81
+ export function instanceOfUpdateBillingDetailsRequest(value: object): value is UpdateBillingDetailsRequest {
82
+ return true;
83
+ }
84
+
85
+ export function UpdateBillingDetailsRequestFromJSON(json: any): UpdateBillingDetailsRequest {
86
+ return UpdateBillingDetailsRequestFromJSONTyped(json, false);
87
+ }
88
+
89
+ export function UpdateBillingDetailsRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): UpdateBillingDetailsRequest {
90
+ if (json == null) {
91
+ return json;
92
+ }
93
+ return {
94
+
95
+ 'legalName': json['legal_name'] == null ? undefined : json['legal_name'],
96
+ 'addressLine1': json['address_line1'] == null ? undefined : json['address_line1'],
97
+ 'addressLine2': json['address_line2'] == null ? undefined : json['address_line2'],
98
+ 'city': json['city'] == null ? undefined : json['city'],
99
+ 'region': json['region'] == null ? undefined : json['region'],
100
+ 'postalCode': json['postal_code'] == null ? undefined : json['postal_code'],
101
+ 'country': json['country'] == null ? undefined : json['country'],
102
+ 'taxIdType': json['tax_id_type'] == null ? undefined : json['tax_id_type'],
103
+ 'taxId': json['tax_id'] == null ? undefined : json['tax_id'],
104
+ };
105
+ }
106
+
107
+ export function UpdateBillingDetailsRequestToJSON(json: any): UpdateBillingDetailsRequest {
108
+ return UpdateBillingDetailsRequestToJSONTyped(json, false);
109
+ }
110
+
111
+ export function UpdateBillingDetailsRequestToJSONTyped(value?: UpdateBillingDetailsRequest | null, ignoreDiscriminator: boolean = false): any {
112
+ if (value == null) {
113
+ return value;
114
+ }
115
+
116
+ return {
117
+
118
+ 'legal_name': value['legalName'],
119
+ 'address_line1': value['addressLine1'],
120
+ 'address_line2': value['addressLine2'],
121
+ 'city': value['city'],
122
+ 'region': value['region'],
123
+ 'postal_code': value['postalCode'],
124
+ 'country': value['country'],
125
+ 'tax_id_type': value['taxIdType'],
126
+ 'tax_id': value['taxId'],
127
+ };
128
+ }
129
+
@@ -5,6 +5,7 @@ export * from './AutolaunchRuleCreate';
5
5
  export * from './AutolaunchRuleDisarm';
6
6
  export * from './AutolaunchRulePage';
7
7
  export * from './Balance';
8
+ export * from './BillingDetails';
8
9
  export * from './ChatChoice';
9
10
  export * from './ChatCompletionRequest';
10
11
  export * from './ChatCompletionResponse';
@@ -18,6 +19,9 @@ export * from './CreateFineTuningJobRequest';
18
19
  export * from './CreateFineTuningJobRequestGpuai';
19
20
  export * from './CreateFineTuningJobRequestMethod';
20
21
  export * from './CreateFineTuningJobRequestMethodLora';
22
+ export * from './CreateFunctionRequest';
23
+ export * from './CreateFunctionRunRequest';
24
+ export * from './CreateFunctionVersionRequest';
21
25
  export * from './CreateInstanceRequest';
22
26
  export * from './CreateInstanceRequestPortsInner';
23
27
  export * from './CreateRegistryCredentialRequest';
@@ -38,9 +42,22 @@ export * from './FineTuningJobEventList';
38
42
  export * from './FineTuningJobList';
39
43
  export * from './FineTuningJobMethod';
40
44
  export * from './FrameworkVersion';
45
+ export * from './Function';
46
+ export * from './FunctionList';
47
+ export * from './FunctionReplicaCounts';
48
+ export * from './FunctionRun';
49
+ export * from './FunctionRunError';
50
+ export * from './FunctionRunList';
51
+ export * from './FunctionRunLogChunk';
52
+ export * from './FunctionRunLogs';
53
+ export * from './FunctionUpload';
54
+ export * from './FunctionVersion';
41
55
  export * from './GPUType';
42
56
  export * from './GPUTypePage';
43
57
  export * from './GetHealth200Response';
58
+ export * from './GpuSuggestion';
59
+ export * from './GpuSuggestionCheaper';
60
+ export * from './GpuSuggestionGpu';
44
61
  export * from './ImagesGenerationsRequest';
45
62
  export * from './ImagesResponse';
46
63
  export * from './ImagesResponseDataInner';
@@ -48,7 +65,10 @@ export * from './ImagesResponseUsage';
48
65
  export * from './IncludeItem';
49
66
  export * from './Instance';
50
67
  export * from './InstanceConnection';
68
+ export * from './InstanceGpuMemory';
51
69
  export * from './InstancePage';
70
+ export * from './Invoice';
71
+ export * from './InvoiceList';
52
72
  export * from './ListCommunityMachines200Response';
53
73
  export * from './ListDeposits200Response';
54
74
  export * from './ListRegistryCredentials200Response';
@@ -58,11 +78,13 @@ export * from './Model';
58
78
  export * from './ModelList';
59
79
  export * from './ModelParametersInner';
60
80
  export * from './ModelPricing';
81
+ export * from './ModelRate';
61
82
  export * from './OpenAIErrorEnvelope';
62
83
  export * from './OpenAIErrorEnvelopeError';
63
84
  export * from './Operation';
64
85
  export * from './OperationError';
65
86
  export * from './OperationResult';
87
+ export * from './PeakWindow';
66
88
  export * from './Pricing';
67
89
  export * from './PricingPage';
68
90
  export * from './Problem';
@@ -77,6 +99,7 @@ export * from './Template';
77
99
  export * from './TemplateEnvInner';
78
100
  export * from './TemplateList';
79
101
  export * from './TemplatePortsInner';
102
+ export * from './UpdateBillingDetailsRequest';
80
103
  export * from './UpdateInstanceRequest';
81
104
  export * from './UpdateSpendingLimitRequest';
82
105
  export * from './Usage';
package/src/runtime.ts CHANGED
@@ -75,7 +75,7 @@ export class Configuration {
75
75
  }
76
76
 
77
77
  get headers(): HTTPHeaders | undefined {
78
- return this.configuration.headers;
78
+ return { 'User-Agent': 'gpuai-sdk-ts/0.4.1', ...this.configuration.headers };
79
79
  }
80
80
 
81
81
  get credentials(): RequestCredentials | undefined {