@gpuai/sdk 0.5.4 → 0.5.6

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 (202) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/EndpointsApi.d.ts +150 -0
  4. package/dist/apis/EndpointsApi.js +379 -0
  5. package/dist/apis/InstancesApi.d.ts +15 -0
  6. package/dist/apis/InstancesApi.js +45 -0
  7. package/dist/apis/JobsApi.d.ts +172 -0
  8. package/dist/apis/JobsApi.js +444 -0
  9. package/dist/apis/OperationsApi.d.ts +17 -0
  10. package/dist/apis/OperationsApi.js +48 -0
  11. package/dist/apis/SecretsApi.d.ts +123 -0
  12. package/dist/apis/SecretsApi.js +328 -0
  13. package/dist/apis/index.d.ts +3 -0
  14. package/dist/apis/index.js +3 -0
  15. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  16. package/dist/esm/apis/EndpointsApi.js +375 -0
  17. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  18. package/dist/esm/apis/InstancesApi.js +45 -0
  19. package/dist/esm/apis/JobsApi.d.ts +172 -0
  20. package/dist/esm/apis/JobsApi.js +440 -0
  21. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  22. package/dist/esm/apis/OperationsApi.js +48 -0
  23. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  24. package/dist/esm/apis/SecretsApi.js +324 -0
  25. package/dist/esm/apis/index.d.ts +3 -0
  26. package/dist/esm/apis/index.js +3 -0
  27. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  28. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  29. package/dist/esm/models/Endpoint.d.ts +147 -0
  30. package/dist/esm/models/Endpoint.js +121 -0
  31. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  32. package/dist/esm/models/EndpointCreate.js +63 -0
  33. package/dist/esm/models/EndpointList.d.ts +33 -0
  34. package/dist/esm/models/EndpointList.js +44 -0
  35. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  36. package/dist/esm/models/EndpointMachine.js +84 -0
  37. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  38. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  39. package/dist/esm/models/Job.d.ts +352 -0
  40. package/dist/esm/models/Job.js +254 -0
  41. package/dist/esm/models/JobAttempt.d.ts +176 -0
  42. package/dist/esm/models/JobAttempt.js +147 -0
  43. package/dist/esm/models/JobCreate.d.ts +153 -0
  44. package/dist/esm/models/JobCreate.js +84 -0
  45. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  46. package/dist/esm/models/JobGpuTypes.js +48 -0
  47. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  48. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  49. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  50. package/dist/esm/models/JobLogChunk.js +55 -0
  51. package/dist/esm/models/JobLogs.d.ts +39 -0
  52. package/dist/esm/models/JobLogs.js +48 -0
  53. package/dist/esm/models/JobPage.d.ts +39 -0
  54. package/dist/esm/models/JobPage.js +48 -0
  55. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  56. package/dist/esm/models/JobSharingHint.js +51 -0
  57. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  58. package/dist/esm/models/JobTelemetry.js +56 -0
  59. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  60. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  61. package/dist/esm/models/JobTrial.d.ts +79 -0
  62. package/dist/esm/models/JobTrial.js +73 -0
  63. package/dist/esm/models/Operation.d.ts +6 -0
  64. package/dist/esm/models/Operation.js +2 -0
  65. package/dist/esm/models/Secret.d.ts +62 -0
  66. package/dist/esm/models/Secret.js +63 -0
  67. package/dist/esm/models/SecretCreate.d.ts +44 -0
  68. package/dist/esm/models/SecretCreate.js +49 -0
  69. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  70. package/dist/esm/models/SecretImportItem.js +47 -0
  71. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  72. package/dist/esm/models/SecretImportRequest.js +46 -0
  73. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  74. package/dist/esm/models/SecretImportResult.js +51 -0
  75. package/dist/esm/models/SecretList.d.ts +33 -0
  76. package/dist/esm/models/SecretList.js +44 -0
  77. package/dist/esm/models/SecretPut.d.ts +38 -0
  78. package/dist/esm/models/SecretPut.js +45 -0
  79. package/dist/esm/models/index.d.ts +25 -0
  80. package/dist/esm/models/index.js +25 -0
  81. package/dist/esm/runtime.js +1 -1
  82. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  83. package/dist/models/DedicatedIPOffer.js +94 -0
  84. package/dist/models/Endpoint.d.ts +147 -0
  85. package/dist/models/Endpoint.js +129 -0
  86. package/dist/models/EndpointCreate.d.ts +80 -0
  87. package/dist/models/EndpointCreate.js +70 -0
  88. package/dist/models/EndpointList.d.ts +33 -0
  89. package/dist/models/EndpointList.js +51 -0
  90. package/dist/models/EndpointMachine.d.ts +90 -0
  91. package/dist/models/EndpointMachine.js +92 -0
  92. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  93. package/dist/models/EndpointReplicaCounts.js +54 -0
  94. package/dist/models/Job.d.ts +352 -0
  95. package/dist/models/Job.js +262 -0
  96. package/dist/models/JobAttempt.d.ts +176 -0
  97. package/dist/models/JobAttempt.js +155 -0
  98. package/dist/models/JobCreate.d.ts +153 -0
  99. package/dist/models/JobCreate.js +92 -0
  100. package/dist/models/JobGpuTypes.d.ts +39 -0
  101. package/dist/models/JobGpuTypes.js +55 -0
  102. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  103. package/dist/models/JobGpuTypesDataInner.js +66 -0
  104. package/dist/models/JobLogChunk.d.ts +50 -0
  105. package/dist/models/JobLogChunk.js +62 -0
  106. package/dist/models/JobLogs.d.ts +39 -0
  107. package/dist/models/JobLogs.js +55 -0
  108. package/dist/models/JobPage.d.ts +39 -0
  109. package/dist/models/JobPage.js +55 -0
  110. package/dist/models/JobSharingHint.d.ts +46 -0
  111. package/dist/models/JobSharingHint.js +58 -0
  112. package/dist/models/JobTelemetry.d.ts +51 -0
  113. package/dist/models/JobTelemetry.js +63 -0
  114. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  115. package/dist/models/JobTelemetryPoint.js +66 -0
  116. package/dist/models/JobTrial.d.ts +79 -0
  117. package/dist/models/JobTrial.js +81 -0
  118. package/dist/models/Operation.d.ts +6 -0
  119. package/dist/models/Operation.js +2 -0
  120. package/dist/models/Secret.d.ts +62 -0
  121. package/dist/models/Secret.js +70 -0
  122. package/dist/models/SecretCreate.d.ts +44 -0
  123. package/dist/models/SecretCreate.js +56 -0
  124. package/dist/models/SecretImportItem.d.ts +38 -0
  125. package/dist/models/SecretImportItem.js +54 -0
  126. package/dist/models/SecretImportRequest.d.ts +39 -0
  127. package/dist/models/SecretImportRequest.js +53 -0
  128. package/dist/models/SecretImportResult.d.ts +44 -0
  129. package/dist/models/SecretImportResult.js +58 -0
  130. package/dist/models/SecretList.d.ts +33 -0
  131. package/dist/models/SecretList.js +51 -0
  132. package/dist/models/SecretPut.d.ts +38 -0
  133. package/dist/models/SecretPut.js +52 -0
  134. package/dist/models/index.d.ts +25 -0
  135. package/dist/models/index.js +25 -0
  136. package/dist/runtime.js +1 -1
  137. package/docs/DedicatedIPOffer.md +56 -0
  138. package/docs/Endpoint.md +68 -0
  139. package/docs/EndpointCreate.md +50 -0
  140. package/docs/EndpointList.md +34 -0
  141. package/docs/EndpointMachine.md +50 -0
  142. package/docs/EndpointReplicaCounts.md +36 -0
  143. package/docs/EndpointsApi.md +544 -0
  144. package/docs/InstancesApi.md +68 -1
  145. package/docs/Job.md +125 -0
  146. package/docs/JobAttempt.md +69 -0
  147. package/docs/JobCreate.md +66 -0
  148. package/docs/JobGpuTypes.md +36 -0
  149. package/docs/JobGpuTypesDataInner.md +42 -0
  150. package/docs/JobLogChunk.md +40 -0
  151. package/docs/JobLogs.md +36 -0
  152. package/docs/JobPage.md +36 -0
  153. package/docs/JobSharingHint.md +39 -0
  154. package/docs/JobTelemetry.md +40 -0
  155. package/docs/JobTelemetryPoint.md +42 -0
  156. package/docs/JobTrial.md +46 -0
  157. package/docs/JobsApi.md +609 -0
  158. package/docs/Operation.md +2 -0
  159. package/docs/OperationsApi.md +76 -0
  160. package/docs/Secret.md +45 -0
  161. package/docs/SecretCreate.md +38 -0
  162. package/docs/SecretImportItem.md +36 -0
  163. package/docs/SecretImportRequest.md +36 -0
  164. package/docs/SecretImportResult.md +38 -0
  165. package/docs/SecretList.md +34 -0
  166. package/docs/SecretPut.md +36 -0
  167. package/docs/SecretsApi.md +450 -0
  168. package/package.json +1 -1
  169. package/src/apis/EndpointsApi.ts +481 -0
  170. package/src/apis/InstancesApi.ts +52 -0
  171. package/src/apis/JobsApi.ts +551 -0
  172. package/src/apis/OperationsApi.ts +59 -0
  173. package/src/apis/SecretsApi.ts +413 -0
  174. package/src/apis/index.ts +3 -0
  175. package/src/models/DedicatedIPOffer.ts +165 -0
  176. package/src/models/Endpoint.ts +247 -0
  177. package/src/models/EndpointCreate.ts +132 -0
  178. package/src/models/EndpointList.ts +74 -0
  179. package/src/models/EndpointMachine.ts +151 -0
  180. package/src/models/EndpointReplicaCounts.ts +75 -0
  181. package/src/models/Job.ts +538 -0
  182. package/src/models/JobAttempt.ts +267 -0
  183. package/src/models/JobCreate.ts +221 -0
  184. package/src/models/JobGpuTypes.ts +83 -0
  185. package/src/models/JobGpuTypesDataInner.ts +104 -0
  186. package/src/models/JobLogChunk.ts +93 -0
  187. package/src/models/JobLogs.ts +83 -0
  188. package/src/models/JobPage.ts +83 -0
  189. package/src/models/JobSharingHint.ts +86 -0
  190. package/src/models/JobTelemetry.ts +101 -0
  191. package/src/models/JobTelemetryPoint.ts +102 -0
  192. package/src/models/JobTrial.ts +132 -0
  193. package/src/models/Operation.ts +8 -0
  194. package/src/models/Secret.ts +111 -0
  195. package/src/models/SecretCreate.ts +83 -0
  196. package/src/models/SecretImportItem.ts +75 -0
  197. package/src/models/SecretImportRequest.ts +82 -0
  198. package/src/models/SecretImportResult.ts +84 -0
  199. package/src/models/SecretList.ts +74 -0
  200. package/src/models/SecretPut.ts +74 -0
  201. package/src/models/index.ts +25 -0
  202. package/src/runtime.ts +1 -1
