@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,50 @@
1
+
2
+ # EndpointMachine
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `id` | string
10
+ `status` | string
11
+ `instanceId` | string
12
+ `gpuType` | string
13
+ `pricePerHour` | number
14
+ `readyAt` | Date
15
+ `terminatedAt` | Date
16
+ `terminateReason` | string
17
+ `createdAt` | Date
18
+
19
+ ## Example
20
+
21
+ ```typescript
22
+ import type { EndpointMachine } from '@gpuai/sdk'
23
+
24
+ // TODO: Update the object below with actual values
25
+ const example = {
26
+ "id": null,
27
+ "status": null,
28
+ "instanceId": null,
29
+ "gpuType": null,
30
+ "pricePerHour": null,
31
+ "readyAt": null,
32
+ "terminatedAt": null,
33
+ "terminateReason": null,
34
+ "createdAt": null,
35
+ } satisfies EndpointMachine
36
+
37
+ console.log(example)
38
+
39
+ // Convert the instance to a JSON string
40
+ const exampleJSON: string = JSON.stringify(example)
41
+ console.log(exampleJSON)
42
+
43
+ // Parse the JSON string back to an object
44
+ const exampleParsed = JSON.parse(exampleJSON) as EndpointMachine
45
+ console.log(exampleParsed)
46
+ ```
47
+
48
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
49
+
50
+
@@ -0,0 +1,36 @@
1
+
2
+ # EndpointReplicaCounts
3
+
4
+
5
+ ## Properties
6
+
7
+ Name | Type
8
+ ------------ | -------------
9
+ `starting` | number
10
+ `ready` | number
11
+
12
+ ## Example
13
+
14
+ ```typescript
15
+ import type { EndpointReplicaCounts } from '@gpuai/sdk'
16
+
17
+ // TODO: Update the object below with actual values
18
+ const example = {
19
+ "starting": null,
20
+ "ready": null,
21
+ } satisfies EndpointReplicaCounts
22
+
23
+ console.log(example)
24
+
25
+ // Convert the instance to a JSON string
26
+ const exampleJSON: string = JSON.stringify(example)
27
+ console.log(exampleJSON)
28
+
29
+ // Parse the JSON string back to an object
30
+ const exampleParsed = JSON.parse(exampleJSON) as EndpointReplicaCounts
31
+ console.log(exampleParsed)
32
+ ```
33
+
34
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
35
+
36
+
@@ -0,0 +1,544 @@
1
+ # EndpointsApi
2
+
3
+ All URIs are relative to *https://api.gpu.ai/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**createEndpoint**](EndpointsApi.md#createendpoint) | **POST** /endpoints | Create a model endpoint |
8
+ | [**createEndpointChatCompletion**](EndpointsApi.md#createendpointchatcompletion) | **POST** /endpoints/{id}/openai/v1/chat/completions | Chat completion on a model endpoint (OpenAI-compatible) |
9
+ | [**createEndpointCompletion**](EndpointsApi.md#createendpointcompletion) | **POST** /endpoints/{id}/openai/v1/completions | Text completion on a model endpoint (OpenAI-compatible) |
10
+ | [**deleteEndpoint**](EndpointsApi.md#deleteendpoint) | **DELETE** /endpoints/{id} | Delete a model endpoint |
11
+ | [**getEndpoint**](EndpointsApi.md#getendpoint) | **GET** /endpoints/{id} | Get a model endpoint |
12
+ | [**listEndpointModels**](EndpointsApi.md#listendpointmodels) | **GET** /endpoints/{id}/openai/v1/models | List the model an endpoint serves (OpenAI-compatible) |
13
+ | [**listEndpoints**](EndpointsApi.md#listendpoints) | **GET** /endpoints | List model endpoints |
14
+
15
+
16
+
17
+ ## createEndpoint
18
+
19
+ > Endpoint createEndpoint(endpointCreate)
20
+
21
+ Create a model endpoint
22
+
23
+ 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.
24
+
25
+ ### Example
26
+
27
+ ```ts
28
+ import {
29
+ Configuration,
30
+ EndpointsApi,
31
+ } from '@gpuai/sdk';
32
+ import type { CreateEndpointRequest } from '@gpuai/sdk';
33
+
34
+ async function example() {
35
+ console.log("🚀 Testing @gpuai/sdk SDK...");
36
+ const config = new Configuration({
37
+ // Configure HTTP bearer authorization: bearerAuth
38
+ accessToken: "YOUR BEARER TOKEN",
39
+ });
40
+ const api = new EndpointsApi(config);
41
+
42
+ const body = {
43
+ // EndpointCreate
44
+ endpointCreate: ...,
45
+ } satisfies CreateEndpointRequest;
46
+
47
+ try {
48
+ const data = await api.createEndpoint(body);
49
+ console.log(data);
50
+ } catch (error) {
51
+ console.error(error);
52
+ }
53
+ }
54
+
55
+ // Run the test
56
+ example().catch(console.error);
57
+ ```
58
+
59
+ ### Parameters
60
+
61
+
62
+ | Name | Type | Description | Notes |
63
+ |------------- | ------------- | ------------- | -------------|
64
+ | **endpointCreate** | [EndpointCreate](EndpointCreate.md) | | |
65
+
66
+ ### Return type
67
+
68
+ [**Endpoint**](Endpoint.md)
69
+
70
+ ### Authorization
71
+
72
+ [bearerAuth](../README.md#bearerAuth)
73
+
74
+ ### HTTP request headers
75
+
76
+ - **Content-Type**: `application/json`
77
+ - **Accept**: `application/json`, `application/problem+json`
78
+
79
+
80
+ ### HTTP response details
81
+ | Status code | Description | Response headers |
82
+ |-------------|-------------|------------------|
83
+ | **201** | Created. | - |
84
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
85
+ | **0** | Error response (RFC 7807) | - |
86
+
87
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
88
+
89
+
90
+ ## createEndpointChatCompletion
91
+
92
+ > ChatCompletionResponse createEndpointChatCompletion(id, chatCompletionRequest)
93
+
94
+ Chat completion on a model endpoint (OpenAI-compatible)
95
+
96
+ The OpenAI chat completions route of one endpoint: point an OpenAI client\&#39;s base_url at the endpoint\&#39;s &#x60;url&#x60; and use a GPU.ai API key with the &#x60;functions:write&#x60; scope. The request\&#39;s &#x60;model&#x60; is replaced with the endpoint\&#39;s model, so any value works. Set &#x60;\&quot;stream\&quot;: true&#x60; 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 &#x60;endpoint_starting&#x60; with Retry-After. 402 &#x60;insufficient_quota&#x60; when the balance is empty. Errors use the OpenAI error envelope.
97
+
98
+ ### Example
99
+
100
+ ```ts
101
+ import {
102
+ Configuration,
103
+ EndpointsApi,
104
+ } from '@gpuai/sdk';
105
+ import type { CreateEndpointChatCompletionRequest } from '@gpuai/sdk';
106
+
107
+ async function example() {
108
+ console.log("🚀 Testing @gpuai/sdk SDK...");
109
+ const config = new Configuration({
110
+ // Configure HTTP bearer authorization: bearerAuth
111
+ accessToken: "YOUR BEARER TOKEN",
112
+ });
113
+ const api = new EndpointsApi(config);
114
+
115
+ const body = {
116
+ // string | The endpoint\'s id.
117
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
118
+ // ChatCompletionRequest
119
+ chatCompletionRequest: ...,
120
+ } satisfies CreateEndpointChatCompletionRequest;
121
+
122
+ try {
123
+ const data = await api.createEndpointChatCompletion(body);
124
+ console.log(data);
125
+ } catch (error) {
126
+ console.error(error);
127
+ }
128
+ }
129
+
130
+ // Run the test
131
+ example().catch(console.error);
132
+ ```
133
+
134
+ ### Parameters
135
+
136
+
137
+ | Name | Type | Description | Notes |
138
+ |------------- | ------------- | ------------- | -------------|
139
+ | **id** | `string` | The endpoint\&#39;s id. | [Defaults to `undefined`] |
140
+ | **chatCompletionRequest** | [ChatCompletionRequest](ChatCompletionRequest.md) | | |
141
+
142
+ ### Return type
143
+
144
+ [**ChatCompletionResponse**](ChatCompletionResponse.md)
145
+
146
+ ### Authorization
147
+
148
+ [bearerAuth](../README.md#bearerAuth)
149
+
150
+ ### HTTP request headers
151
+
152
+ - **Content-Type**: `application/json`
153
+ - **Accept**: `application/json`, `text/event-stream`
154
+
155
+
156
+ ### HTTP response details
157
+ | Status code | Description | Response headers |
158
+ |-------------|-------------|------------------|
159
+ | **200** | application/json for non-streaming requests; text/event-stream when stream&#x3D;true. | - |
160
+ | **400** | Invalid request (OpenAI error envelope). On inference routes this includes &#x60;zero_data_retention_unavailable&#x60; when zero data retention is required and the model has no zero-data-retention host. | - |
161
+ | **401** | Missing or invalid API key (OpenAI error envelope). | - |
162
+ | **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
163
+ | **403** | API key lacks the required scope (OpenAI error envelope). | - |
164
+ | **404** | Model or resource not found (OpenAI error envelope). | - |
165
+ | **429** | Rate limit exceeded (OpenAI error envelope). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
166
+ | **502** | Internal server error (OpenAI error envelope). | - |
167
+ | **503** | Upstream provider unavailable (OpenAI error envelope). Retry-After header may indicate seconds to wait. Code &#x60;data_retention_check_failed&#x60; means the org zero data retention setting could not be read, so the request was not sent; retry shortly. | * Retry-After - Seconds the client should wait before retrying. <br> |
168
+
169
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
170
+
171
+
172
+ ## createEndpointCompletion
173
+
174
+ > { [key: string]: any; } createEndpointCompletion(id, requestBody)
175
+
176
+ Text completion on a model endpoint (OpenAI-compatible)
177
+
178
+ The OpenAI completions route of one endpoint, with the same auth, model rewrite, streaming, cold start and error behavior as chat completions.
179
+
180
+ ### Example
181
+
182
+ ```ts
183
+ import {
184
+ Configuration,
185
+ EndpointsApi,
186
+ } from '@gpuai/sdk';
187
+ import type { CreateEndpointCompletionRequest } from '@gpuai/sdk';
188
+
189
+ async function example() {
190
+ console.log("🚀 Testing @gpuai/sdk SDK...");
191
+ const config = new Configuration({
192
+ // Configure HTTP bearer authorization: bearerAuth
193
+ accessToken: "YOUR BEARER TOKEN",
194
+ });
195
+ const api = new EndpointsApi(config);
196
+
197
+ const body = {
198
+ // string | The endpoint\'s id.
199
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
200
+ // { [key: string]: any | null; }
201
+ requestBody: Object,
202
+ } satisfies CreateEndpointCompletionRequest;
203
+
204
+ try {
205
+ const data = await api.createEndpointCompletion(body);
206
+ console.log(data);
207
+ } catch (error) {
208
+ console.error(error);
209
+ }
210
+ }
211
+
212
+ // Run the test
213
+ example().catch(console.error);
214
+ ```
215
+
216
+ ### Parameters
217
+
218
+
219
+ | Name | Type | Description | Notes |
220
+ |------------- | ------------- | ------------- | -------------|
221
+ | **id** | `string` | The endpoint\&#39;s id. | [Defaults to `undefined`] |
222
+ | **requestBody** | `{ [key: string]: any | null; }` | | |
223
+
224
+ ### Return type
225
+
226
+ **{ [key: string]: any; }**
227
+
228
+ ### Authorization
229
+
230
+ [bearerAuth](../README.md#bearerAuth)
231
+
232
+ ### HTTP request headers
233
+
234
+ - **Content-Type**: `application/json`
235
+ - **Accept**: `application/json`, `text/event-stream`
236
+
237
+
238
+ ### HTTP response details
239
+ | Status code | Description | Response headers |
240
+ |-------------|-------------|------------------|
241
+ | **200** | application/json for non-streaming requests; text/event-stream when stream&#x3D;true. | - |
242
+ | **400** | Invalid request (OpenAI error envelope). On inference routes this includes &#x60;zero_data_retention_unavailable&#x60; when zero data retention is required and the model has no zero-data-retention host. | - |
243
+ | **401** | Missing or invalid API key (OpenAI error envelope). | - |
244
+ | **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
245
+ | **403** | API key lacks the required scope (OpenAI error envelope). | - |
246
+ | **404** | Model or resource not found (OpenAI error envelope). | - |
247
+ | **429** | Rate limit exceeded (OpenAI error envelope). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
248
+ | **502** | Internal server error (OpenAI error envelope). | - |
249
+ | **503** | Upstream provider unavailable (OpenAI error envelope). Retry-After header may indicate seconds to wait. Code &#x60;data_retention_check_failed&#x60; means the org zero data retention setting could not be read, so the request was not sent; retry shortly. | * Retry-After - Seconds the client should wait before retrying. <br> |
250
+
251
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
252
+
253
+
254
+ ## deleteEndpoint
255
+
256
+ > deleteEndpoint(id)
257
+
258
+ Delete a model endpoint
259
+
260
+ Deletes the endpoint. Its machines are released within seconds and stop billing when terminated. Requires the &#x60;functions:write&#x60; scope.
261
+
262
+ ### Example
263
+
264
+ ```ts
265
+ import {
266
+ Configuration,
267
+ EndpointsApi,
268
+ } from '@gpuai/sdk';
269
+ import type { DeleteEndpointRequest } from '@gpuai/sdk';
270
+
271
+ async function example() {
272
+ console.log("🚀 Testing @gpuai/sdk SDK...");
273
+ const config = new Configuration({
274
+ // Configure HTTP bearer authorization: bearerAuth
275
+ accessToken: "YOUR BEARER TOKEN",
276
+ });
277
+ const api = new EndpointsApi(config);
278
+
279
+ const body = {
280
+ // string | The endpoint\'s id.
281
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
282
+ } satisfies DeleteEndpointRequest;
283
+
284
+ try {
285
+ const data = await api.deleteEndpoint(body);
286
+ console.log(data);
287
+ } catch (error) {
288
+ console.error(error);
289
+ }
290
+ }
291
+
292
+ // Run the test
293
+ example().catch(console.error);
294
+ ```
295
+
296
+ ### Parameters
297
+
298
+
299
+ | Name | Type | Description | Notes |
300
+ |------------- | ------------- | ------------- | -------------|
301
+ | **id** | `string` | The endpoint\&#39;s id. | [Defaults to `undefined`] |
302
+
303
+ ### Return type
304
+
305
+ `void` (Empty response body)
306
+
307
+ ### Authorization
308
+
309
+ [bearerAuth](../README.md#bearerAuth)
310
+
311
+ ### HTTP request headers
312
+
313
+ - **Content-Type**: Not defined
314
+ - **Accept**: `application/problem+json`
315
+
316
+
317
+ ### HTTP response details
318
+ | Status code | Description | Response headers |
319
+ |-------------|-------------|------------------|
320
+ | **204** | Deleted. | - |
321
+ | **404** | Error response (RFC 7807) | - |
322
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
323
+ | **0** | Error response (RFC 7807) | - |
324
+
325
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
326
+
327
+
328
+ ## getEndpoint
329
+
330
+ > Endpoint getEndpoint(id)
331
+
332
+ Get a model endpoint
333
+
334
+ Returns one endpoint with its recent machines (newest first), each with its price, ready and terminated times, and why it was released. Requires the &#x60;functions:read&#x60; scope.
335
+
336
+ ### Example
337
+
338
+ ```ts
339
+ import {
340
+ Configuration,
341
+ EndpointsApi,
342
+ } from '@gpuai/sdk';
343
+ import type { GetEndpointRequest } from '@gpuai/sdk';
344
+
345
+ async function example() {
346
+ console.log("🚀 Testing @gpuai/sdk SDK...");
347
+ const config = new Configuration({
348
+ // Configure HTTP bearer authorization: bearerAuth
349
+ accessToken: "YOUR BEARER TOKEN",
350
+ });
351
+ const api = new EndpointsApi(config);
352
+
353
+ const body = {
354
+ // string | The endpoint\'s id.
355
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
356
+ } satisfies GetEndpointRequest;
357
+
358
+ try {
359
+ const data = await api.getEndpoint(body);
360
+ console.log(data);
361
+ } catch (error) {
362
+ console.error(error);
363
+ }
364
+ }
365
+
366
+ // Run the test
367
+ example().catch(console.error);
368
+ ```
369
+
370
+ ### Parameters
371
+
372
+
373
+ | Name | Type | Description | Notes |
374
+ |------------- | ------------- | ------------- | -------------|
375
+ | **id** | `string` | The endpoint\&#39;s id. | [Defaults to `undefined`] |
376
+
377
+ ### Return type
378
+
379
+ [**Endpoint**](Endpoint.md)
380
+
381
+ ### Authorization
382
+
383
+ [bearerAuth](../README.md#bearerAuth)
384
+
385
+ ### HTTP request headers
386
+
387
+ - **Content-Type**: Not defined
388
+ - **Accept**: `application/json`, `application/problem+json`
389
+
390
+
391
+ ### HTTP response details
392
+ | Status code | Description | Response headers |
393
+ |-------------|-------------|------------------|
394
+ | **200** | The endpoint. | - |
395
+ | **404** | Error response (RFC 7807) | - |
396
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
397
+ | **0** | Error response (RFC 7807) | - |
398
+
399
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
400
+
401
+
402
+ ## listEndpointModels
403
+
404
+ > { [key: string]: any; } listEndpointModels(id)
405
+
406
+ List the model an endpoint serves (OpenAI-compatible)
407
+
408
+ The OpenAI models route of one endpoint: the one model it serves. Can trigger a cold start like any other request.
409
+
410
+ ### Example
411
+
412
+ ```ts
413
+ import {
414
+ Configuration,
415
+ EndpointsApi,
416
+ } from '@gpuai/sdk';
417
+ import type { ListEndpointModelsRequest } from '@gpuai/sdk';
418
+
419
+ async function example() {
420
+ console.log("🚀 Testing @gpuai/sdk SDK...");
421
+ const config = new Configuration({
422
+ // Configure HTTP bearer authorization: bearerAuth
423
+ accessToken: "YOUR BEARER TOKEN",
424
+ });
425
+ const api = new EndpointsApi(config);
426
+
427
+ const body = {
428
+ // string | The endpoint\'s id.
429
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
430
+ } satisfies ListEndpointModelsRequest;
431
+
432
+ try {
433
+ const data = await api.listEndpointModels(body);
434
+ console.log(data);
435
+ } catch (error) {
436
+ console.error(error);
437
+ }
438
+ }
439
+
440
+ // Run the test
441
+ example().catch(console.error);
442
+ ```
443
+
444
+ ### Parameters
445
+
446
+
447
+ | Name | Type | Description | Notes |
448
+ |------------- | ------------- | ------------- | -------------|
449
+ | **id** | `string` | The endpoint\&#39;s id. | [Defaults to `undefined`] |
450
+
451
+ ### Return type
452
+
453
+ **{ [key: string]: any; }**
454
+
455
+ ### Authorization
456
+
457
+ [bearerAuth](../README.md#bearerAuth)
458
+
459
+ ### HTTP request headers
460
+
461
+ - **Content-Type**: Not defined
462
+ - **Accept**: `application/json`
463
+
464
+
465
+ ### HTTP response details
466
+ | Status code | Description | Response headers |
467
+ |-------------|-------------|------------------|
468
+ | **200** | An OpenAI model list. | - |
469
+ | **400** | Invalid request (OpenAI error envelope). On inference routes this includes &#x60;zero_data_retention_unavailable&#x60; when zero data retention is required and the model has no zero-data-retention host. | - |
470
+ | **401** | Missing or invalid API key (OpenAI error envelope). | - |
471
+ | **402** | Insufficient balance (OpenAI error envelope, SERV-06). | - |
472
+ | **403** | API key lacks the required scope (OpenAI error envelope). | - |
473
+ | **404** | Model or resource not found (OpenAI error envelope). | - |
474
+ | **429** | Rate limit exceeded (OpenAI error envelope). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
475
+ | **502** | Internal server error (OpenAI error envelope). | - |
476
+ | **503** | Upstream provider unavailable (OpenAI error envelope). Retry-After header may indicate seconds to wait. Code &#x60;data_retention_check_failed&#x60; means the org zero data retention setting could not be read, so the request was not sent; retry shortly. | * Retry-After - Seconds the client should wait before retrying. <br> |
477
+
478
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
479
+
480
+
481
+ ## listEndpoints
482
+
483
+ > EndpointList listEndpoints()
484
+
485
+ List model endpoints
486
+
487
+ Lists the organization\&#39;s live model endpoints with their status, URL and machine counts. Requires the &#x60;functions:read&#x60; scope.
488
+
489
+ ### Example
490
+
491
+ ```ts
492
+ import {
493
+ Configuration,
494
+ EndpointsApi,
495
+ } from '@gpuai/sdk';
496
+ import type { ListEndpointsRequest } from '@gpuai/sdk';
497
+
498
+ async function example() {
499
+ console.log("🚀 Testing @gpuai/sdk SDK...");
500
+ const config = new Configuration({
501
+ // Configure HTTP bearer authorization: bearerAuth
502
+ accessToken: "YOUR BEARER TOKEN",
503
+ });
504
+ const api = new EndpointsApi(config);
505
+
506
+ try {
507
+ const data = await api.listEndpoints();
508
+ console.log(data);
509
+ } catch (error) {
510
+ console.error(error);
511
+ }
512
+ }
513
+
514
+ // Run the test
515
+ example().catch(console.error);
516
+ ```
517
+
518
+ ### Parameters
519
+
520
+ This endpoint does not need any parameter.
521
+
522
+ ### Return type
523
+
524
+ [**EndpointList**](EndpointList.md)
525
+
526
+ ### Authorization
527
+
528
+ [bearerAuth](../README.md#bearerAuth)
529
+
530
+ ### HTTP request headers
531
+
532
+ - **Content-Type**: Not defined
533
+ - **Accept**: `application/json`, `application/problem+json`
534
+
535
+
536
+ ### HTTP response details
537
+ | Status code | Description | Response headers |
538
+ |-------------|-------------|------------------|
539
+ | **200** | The organization\&#39;s endpoints. | - |
540
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
541
+ | **0** | Error response (RFC 7807) | - |
542
+
543
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
544
+