@@ -0,0 +1,481 @@
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 * as runtime from '../runtime';
16
+ import {
17
+ type ChatCompletionRequest,
18
+ ChatCompletionRequestFromJSON,
19
+ ChatCompletionRequestToJSON,
20
+ } from '../models/ChatCompletionRequest';
21
+ import {
22
+ type ChatCompletionResponse,
23
+ ChatCompletionResponseFromJSON,
24
+ ChatCompletionResponseToJSON,
25
+ } from '../models/ChatCompletionResponse';
26
+ import {
27
+ type Endpoint,
28
+ EndpointFromJSON,
29
+ EndpointToJSON,
30
+ } from '../models/Endpoint';
31
+ import {
32
+ type EndpointCreate,
33
+ EndpointCreateFromJSON,
34
+ EndpointCreateToJSON,
35
+ } from '../models/EndpointCreate';
36
+ import {
37
+ type EndpointList,
38
+ EndpointListFromJSON,
39
+ EndpointListToJSON,
40
+ } from '../models/EndpointList';
41
+ import {
42
+ type OpenAIErrorEnvelope,
43
+ OpenAIErrorEnvelopeFromJSON,
44
+ OpenAIErrorEnvelopeToJSON,
45
+ } from '../models/OpenAIErrorEnvelope';
46
+ import {
47
+ type Problem,
48
+ ProblemFromJSON,
49
+ ProblemToJSON,
50
+ } from '../models/Problem';
51
+
52
+ export interface CreateEndpointRequest {
53
+ endpointCreate: EndpointCreate;
54
+ }
55
+
56
+ export interface CreateEndpointChatCompletionRequest {
57
+ id: string;
58
+ chatCompletionRequest: ChatCompletionRequest;
59
+ }
60
+
61
+ export interface CreateEndpointCompletionRequest {
62
+ id: string;
63
+ requestBody: { [key: string]: any | null; };
64
+ }
65
+
66
+ export interface DeleteEndpointRequest {
67
+ id: string;
68
+ }
69
+
70
+ export interface GetEndpointRequest {
71
+ id: string;
72
+ }
73
+
74
+ export interface ListEndpointModelsRequest {
75
+ id: string;
76
+ }
77
+
78
+ /**
79
+ *
80
+ */
81
+ export class EndpointsApi extends runtime.BaseAPI {
82
+
83
+ /**
84
+ * Creates request options for createEndpoint without sending the request
85
+ */
86
+ async createEndpointRequestOpts(requestParameters: CreateEndpointRequest): Promise<runtime.RequestOpts> {
87
+ if (requestParameters['endpointCreate'] == null) {
88
+ throw new runtime.RequiredError(
89
+ 'endpointCreate',
90
+ 'Required parameter "endpointCreate" was null or undefined when calling createEndpoint().'
91
+ );
92
+ }
93
+
94
+ const queryParameters: any = {};
95
+
96
+ const headerParameters: runtime.HTTPHeaders = {};
97
+
98
+ headerParameters['Content-Type'] = 'application/json';
99
+
100
+ if (this.configuration && this.configuration.accessToken) {
101
+ const token = this.configuration.accessToken;
102
+ const tokenString = await token("bearerAuth", []);
103
+
104
+ if (tokenString) {
105
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
106
+ }
107
+ }
108
+
109
+ let urlPath = `/endpoints`;
110
+
111
+ return {
112
+ path: urlPath,
113
+ method: 'POST',
114
+ headers: headerParameters,
115
+ query: queryParameters,
116
+ body: EndpointCreateToJSON(requestParameters['endpointCreate']),
117
+ };
118
+ }
119
+
120
+ /**
121
+ * Creates an OpenAI-compatible endpoint serving a Hugging Face model with vLLM on the chosen GPU type. Nothing starts until the first request arrives, unless `min_replicas` keeps machines warm. Each machine is billed for the time it exists, like an instance, through the same balance. For a gated model, store a Hugging Face token as a secret and name it in `hf_token_secret`; it reaches the machines as HF_TOKEN. Returns 422 `validation_failed` for a bad field, 409 `name_taken` for a duplicate name, and 409 `limit_reached` at the per-organization cap. Requires the `functions:write` scope.
122
+ * Create a model endpoint
123
+ */
124
+ async createEndpointRaw(requestParameters: CreateEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Endpoint>> {
125
+ const requestOptions = await this.createEndpointRequestOpts(requestParameters);
126
+ const response = await this.request(requestOptions, initOverrides);
127
+
128
+ return new runtime.JSONApiResponse(response, (jsonValue) => EndpointFromJSON(jsonValue));
129
+ }
130
+
131
+ /**
132
+ * Creates an OpenAI-compatible endpoint serving a Hugging Face model with vLLM on the chosen GPU type. Nothing starts until the first request arrives, unless `min_replicas` keeps machines warm. Each machine is billed for the time it exists, like an instance, through the same balance. For a gated model, store a Hugging Face token as a secret and name it in `hf_token_secret`; it reaches the machines as HF_TOKEN. Returns 422 `validation_failed` for a bad field, 409 `name_taken` for a duplicate name, and 409 `limit_reached` at the per-organization cap. Requires the `functions:write` scope.
133
+ * Create a model endpoint
134
+ */
135
+ async createEndpoint(requestParameters: CreateEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Endpoint> {
136
+ const response = await this.createEndpointRaw(requestParameters, initOverrides);
137
+ return await response.value();
138
+ }
139
+
140
+ /**
141
+ * Creates request options for createEndpointChatCompletion without sending the request
142
+ */
143
+ async createEndpointChatCompletionRequestOpts(requestParameters: CreateEndpointChatCompletionRequest): Promise<runtime.RequestOpts> {
144
+ if (requestParameters['id'] == null) {
145
+ throw new runtime.RequiredError(
146
+ 'id',
147
+ 'Required parameter "id" was null or undefined when calling createEndpointChatCompletion().'
148
+ );
149
+ }
150
+
151
+ if (requestParameters['chatCompletionRequest'] == null) {
152
+ throw new runtime.RequiredError(
153
+ 'chatCompletionRequest',
154
+ 'Required parameter "chatCompletionRequest" was null or undefined when calling createEndpointChatCompletion().'
155
+ );
156
+ }
157
+
158
+ const queryParameters: any = {};
159
+
160
+ const headerParameters: runtime.HTTPHeaders = {};
161
+
162
+ headerParameters['Content-Type'] = 'application/json';
163
+
164
+ if (this.configuration && this.configuration.accessToken) {
165
+ const token = this.configuration.accessToken;
166
+ const tokenString = await token("bearerAuth", []);
167
+
168
+ if (tokenString) {
169
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
170
+ }
171
+ }
172
+
173
+ let urlPath = `/endpoints/{id}/openai/v1/chat/completions`;
174
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
175
+
176
+ return {
177
+ path: urlPath,
178
+ method: 'POST',
179
+ headers: headerParameters,
180
+ query: queryParameters,
181
+ body: ChatCompletionRequestToJSON(requestParameters['chatCompletionRequest']),
182
+ };
183
+ }
184
+
185
+ /**
186
+ * The OpenAI chat completions route of one endpoint: point an OpenAI client\'s base_url at the endpoint\'s `url` and use a GPU.ai API key with the `functions:write` scope. The request\'s `model` is replaced with the endpoint\'s model, so any value works. Set `\"stream\": true` for Server-Sent Events, passed through as vLLM produces them. When no machine is ready the request waits while one starts (a cold start takes minutes: machine, image and model download); if none is ready in time the answer is 503 `endpoint_starting` with Retry-After. 402 `insufficient_quota` when the balance is empty. Errors use the OpenAI error envelope.
187
+ * Chat completion on a model endpoint (OpenAI-compatible)
188
+ */
189
+ async createEndpointChatCompletionRaw(requestParameters: CreateEndpointChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<ChatCompletionResponse>> {
190
+ const requestOptions = await this.createEndpointChatCompletionRequestOpts(requestParameters);
191
+ const response = await this.request(requestOptions, initOverrides);
192
+
193
+ return new runtime.JSONApiResponse(response, (jsonValue) => ChatCompletionResponseFromJSON(jsonValue));
194
+ }
195
+
196
+ /**
197
+ * The OpenAI chat completions route of one endpoint: point an OpenAI client\'s base_url at the endpoint\'s `url` and use a GPU.ai API key with the `functions:write` scope. The request\'s `model` is replaced with the endpoint\'s model, so any value works. Set `\"stream\": true` for Server-Sent Events, passed through as vLLM produces them. When no machine is ready the request waits while one starts (a cold start takes minutes: machine, image and model download); if none is ready in time the answer is 503 `endpoint_starting` with Retry-After. 402 `insufficient_quota` when the balance is empty. Errors use the OpenAI error envelope.
198
+ * Chat completion on a model endpoint (OpenAI-compatible)
199
+ */
200
+ async createEndpointChatCompletion(requestParameters: CreateEndpointChatCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<ChatCompletionResponse> {
201
+ const response = await this.createEndpointChatCompletionRaw(requestParameters, initOverrides);
202
+ return await response.value();
203
+ }
204
+
205
+ /**
206
+ * Creates request options for createEndpointCompletion without sending the request
207
+ */
208
+ async createEndpointCompletionRequestOpts(requestParameters: CreateEndpointCompletionRequest): Promise<runtime.RequestOpts> {
209
+ if (requestParameters['id'] == null) {
210
+ throw new runtime.RequiredError(
211
+ 'id',
212
+ 'Required parameter "id" was null or undefined when calling createEndpointCompletion().'
213
+ );
214
+ }
215
+
216
+ if (requestParameters['requestBody'] == null) {
217
+ throw new runtime.RequiredError(
218
+ 'requestBody',
219
+ 'Required parameter "requestBody" was null or undefined when calling createEndpointCompletion().'
220
+ );
221
+ }
222
+
223
+ const queryParameters: any = {};
224
+
225
+ const headerParameters: runtime.HTTPHeaders = {};
226
+
227
+ headerParameters['Content-Type'] = 'application/json';
228
+
229
+ if (this.configuration && this.configuration.accessToken) {
230
+ const token = this.configuration.accessToken;
231
+ const tokenString = await token("bearerAuth", []);
232
+
233
+ if (tokenString) {
234
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
235
+ }
236
+ }
237
+
238
+ let urlPath = `/endpoints/{id}/openai/v1/completions`;
239
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
240
+
241
+ return {
242
+ path: urlPath,
243
+ method: 'POST',
244
+ headers: headerParameters,
245
+ query: queryParameters,
246
+ body: requestParameters['requestBody'],
247
+ };
248
+ }
249
+
250
+ /**
251
+ * The OpenAI completions route of one endpoint, with the same auth, model rewrite, streaming, cold start and error behavior as chat completions.
252
+ * Text completion on a model endpoint (OpenAI-compatible)
253
+ */
254
+ async createEndpointCompletionRaw(requestParameters: CreateEndpointCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
255
+ const requestOptions = await this.createEndpointCompletionRequestOpts(requestParameters);
256
+ const response = await this.request(requestOptions, initOverrides);
257
+
258
+ return new runtime.JSONApiResponse<any>(response);
259
+ }
260
+
261
+ /**
262
+ * The OpenAI completions route of one endpoint, with the same auth, model rewrite, streaming, cold start and error behavior as chat completions.
263
+ * Text completion on a model endpoint (OpenAI-compatible)
264
+ */
265
+ async createEndpointCompletion(requestParameters: CreateEndpointCompletionRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
266
+ const response = await this.createEndpointCompletionRaw(requestParameters, initOverrides);
267
+ return await response.value();
268
+ }
269
+
270
+ /**
271
+ * Creates request options for deleteEndpoint without sending the request
272
+ */
273
+ async deleteEndpointRequestOpts(requestParameters: DeleteEndpointRequest): Promise<runtime.RequestOpts> {
274
+ if (requestParameters['id'] == null) {
275
+ throw new runtime.RequiredError(
276
+ 'id',
277
+ 'Required parameter "id" was null or undefined when calling deleteEndpoint().'
278
+ );
279
+ }
280
+
281
+ const queryParameters: any = {};
282
+
283
+ const headerParameters: runtime.HTTPHeaders = {};
284
+
285
+ if (this.configuration && this.configuration.accessToken) {
286
+ const token = this.configuration.accessToken;
287
+ const tokenString = await token("bearerAuth", []);
288
+
289
+ if (tokenString) {
290
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
291
+ }
292
+ }
293
+
294
+ let urlPath = `/endpoints/{id}`;
295
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
296
+
297
+ return {
298
+ path: urlPath,
299
+ method: 'DELETE',
300
+ headers: headerParameters,
301
+ query: queryParameters,
302
+ };
303
+ }
304
+
305
+ /**
306
+ * Deletes the endpoint. Its machines are released within seconds and stop billing when terminated. Requires the `functions:write` scope.
307
+ * Delete a model endpoint
308
+ */
309
+ async deleteEndpointRaw(requestParameters: DeleteEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<void>> {
310
+ const requestOptions = await this.deleteEndpointRequestOpts(requestParameters);
311
+ const response = await this.request(requestOptions, initOverrides);
312
+
313
+ return new runtime.VoidApiResponse(response);
314
+ }
315
+
316
+ /**
317
+ * Deletes the endpoint. Its machines are released within seconds and stop billing when terminated. Requires the `functions:write` scope.
318
+ * Delete a model endpoint
319
+ */
320
+ async deleteEndpoint(requestParameters: DeleteEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<void> {
321
+ await this.deleteEndpointRaw(requestParameters, initOverrides);
322
+ }
323
+
324
+ /**
325
+ * Creates request options for getEndpoint without sending the request
326
+ */
327
+ async getEndpointRequestOpts(requestParameters: GetEndpointRequest): Promise<runtime.RequestOpts> {
328
+ if (requestParameters['id'] == null) {
329
+ throw new runtime.RequiredError(
330
+ 'id',
331
+ 'Required parameter "id" was null or undefined when calling getEndpoint().'
332
+ );
333
+ }
334
+
335
+ const queryParameters: any = {};
336
+
337
+ const headerParameters: runtime.HTTPHeaders = {};
338
+
339
+ if (this.configuration && this.configuration.accessToken) {
340
+ const token = this.configuration.accessToken;
341
+ const tokenString = await token("bearerAuth", []);
342
+
343
+ if (tokenString) {
344
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
345
+ }
346
+ }
347
+
348
+ let urlPath = `/endpoints/{id}`;
349
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
350
+
351
+ return {
352
+ path: urlPath,
353
+ method: 'GET',
354
+ headers: headerParameters,
355
+ query: queryParameters,
356
+ };
357
+ }
358
+
359
+ /**
360
+ * Returns one endpoint with its recent machines (newest first), each with its price, ready and terminated times, and why it was released. Requires the `functions:read` scope.
361
+ * Get a model endpoint
362
+ */
363
+ async getEndpointRaw(requestParameters: GetEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<Endpoint>> {
364
+ const requestOptions = await this.getEndpointRequestOpts(requestParameters);
365
+ const response = await this.request(requestOptions, initOverrides);
366
+
367
+ return new runtime.JSONApiResponse(response, (jsonValue) => EndpointFromJSON(jsonValue));
368
+ }
369
+
370
+ /**
371
+ * Returns one endpoint with its recent machines (newest first), each with its price, ready and terminated times, and why it was released. Requires the `functions:read` scope.
372
+ * Get a model endpoint
373
+ */
374
+ async getEndpoint(requestParameters: GetEndpointRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<Endpoint> {
375
+ const response = await this.getEndpointRaw(requestParameters, initOverrides);
376
+ return await response.value();
377
+ }
378
+
379
+ /**
380
+ * Creates request options for listEndpointModels without sending the request
381
+ */
382
+ async listEndpointModelsRequestOpts(requestParameters: ListEndpointModelsRequest): Promise<runtime.RequestOpts> {
383
+ if (requestParameters['id'] == null) {
384
+ throw new runtime.RequiredError(
385
+ 'id',
386
+ 'Required parameter "id" was null or undefined when calling listEndpointModels().'
387
+ );
388
+ }
389
+
390
+ const queryParameters: any = {};
391
+
392
+ const headerParameters: runtime.HTTPHeaders = {};
393
+
394
+ if (this.configuration && this.configuration.accessToken) {
395
+ const token = this.configuration.accessToken;
396
+ const tokenString = await token("bearerAuth", []);
397
+
398
+ if (tokenString) {
399
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
400
+ }
401
+ }
402
+
403
+ let urlPath = `/endpoints/{id}/openai/v1/models`;
404
+ urlPath = urlPath.replace('{id}', encodeURIComponent(String(requestParameters['id'])));
405
+
406
+ return {
407
+ path: urlPath,
408
+ method: 'GET',
409
+ headers: headerParameters,
410
+ query: queryParameters,
411
+ };
412
+ }
413
+
414
+ /**
415
+ * The OpenAI models route of one endpoint: the one model it serves. Can trigger a cold start like any other request.
416
+ * List the model an endpoint serves (OpenAI-compatible)
417
+ */
418
+ async listEndpointModelsRaw(requestParameters: ListEndpointModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<{ [key: string]: any; }>> {
419
+ const requestOptions = await this.listEndpointModelsRequestOpts(requestParameters);
420
+ const response = await this.request(requestOptions, initOverrides);
421
+
422
+ return new runtime.JSONApiResponse<any>(response);
423
+ }
424
+
425
+ /**
426
+ * The OpenAI models route of one endpoint: the one model it serves. Can trigger a cold start like any other request.
427
+ * List the model an endpoint serves (OpenAI-compatible)
428
+ */
429
+ async listEndpointModels(requestParameters: ListEndpointModelsRequest, initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<{ [key: string]: any; }> {
430
+ const response = await this.listEndpointModelsRaw(requestParameters, initOverrides);
431
+ return await response.value();
432
+ }
433
+
434
+ /**
435
+ * Creates request options for listEndpoints without sending the request
436
+ */
437
+ async listEndpointsRequestOpts(): Promise<runtime.RequestOpts> {
438
+ const queryParameters: any = {};
439
+
440
+ const headerParameters: runtime.HTTPHeaders = {};
441
+
442
+ if (this.configuration && this.configuration.accessToken) {
443
+ const token = this.configuration.accessToken;
444
+ const tokenString = await token("bearerAuth", []);
445
+
446
+ if (tokenString) {
447
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
448
+ }
449
+ }
450
+
451
+ let urlPath = `/endpoints`;
452
+
453
+ return {
454
+ path: urlPath,
455
+ method: 'GET',
456
+ headers: headerParameters,
457
+ query: queryParameters,
458
+ };
459
+ }
460
+
461
+ /**
462
+ * Lists the organization\'s live model endpoints with their status, URL and machine counts. Requires the `functions:read` scope.
463
+ * List model endpoints
464
+ */
465
+ async listEndpointsRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<EndpointList>> {
466
+ const requestOptions = await this.listEndpointsRequestOpts();
467
+ const response = await this.request(requestOptions, initOverrides);
468
+
469
+ return new runtime.JSONApiResponse(response, (jsonValue) => EndpointListFromJSON(jsonValue));
470
+ }
471
+
472
+ /**
473
+ * Lists the organization\'s live model endpoints with their status, URL and machine counts. Requires the `functions:read` scope.
474
+ * List model endpoints
475
+ */
476
+ async listEndpoints(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<EndpointList> {
477
+ const response = await this.listEndpointsRaw(initOverrides);
478
+ return await response.value();
479
+ }
480
+
481
+ }
@@ -18,6 +18,11 @@ import {
18
18
  CreateInstanceRequestFromJSON,
19
19
  CreateInstanceRequestToJSON,
20
20
  } from '../models/CreateInstanceRequest';
21
+ import {
22
+ type DedicatedIPOffer,
23
+ DedicatedIPOfferFromJSON,
24
+ DedicatedIPOfferToJSON,
25
+ } from '../models/DedicatedIPOffer';
21
26
  import {
22
27
  type GpuSuggestion,
23
28
  GpuSuggestionFromJSON,
@@ -205,6 +210,53 @@ export class InstancesApi extends runtime.BaseAPI {
205
210
  return await response.value();
206
211
  }
207
212
 
213
+ /**
214
+ * Creates request options for getDedicatedIpOffer without sending the request
215
+ */
216
+ async getDedicatedIpOfferRequestOpts(): Promise<runtime.RequestOpts> {
217
+ const queryParameters: any = {};
218
+
219
+ const headerParameters: runtime.HTTPHeaders = {};
220
+
221
+ if (this.configuration && this.configuration.accessToken) {
222
+ const token = this.configuration.accessToken;
223
+ const tokenString = await token("bearerAuth", []);
224
+
225
+ if (tokenString) {
226
+ headerParameters["Authorization"] = `Bearer ${tokenString}`;
227
+ }
228
+ }
229
+
230
+ let urlPath = `/dedicated-ip`;
231
+
232
+ return {
233
+ path: urlPath,
234
+ method: 'GET',
235
+ headers: headerParameters,
236
+ query: queryParameters,
237
+ };
238
+ }
239
+
240
+ /**
241
+ * Describes the dedicated public IPv4 add-on for instances and the caller\'s usage of it. A dedicated IP is a GPU.ai-owned public address (never the supplier\'s) that forwards the chosen inbound TCP ports, raw and without TLS termination, to the same ports on the instance\'s loopback. Request one at launch with the `dedicated_ip` field on POST /instances. The response carries the hourly fee charged while the address is attached, the transfer price per GB (counted in both directions), the transfer cap per attachment after which forwarding is suspended, the ports a launch may forward, the organization\'s limit and how many it holds, how many addresses are free right now, and the acceptable use policy. Requires the `instances:read` scope. Returns 404 when the add-on is not enabled for this deployment.
242
+ * Get the dedicated public IP add-on offer
243
+ */
244
+ async getDedicatedIpOfferRaw(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<runtime.ApiResponse<DedicatedIPOffer>> {
245
+ const requestOptions = await this.getDedicatedIpOfferRequestOpts();
246
+ const response = await this.request(requestOptions, initOverrides);
247
+
248
+ return new runtime.JSONApiResponse(response, (jsonValue) => DedicatedIPOfferFromJSON(jsonValue));
249
+ }
250
+
251
+ /**
252
+ * Describes the dedicated public IPv4 add-on for instances and the caller\'s usage of it. A dedicated IP is a GPU.ai-owned public address (never the supplier\'s) that forwards the chosen inbound TCP ports, raw and without TLS termination, to the same ports on the instance\'s loopback. Request one at launch with the `dedicated_ip` field on POST /instances. The response carries the hourly fee charged while the address is attached, the transfer price per GB (counted in both directions), the transfer cap per attachment after which forwarding is suspended, the ports a launch may forward, the organization\'s limit and how many it holds, how many addresses are free right now, and the acceptable use policy. Requires the `instances:read` scope. Returns 404 when the add-on is not enabled for this deployment.
253
+ * Get the dedicated public IP add-on offer
254
+ */
255
+ async getDedicatedIpOffer(initOverrides?: RequestInit | runtime.InitOverrideFunction): Promise<DedicatedIPOffer> {
256
+ const response = await this.getDedicatedIpOfferRaw(initOverrides);
257
+ return await response.value();
258
+ }
259
+
208
260
  /**
209
261
  * Creates request options for getInstance without sending the request
210
262
  */