@gpuai/sdk 0.5.3 → 0.5.5

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 (218) hide show
  1. package/.openapi-generator/FILES +56 -0
  2. package/README.md +50 -2
  3. package/dist/apis/BillingApi.d.ts +2 -2
  4. package/dist/apis/BillingApi.js +2 -2
  5. package/dist/apis/EndpointsApi.d.ts +150 -0
  6. package/dist/apis/EndpointsApi.js +379 -0
  7. package/dist/apis/InstancesApi.d.ts +15 -0
  8. package/dist/apis/InstancesApi.js +45 -0
  9. package/dist/apis/JobsApi.d.ts +172 -0
  10. package/dist/apis/JobsApi.js +444 -0
  11. package/dist/apis/OperationsApi.d.ts +17 -0
  12. package/dist/apis/OperationsApi.js +48 -0
  13. package/dist/apis/SecretsApi.d.ts +123 -0
  14. package/dist/apis/SecretsApi.js +328 -0
  15. package/dist/apis/index.d.ts +3 -0
  16. package/dist/apis/index.js +3 -0
  17. package/dist/esm/apis/BillingApi.d.ts +2 -2
  18. package/dist/esm/apis/BillingApi.js +2 -2
  19. package/dist/esm/apis/EndpointsApi.d.ts +150 -0
  20. package/dist/esm/apis/EndpointsApi.js +375 -0
  21. package/dist/esm/apis/InstancesApi.d.ts +15 -0
  22. package/dist/esm/apis/InstancesApi.js +45 -0
  23. package/dist/esm/apis/JobsApi.d.ts +172 -0
  24. package/dist/esm/apis/JobsApi.js +440 -0
  25. package/dist/esm/apis/OperationsApi.d.ts +17 -0
  26. package/dist/esm/apis/OperationsApi.js +48 -0
  27. package/dist/esm/apis/SecretsApi.d.ts +123 -0
  28. package/dist/esm/apis/SecretsApi.js +324 -0
  29. package/dist/esm/apis/index.d.ts +3 -0
  30. package/dist/esm/apis/index.js +3 -0
  31. package/dist/esm/models/Balance.d.ts +6 -0
  32. package/dist/esm/models/Balance.js +2 -0
  33. package/dist/esm/models/CreateWebhookEndpointRequest.d.ts +3 -0
  34. package/dist/esm/models/CreateWebhookEndpointRequest.js +4 -1
  35. package/dist/esm/models/DedicatedIPOffer.d.ts +98 -0
  36. package/dist/esm/models/DedicatedIPOffer.js +87 -0
  37. package/dist/esm/models/Endpoint.d.ts +147 -0
  38. package/dist/esm/models/Endpoint.js +121 -0
  39. package/dist/esm/models/EndpointCreate.d.ts +80 -0
  40. package/dist/esm/models/EndpointCreate.js +63 -0
  41. package/dist/esm/models/EndpointList.d.ts +33 -0
  42. package/dist/esm/models/EndpointList.js +44 -0
  43. package/dist/esm/models/EndpointMachine.d.ts +90 -0
  44. package/dist/esm/models/EndpointMachine.js +84 -0
  45. package/dist/esm/models/EndpointReplicaCounts.d.ts +38 -0
  46. package/dist/esm/models/EndpointReplicaCounts.js +47 -0
  47. package/dist/esm/models/Job.d.ts +352 -0
  48. package/dist/esm/models/Job.js +254 -0
  49. package/dist/esm/models/JobAttempt.d.ts +176 -0
  50. package/dist/esm/models/JobAttempt.js +147 -0
  51. package/dist/esm/models/JobCreate.d.ts +153 -0
  52. package/dist/esm/models/JobCreate.js +84 -0
  53. package/dist/esm/models/JobGpuTypes.d.ts +39 -0
  54. package/dist/esm/models/JobGpuTypes.js +48 -0
  55. package/dist/esm/models/JobGpuTypesDataInner.d.ts +58 -0
  56. package/dist/esm/models/JobGpuTypesDataInner.js +59 -0
  57. package/dist/esm/models/JobLogChunk.d.ts +50 -0
  58. package/dist/esm/models/JobLogChunk.js +55 -0
  59. package/dist/esm/models/JobLogs.d.ts +39 -0
  60. package/dist/esm/models/JobLogs.js +48 -0
  61. package/dist/esm/models/JobPage.d.ts +39 -0
  62. package/dist/esm/models/JobPage.js +48 -0
  63. package/dist/esm/models/JobSharingHint.d.ts +46 -0
  64. package/dist/esm/models/JobSharingHint.js +51 -0
  65. package/dist/esm/models/JobTelemetry.d.ts +51 -0
  66. package/dist/esm/models/JobTelemetry.js +56 -0
  67. package/dist/esm/models/JobTelemetryPoint.d.ts +56 -0
  68. package/dist/esm/models/JobTelemetryPoint.js +59 -0
  69. package/dist/esm/models/JobTrial.d.ts +79 -0
  70. package/dist/esm/models/JobTrial.js +73 -0
  71. package/dist/esm/models/Secret.d.ts +62 -0
  72. package/dist/esm/models/Secret.js +63 -0
  73. package/dist/esm/models/SecretCreate.d.ts +44 -0
  74. package/dist/esm/models/SecretCreate.js +49 -0
  75. package/dist/esm/models/SecretImportItem.d.ts +38 -0
  76. package/dist/esm/models/SecretImportItem.js +47 -0
  77. package/dist/esm/models/SecretImportRequest.d.ts +39 -0
  78. package/dist/esm/models/SecretImportRequest.js +46 -0
  79. package/dist/esm/models/SecretImportResult.d.ts +44 -0
  80. package/dist/esm/models/SecretImportResult.js +51 -0
  81. package/dist/esm/models/SecretList.d.ts +33 -0
  82. package/dist/esm/models/SecretList.js +44 -0
  83. package/dist/esm/models/SecretPut.d.ts +38 -0
  84. package/dist/esm/models/SecretPut.js +45 -0
  85. package/dist/esm/models/WebhookEndpoint.d.ts +3 -0
  86. package/dist/esm/models/WebhookEndpoint.js +4 -1
  87. package/dist/esm/models/index.d.ts +25 -0
  88. package/dist/esm/models/index.js +25 -0
  89. package/dist/esm/runtime.js +1 -1
  90. package/dist/models/Balance.d.ts +6 -0
  91. package/dist/models/Balance.js +2 -0
  92. package/dist/models/CreateWebhookEndpointRequest.d.ts +3 -0
  93. package/dist/models/CreateWebhookEndpointRequest.js +4 -1
  94. package/dist/models/DedicatedIPOffer.d.ts +98 -0
  95. package/dist/models/DedicatedIPOffer.js +94 -0
  96. package/dist/models/Endpoint.d.ts +147 -0
  97. package/dist/models/Endpoint.js +129 -0
  98. package/dist/models/EndpointCreate.d.ts +80 -0
  99. package/dist/models/EndpointCreate.js +70 -0
  100. package/dist/models/EndpointList.d.ts +33 -0
  101. package/dist/models/EndpointList.js +51 -0
  102. package/dist/models/EndpointMachine.d.ts +90 -0
  103. package/dist/models/EndpointMachine.js +92 -0
  104. package/dist/models/EndpointReplicaCounts.d.ts +38 -0
  105. package/dist/models/EndpointReplicaCounts.js +54 -0
  106. package/dist/models/Job.d.ts +352 -0
  107. package/dist/models/Job.js +262 -0
  108. package/dist/models/JobAttempt.d.ts +176 -0
  109. package/dist/models/JobAttempt.js +155 -0
  110. package/dist/models/JobCreate.d.ts +153 -0
  111. package/dist/models/JobCreate.js +92 -0
  112. package/dist/models/JobGpuTypes.d.ts +39 -0
  113. package/dist/models/JobGpuTypes.js +55 -0
  114. package/dist/models/JobGpuTypesDataInner.d.ts +58 -0
  115. package/dist/models/JobGpuTypesDataInner.js +66 -0
  116. package/dist/models/JobLogChunk.d.ts +50 -0
  117. package/dist/models/JobLogChunk.js +62 -0
  118. package/dist/models/JobLogs.d.ts +39 -0
  119. package/dist/models/JobLogs.js +55 -0
  120. package/dist/models/JobPage.d.ts +39 -0
  121. package/dist/models/JobPage.js +55 -0
  122. package/dist/models/JobSharingHint.d.ts +46 -0
  123. package/dist/models/JobSharingHint.js +58 -0
  124. package/dist/models/JobTelemetry.d.ts +51 -0
  125. package/dist/models/JobTelemetry.js +63 -0
  126. package/dist/models/JobTelemetryPoint.d.ts +56 -0
  127. package/dist/models/JobTelemetryPoint.js +66 -0
  128. package/dist/models/JobTrial.d.ts +79 -0
  129. package/dist/models/JobTrial.js +81 -0
  130. package/dist/models/Secret.d.ts +62 -0
  131. package/dist/models/Secret.js +70 -0
  132. package/dist/models/SecretCreate.d.ts +44 -0
  133. package/dist/models/SecretCreate.js +56 -0
  134. package/dist/models/SecretImportItem.d.ts +38 -0
  135. package/dist/models/SecretImportItem.js +54 -0
  136. package/dist/models/SecretImportRequest.d.ts +39 -0
  137. package/dist/models/SecretImportRequest.js +53 -0
  138. package/dist/models/SecretImportResult.d.ts +44 -0
  139. package/dist/models/SecretImportResult.js +58 -0
  140. package/dist/models/SecretList.d.ts +33 -0
  141. package/dist/models/SecretList.js +51 -0
  142. package/dist/models/SecretPut.d.ts +38 -0
  143. package/dist/models/SecretPut.js +52 -0
  144. package/dist/models/WebhookEndpoint.d.ts +3 -0
  145. package/dist/models/WebhookEndpoint.js +4 -1
  146. package/dist/models/index.d.ts +25 -0
  147. package/dist/models/index.js +25 -0
  148. package/dist/runtime.js +1 -1
  149. package/docs/Balance.md +2 -0
  150. package/docs/BillingApi.md +2 -2
  151. package/docs/DedicatedIPOffer.md +56 -0
  152. package/docs/Endpoint.md +68 -0
  153. package/docs/EndpointCreate.md +50 -0
  154. package/docs/EndpointList.md +34 -0
  155. package/docs/EndpointMachine.md +50 -0
  156. package/docs/EndpointReplicaCounts.md +36 -0
  157. package/docs/EndpointsApi.md +544 -0
  158. package/docs/InstancesApi.md +68 -1
  159. package/docs/Job.md +125 -0
  160. package/docs/JobAttempt.md +69 -0
  161. package/docs/JobCreate.md +66 -0
  162. package/docs/JobGpuTypes.md +36 -0
  163. package/docs/JobGpuTypesDataInner.md +42 -0
  164. package/docs/JobLogChunk.md +40 -0
  165. package/docs/JobLogs.md +36 -0
  166. package/docs/JobPage.md +36 -0
  167. package/docs/JobSharingHint.md +39 -0
  168. package/docs/JobTelemetry.md +40 -0
  169. package/docs/JobTelemetryPoint.md +42 -0
  170. package/docs/JobTrial.md +46 -0
  171. package/docs/JobsApi.md +609 -0
  172. package/docs/OperationsApi.md +76 -0
  173. package/docs/Secret.md +45 -0
  174. package/docs/SecretCreate.md +38 -0
  175. package/docs/SecretImportItem.md +36 -0
  176. package/docs/SecretImportRequest.md +36 -0
  177. package/docs/SecretImportResult.md +38 -0
  178. package/docs/SecretList.md +34 -0
  179. package/docs/SecretPut.md +36 -0
  180. package/docs/SecretsApi.md +450 -0
  181. package/package.json +1 -1
  182. package/src/apis/BillingApi.ts +2 -2
  183. package/src/apis/EndpointsApi.ts +481 -0
  184. package/src/apis/InstancesApi.ts +52 -0
  185. package/src/apis/JobsApi.ts +551 -0
  186. package/src/apis/OperationsApi.ts +59 -0
  187. package/src/apis/SecretsApi.ts +413 -0
  188. package/src/apis/index.ts +3 -0
  189. package/src/models/Balance.ts +8 -0
  190. package/src/models/CreateWebhookEndpointRequest.ts +4 -1
  191. package/src/models/DedicatedIPOffer.ts +165 -0
  192. package/src/models/Endpoint.ts +247 -0
  193. package/src/models/EndpointCreate.ts +132 -0
  194. package/src/models/EndpointList.ts +74 -0
  195. package/src/models/EndpointMachine.ts +151 -0
  196. package/src/models/EndpointReplicaCounts.ts +75 -0
  197. package/src/models/Job.ts +538 -0
  198. package/src/models/JobAttempt.ts +267 -0
  199. package/src/models/JobCreate.ts +221 -0
  200. package/src/models/JobGpuTypes.ts +83 -0
  201. package/src/models/JobGpuTypesDataInner.ts +104 -0
  202. package/src/models/JobLogChunk.ts +93 -0
  203. package/src/models/JobLogs.ts +83 -0
  204. package/src/models/JobPage.ts +83 -0
  205. package/src/models/JobSharingHint.ts +86 -0
  206. package/src/models/JobTelemetry.ts +101 -0
  207. package/src/models/JobTelemetryPoint.ts +102 -0
  208. package/src/models/JobTrial.ts +132 -0
  209. package/src/models/Secret.ts +111 -0
  210. package/src/models/SecretCreate.ts +83 -0
  211. package/src/models/SecretImportItem.ts +75 -0
  212. package/src/models/SecretImportRequest.ts +82 -0
  213. package/src/models/SecretImportResult.ts +84 -0
  214. package/src/models/SecretList.ts +74 -0
  215. package/src/models/SecretPut.ts +74 -0
  216. package/src/models/WebhookEndpoint.ts +4 -1
  217. package/src/models/index.ts +25 -0
  218. package/src/runtime.ts +1 -1
@@ -0,0 +1,609 @@
1
+ # JobsApi
2
+
3
+ All URIs are relative to *https://api.gpu.ai/v1*
4
+
5
+ | Method | HTTP request | Description |
6
+ |------------- | ------------- | -------------|
7
+ | [**cancelJob**](JobsApi.md#canceljob) | **POST** /jobs/{id}/cancel | Cancel a job |
8
+ | [**createJob**](JobsApi.md#createjob) | **POST** /jobs | Submit a job |
9
+ | [**getJob**](JobsApi.md#getjob) | **GET** /jobs/{id} | Get a job |
10
+ | [**getJobLogs**](JobsApi.md#getjoblogs) | **GET** /jobs/{id}/logs | Read a job\'s output |
11
+ | [**getJobTelemetry**](JobsApi.md#getjobtelemetry) | **GET** /jobs/{id}/telemetry | Read a job\'s GPU memory telemetry |
12
+ | [**getJobTrial**](JobsApi.md#getjobtrial) | **GET** /jobs/trial | Whether this organization\'s first jobs are free |
13
+ | [**listJobGpuTypes**](JobsApi.md#listjobgputypes) | **GET** /jobs/gpu-types | List the GPU types a job can run on |
14
+ | [**listJobs**](JobsApi.md#listjobs) | **GET** /jobs | List jobs |
15
+
16
+
17
+
18
+ ## cancelJob
19
+
20
+ > Job cancelJob(id, idempotencyKey)
21
+
22
+ Cancel a job
23
+
24
+ Cancels a job. A queued job is cancelled at once. A running job is stopped the next time its machine reports, within a few seconds, and shows `cancel_requested` until then. Cancelling a job that has already finished returns it unchanged. Requires the `instances:write` scope.
25
+
26
+ ### Example
27
+
28
+ ```ts
29
+ import {
30
+ Configuration,
31
+ JobsApi,
32
+ } from '@gpuai/sdk';
33
+ import type { CancelJobRequest } from '@gpuai/sdk';
34
+
35
+ async function example() {
36
+ console.log("🚀 Testing @gpuai/sdk SDK...");
37
+ const config = new Configuration({
38
+ // Configure HTTP bearer authorization: bearerAuth
39
+ accessToken: "YOUR BEARER TOKEN",
40
+ });
41
+ const api = new JobsApi(config);
42
+
43
+ const body = {
44
+ // string | The job id.
45
+ id: id_example,
46
+ // string (optional)
47
+ idempotencyKey: idempotencyKey_example,
48
+ } satisfies CancelJobRequest;
49
+
50
+ try {
51
+ const data = await api.cancelJob(body);
52
+ console.log(data);
53
+ } catch (error) {
54
+ console.error(error);
55
+ }
56
+ }
57
+
58
+ // Run the test
59
+ example().catch(console.error);
60
+ ```
61
+
62
+ ### Parameters
63
+
64
+
65
+ | Name | Type | Description | Notes |
66
+ |------------- | ------------- | ------------- | -------------|
67
+ | **id** | `string` | The job id. | [Defaults to `undefined`] |
68
+ | **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
69
+
70
+ ### Return type
71
+
72
+ [**Job**](Job.md)
73
+
74
+ ### Authorization
75
+
76
+ [bearerAuth](../README.md#bearerAuth)
77
+
78
+ ### HTTP request headers
79
+
80
+ - **Content-Type**: Not defined
81
+ - **Accept**: `application/json`, `application/problem+json`
82
+
83
+
84
+ ### HTTP response details
85
+ | Status code | Description | Response headers |
86
+ |-------------|-------------|------------------|
87
+ | **200** | The job after the cancel request. | - |
88
+ | **404** | The job does not exist or is not owned by the caller\'s organization. | - |
89
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
90
+ | **0** | Error response (RFC 7807) | - |
91
+
92
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
93
+
94
+
95
+ ## createJob
96
+
97
+ > Job createJob(jobCreate, idempotencyKey)
98
+
99
+ Submit a job
100
+
101
+ Queues a batch job: a container image, a command, and the GPU it needs. The platform places it on a machine in your organization\&#39;s job pool, starting a machine when none has room, and terminates machines that have been empty for a few minutes. Requires the &#x60;instances:write&#x60; scope, because a job can start a machine. Three opt-ins decide how the job is placed. &#x60;max_wait_seconds&#x60; lets the job wait for space on a machine you are already paying for before a new one is started. &#x60;allow_sharing&#x60; lets the job run on the same GPU as other jobs from your own organization. A GPU is never shared with another customer. &#x60;allow_restart&#x60; lets the platform stop and rerun the job, which sharing needs. A job shares a GPU only when &#x60;allow_sharing&#x60; and &#x60;allow_restart&#x60; are both true and its memory is known, from &#x60;memory_hint_mb&#x60; or from the peaks of earlier finished jobs with the same name or image. Any other job gets a whole GPU. Sharing is also limited by compute. Jobs share a GPU only while the sum of their expected compute duties (the share of time each keeps the GPU busy) stays at or under 100%, so two jobs that saturate the GPU never share one. A job\&#39;s duty comes from &#x60;compute_hint_pct&#x60; or from the measured utilization of earlier finished jobs with the same name or image. A job with neither counts as 100% and gets a GPU to itself until it has been measured. The memory reservation is not a hard cap. A job that exits out of GPU memory, or that is stopped for outgrowing its reservation on a full GPU, is run again with a larger reservation, then with a whole GPU, up to &#x60;max_retries&#x60;. Every job gets a checkpoint directory that survives those reruns on the same machine. Billing: the machines a job runs on are instances of your organization and are billed like any instance. &#x60;attributed_cost_usd&#x60; on the job is its share of that, for display. Free trial: when this deployment runs one, an organization\&#39;s first jobs are free up to a cap (GET /jobs/trial). Their attributed cost is credited back to the balance as they run.
102
+
103
+ ### Example
104
+
105
+ ```ts
106
+ import {
107
+ Configuration,
108
+ JobsApi,
109
+ } from '@gpuai/sdk';
110
+ import type { CreateJobRequest } from '@gpuai/sdk';
111
+
112
+ async function example() {
113
+ console.log("🚀 Testing @gpuai/sdk SDK...");
114
+ const config = new Configuration({
115
+ // Configure HTTP bearer authorization: bearerAuth
116
+ accessToken: "YOUR BEARER TOKEN",
117
+ });
118
+ const api = new JobsApi(config);
119
+
120
+ const body = {
121
+ // JobCreate
122
+ jobCreate: ...,
123
+ // string (optional)
124
+ idempotencyKey: idempotencyKey_example,
125
+ } satisfies CreateJobRequest;
126
+
127
+ try {
128
+ const data = await api.createJob(body);
129
+ console.log(data);
130
+ } catch (error) {
131
+ console.error(error);
132
+ }
133
+ }
134
+
135
+ // Run the test
136
+ example().catch(console.error);
137
+ ```
138
+
139
+ ### Parameters
140
+
141
+
142
+ | Name | Type | Description | Notes |
143
+ |------------- | ------------- | ------------- | -------------|
144
+ | **jobCreate** | [JobCreate](JobCreate.md) | | |
145
+ | **idempotencyKey** | `string` | | [Optional] [Defaults to `undefined`] |
146
+
147
+ ### Return type
148
+
149
+ [**Job**](Job.md)
150
+
151
+ ### Authorization
152
+
153
+ [bearerAuth](../README.md#bearerAuth)
154
+
155
+ ### HTTP request headers
156
+
157
+ - **Content-Type**: `application/json`
158
+ - **Accept**: `application/json`, `application/problem+json`
159
+
160
+
161
+ ### HTTP response details
162
+ | Status code | Description | Response headers |
163
+ |-------------|-------------|------------------|
164
+ | **201** | Created | * GPUAI-Hint - Advisory only. Sent while the organization\&#39;s first jobs are free (GET /jobs/trial), e.g. \&quot;Your first jobs are free, up to $10. We credit back what they cost as they run.\&quot; <br> |
165
+ | **402** | The organization has no balance. Add credits, then submit again. | - |
166
+ | **422** | Validation failed. The detail names the field: a missing image or command, an unknown field, an unknown &#x60;gpu_type&#x60;, neither &#x60;gpu_type&#x60; nor &#x60;min_vram_gb&#x60;, a memory hint larger than the GPU, an environment variable name starting with &#x60;GPUAI_&#x60;, or a value out of range. | - |
167
+ | **429** | Rate limited, or the organization already has the maximum number of queued and running jobs. | - |
168
+ | **0** | Error response (RFC 7807) | - |
169
+
170
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
171
+
172
+
173
+ ## getJob
174
+
175
+ > Job getJob(id)
176
+
177
+ Get a job
178
+
179
+ Returns one job with its attempts. Requires the &#x60;instances:read&#x60; scope.
180
+
181
+ ### Example
182
+
183
+ ```ts
184
+ import {
185
+ Configuration,
186
+ JobsApi,
187
+ } from '@gpuai/sdk';
188
+ import type { GetJobRequest } from '@gpuai/sdk';
189
+
190
+ async function example() {
191
+ console.log("🚀 Testing @gpuai/sdk SDK...");
192
+ const config = new Configuration({
193
+ // Configure HTTP bearer authorization: bearerAuth
194
+ accessToken: "YOUR BEARER TOKEN",
195
+ });
196
+ const api = new JobsApi(config);
197
+
198
+ const body = {
199
+ // string | The job id.
200
+ id: id_example,
201
+ } satisfies GetJobRequest;
202
+
203
+ try {
204
+ const data = await api.getJob(body);
205
+ console.log(data);
206
+ } catch (error) {
207
+ console.error(error);
208
+ }
209
+ }
210
+
211
+ // Run the test
212
+ example().catch(console.error);
213
+ ```
214
+
215
+ ### Parameters
216
+
217
+
218
+ | Name | Type | Description | Notes |
219
+ |------------- | ------------- | ------------- | -------------|
220
+ | **id** | `string` | The job id. | [Defaults to `undefined`] |
221
+
222
+ ### Return type
223
+
224
+ [**Job**](Job.md)
225
+
226
+ ### Authorization
227
+
228
+ [bearerAuth](../README.md#bearerAuth)
229
+
230
+ ### HTTP request headers
231
+
232
+ - **Content-Type**: Not defined
233
+ - **Accept**: `application/json`, `application/problem+json`
234
+
235
+
236
+ ### HTTP response details
237
+ | Status code | Description | Response headers |
238
+ |-------------|-------------|------------------|
239
+ | **200** | OK | - |
240
+ | **404** | The job does not exist or is not owned by the caller\&#39;s organization. | - |
241
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
242
+ | **0** | Error response (RFC 7807) | - |
243
+
244
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
245
+
246
+
247
+ ## getJobLogs
248
+
249
+ > JobLogs getJobLogs(id, after, limit)
250
+
251
+ Read a job\&#39;s output
252
+
253
+ Returns the job\&#39;s combined standard output and standard error, in chunks, across all attempts. Pass the &#x60;next_after&#x60; of one response as &#x60;after&#x60; on the next to read on from there. Output is uploaded every few seconds while the job runs, and stored output is capped at about 8 MB per attempt. Requires the &#x60;instances:read&#x60; scope.
254
+
255
+ ### Example
256
+
257
+ ```ts
258
+ import {
259
+ Configuration,
260
+ JobsApi,
261
+ } from '@gpuai/sdk';
262
+ import type { GetJobLogsRequest } from '@gpuai/sdk';
263
+
264
+ async function example() {
265
+ console.log("🚀 Testing @gpuai/sdk SDK...");
266
+ const config = new Configuration({
267
+ // Configure HTTP bearer authorization: bearerAuth
268
+ accessToken: "YOUR BEARER TOKEN",
269
+ });
270
+ const api = new JobsApi(config);
271
+
272
+ const body = {
273
+ // string | The job id.
274
+ id: id_example,
275
+ // number | Return chunks after this chunk id. (optional)
276
+ after: 789,
277
+ // number | Maximum number of chunks to return. (optional)
278
+ limit: 56,
279
+ } satisfies GetJobLogsRequest;
280
+
281
+ try {
282
+ const data = await api.getJobLogs(body);
283
+ console.log(data);
284
+ } catch (error) {
285
+ console.error(error);
286
+ }
287
+ }
288
+
289
+ // Run the test
290
+ example().catch(console.error);
291
+ ```
292
+
293
+ ### Parameters
294
+
295
+
296
+ | Name | Type | Description | Notes |
297
+ |------------- | ------------- | ------------- | -------------|
298
+ | **id** | `string` | The job id. | [Defaults to `undefined`] |
299
+ | **after** | `number` | Return chunks after this chunk id. | [Optional] [Defaults to `0`] |
300
+ | **limit** | `number` | Maximum number of chunks to return. | [Optional] [Defaults to `100`] |
301
+
302
+ ### Return type
303
+
304
+ [**JobLogs**](JobLogs.md)
305
+
306
+ ### Authorization
307
+
308
+ [bearerAuth](../README.md#bearerAuth)
309
+
310
+ ### HTTP request headers
311
+
312
+ - **Content-Type**: Not defined
313
+ - **Accept**: `application/json`, `application/problem+json`
314
+
315
+
316
+ ### HTTP response details
317
+ | Status code | Description | Response headers |
318
+ |-------------|-------------|------------------|
319
+ | **200** | OK | - |
320
+ | **404** | The job does not exist or is not owned by the caller\&#39;s organization. | - |
321
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
322
+ | **0** | Error response (RFC 7807) | - |
323
+
324
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
325
+
326
+
327
+ ## getJobTelemetry
328
+
329
+ > JobTelemetry getJobTelemetry(id)
330
+
331
+ Read a job\&#39;s GPU memory telemetry
332
+
333
+ Returns the job\&#39;s peak GPU memory, its reservation, and up to the 720 most recent memory points. The machine samples every 2 seconds and stores one point per report, the highest sample in that window. Points are kept for 30 days. Requires the &#x60;instances:read&#x60; scope.
334
+
335
+ ### Example
336
+
337
+ ```ts
338
+ import {
339
+ Configuration,
340
+ JobsApi,
341
+ } from '@gpuai/sdk';
342
+ import type { GetJobTelemetryRequest } from '@gpuai/sdk';
343
+
344
+ async function example() {
345
+ console.log("🚀 Testing @gpuai/sdk SDK...");
346
+ const config = new Configuration({
347
+ // Configure HTTP bearer authorization: bearerAuth
348
+ accessToken: "YOUR BEARER TOKEN",
349
+ });
350
+ const api = new JobsApi(config);
351
+
352
+ const body = {
353
+ // string | The job id.
354
+ id: id_example,
355
+ } satisfies GetJobTelemetryRequest;
356
+
357
+ try {
358
+ const data = await api.getJobTelemetry(body);
359
+ console.log(data);
360
+ } catch (error) {
361
+ console.error(error);
362
+ }
363
+ }
364
+
365
+ // Run the test
366
+ example().catch(console.error);
367
+ ```
368
+
369
+ ### Parameters
370
+
371
+
372
+ | Name | Type | Description | Notes |
373
+ |------------- | ------------- | ------------- | -------------|
374
+ | **id** | `string` | The job id. | [Defaults to `undefined`] |
375
+
376
+ ### Return type
377
+
378
+ [**JobTelemetry**](JobTelemetry.md)
379
+
380
+ ### Authorization
381
+
382
+ [bearerAuth](../README.md#bearerAuth)
383
+
384
+ ### HTTP request headers
385
+
386
+ - **Content-Type**: Not defined
387
+ - **Accept**: `application/json`, `application/problem+json`
388
+
389
+
390
+ ### HTTP response details
391
+ | Status code | Description | Response headers |
392
+ |-------------|-------------|------------------|
393
+ | **200** | OK | - |
394
+ | **404** | The job does not exist or is not owned by the caller\&#39;s organization. | - |
395
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
396
+ | **0** | Error response (RFC 7807) | - |
397
+
398
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
399
+
400
+
401
+ ## getJobTrial
402
+
403
+ > JobTrial getJobTrial()
404
+
405
+ Whether this organization\&#39;s first jobs are free
406
+
407
+ Reports the Jobs free trial for this organization. When the deployment runs one, an organization\&#39;s first jobs are free up to &#x60;cap_cents&#x60;: the cost attributed to its jobs is credited back to its balance as they run, until the credits reach the cap. One trial per organization, for organizations that had not used Jobs before the trial started. &#x60;enabled&#x60; is false when there is no trial. Requires the &#x60;instances:read&#x60; scope.
408
+
409
+ ### Example
410
+
411
+ ```ts
412
+ import {
413
+ Configuration,
414
+ JobsApi,
415
+ } from '@gpuai/sdk';
416
+ import type { GetJobTrialRequest } from '@gpuai/sdk';
417
+
418
+ async function example() {
419
+ console.log("🚀 Testing @gpuai/sdk SDK...");
420
+ const config = new Configuration({
421
+ // Configure HTTP bearer authorization: bearerAuth
422
+ accessToken: "YOUR BEARER TOKEN",
423
+ });
424
+ const api = new JobsApi(config);
425
+
426
+ try {
427
+ const data = await api.getJobTrial();
428
+ console.log(data);
429
+ } catch (error) {
430
+ console.error(error);
431
+ }
432
+ }
433
+
434
+ // Run the test
435
+ example().catch(console.error);
436
+ ```
437
+
438
+ ### Parameters
439
+
440
+ This endpoint does not need any parameter.
441
+
442
+ ### Return type
443
+
444
+ [**JobTrial**](JobTrial.md)
445
+
446
+ ### Authorization
447
+
448
+ [bearerAuth](../README.md#bearerAuth)
449
+
450
+ ### HTTP request headers
451
+
452
+ - **Content-Type**: Not defined
453
+ - **Accept**: `application/json`, `application/problem+json`
454
+
455
+
456
+ ### HTTP response details
457
+ | Status code | Description | Response headers |
458
+ |-------------|-------------|------------------|
459
+ | **200** | OK | - |
460
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
461
+ | **0** | Error response (RFC 7807) | - |
462
+
463
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
464
+
465
+
466
+ ## listJobGpuTypes
467
+
468
+ > JobGpuTypes listJobGpuTypes()
469
+
470
+ List the GPU types a job can run on
471
+
472
+ Returns the GPU types the suppliers that run jobs rent as a one-GPU machine, smallest memory first. A type is listed when one of them offered it in the last 7 days, in stock or not. &#x60;available_now&#x60; says whether one has such a machine to rent now, and &#x60;price_per_gpu_hour&#x60; is the cheapest retail price of it at that read (a guide, not a quote: the launch prices it again). When &#x60;complete&#x60; is true, &#x60;POST /jobs&#x60; refuses any other &#x60;gpu_type&#x60; with a 422 (and a &#x60;min_vram_gb&#x60; larger than every listed type), instead of queueing a job that could never start. When &#x60;complete&#x60; is false the list may be partial or empty, and a job for any known GPU model is accepted and waits for a machine. Requires the &#x60;instances:read&#x60; scope.
473
+
474
+ ### Example
475
+
476
+ ```ts
477
+ import {
478
+ Configuration,
479
+ JobsApi,
480
+ } from '@gpuai/sdk';
481
+ import type { ListJobGpuTypesRequest } from '@gpuai/sdk';
482
+
483
+ async function example() {
484
+ console.log("🚀 Testing @gpuai/sdk SDK...");
485
+ const config = new Configuration({
486
+ // Configure HTTP bearer authorization: bearerAuth
487
+ accessToken: "YOUR BEARER TOKEN",
488
+ });
489
+ const api = new JobsApi(config);
490
+
491
+ try {
492
+ const data = await api.listJobGpuTypes();
493
+ console.log(data);
494
+ } catch (error) {
495
+ console.error(error);
496
+ }
497
+ }
498
+
499
+ // Run the test
500
+ example().catch(console.error);
501
+ ```
502
+
503
+ ### Parameters
504
+
505
+ This endpoint does not need any parameter.
506
+
507
+ ### Return type
508
+
509
+ [**JobGpuTypes**](JobGpuTypes.md)
510
+
511
+ ### Authorization
512
+
513
+ [bearerAuth](../README.md#bearerAuth)
514
+
515
+ ### HTTP request headers
516
+
517
+ - **Content-Type**: Not defined
518
+ - **Accept**: `application/json`, `application/problem+json`
519
+
520
+
521
+ ### HTTP response details
522
+ | Status code | Description | Response headers |
523
+ |-------------|-------------|------------------|
524
+ | **200** | OK | - |
525
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
526
+ | **0** | Error response (RFC 7807) | - |
527
+
528
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
529
+
530
+
531
+ ## listJobs
532
+
533
+ > JobPage listJobs(status, cursor, limit)
534
+
535
+ List jobs
536
+
537
+ Lists this organization\&#39;s jobs, newest first. Requires the &#x60;instances:read&#x60; scope. Jobs belonging to other organizations are never returned.
538
+
539
+ ### Example
540
+
541
+ ```ts
542
+ import {
543
+ Configuration,
544
+ JobsApi,
545
+ } from '@gpuai/sdk';
546
+ import type { ListJobsRequest } from '@gpuai/sdk';
547
+
548
+ async function example() {
549
+ console.log("🚀 Testing @gpuai/sdk SDK...");
550
+ const config = new Configuration({
551
+ // Configure HTTP bearer authorization: bearerAuth
552
+ accessToken: "YOUR BEARER TOKEN",
553
+ });
554
+ const api = new JobsApi(config);
555
+
556
+ const body = {
557
+ // 'queued' | 'assigned' | 'running' | 'succeeded' | 'failed' | 'cancelled' | Only return jobs in this status. (optional)
558
+ status: status_example,
559
+ // string (optional)
560
+ cursor: cursor_example,
561
+ // number (optional)
562
+ limit: 56,
563
+ } satisfies ListJobsRequest;
564
+
565
+ try {
566
+ const data = await api.listJobs(body);
567
+ console.log(data);
568
+ } catch (error) {
569
+ console.error(error);
570
+ }
571
+ }
572
+
573
+ // Run the test
574
+ example().catch(console.error);
575
+ ```
576
+
577
+ ### Parameters
578
+
579
+
580
+ | Name | Type | Description | Notes |
581
+ |------------- | ------------- | ------------- | -------------|
582
+ | **status** | `queued`, `assigned`, `running`, `succeeded`, `failed`, `cancelled` | Only return jobs in this status. | [Optional] [Defaults to `undefined`] [Enum: queued, assigned, running, succeeded, failed, cancelled] |
583
+ | **cursor** | `string` | | [Optional] [Defaults to `undefined`] |
584
+ | **limit** | `number` | | [Optional] [Defaults to `50`] |
585
+
586
+ ### Return type
587
+
588
+ [**JobPage**](JobPage.md)
589
+
590
+ ### Authorization
591
+
592
+ [bearerAuth](../README.md#bearerAuth)
593
+
594
+ ### HTTP request headers
595
+
596
+ - **Content-Type**: Not defined
597
+ - **Accept**: `application/json`, `application/problem+json`
598
+
599
+
600
+ ### HTTP response details
601
+ | Status code | Description | Response headers |
602
+ |-------------|-------------|------------------|
603
+ | **200** | OK | - |
604
+ | **422** | Validation failed, such as an unknown status or an invalid cursor. | - |
605
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
606
+ | **0** | Error response (RFC 7807) | - |
607
+
608
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
609
+
@@ -4,10 +4,86 @@ All URIs are relative to *https://api.gpu.ai/v1*
4
4
 
5
5
  | Method | HTTP request | Description |
6
6
  |------------- | ------------- | -------------|
7
+ | [**cancelOperation**](OperationsApi.md#canceloperation) | **POST** /operations/{id}/cancel | Cancel a launch that has not created its instance yet |
7
8
  | [**getOperation**](OperationsApi.md#getoperation) | **GET** /operations/{id} | Get an async operation status |
8
9
 
9
10
 
10
11
 
12
+ ## cancelOperation
13
+
14
+ > Operation cancelOperation(id)
15
+
16
+ Cancel a launch that has not created its instance yet
17
+
18
+ Cancels an instance.create operation that is still pending or in_progress and has no resource_id yet. Nothing is created or billed for a cancelled launch; if the supplier finishes creating the machine after the cancel, it is terminated right away. Cancelling an operation that already finished returns it unchanged, so the call is safe to repeat. Scoped like GET /operations/{id}: only the key that started the operation can cancel it. Requires the &#x60;instances:write&#x60; scope.
19
+
20
+ ### Example
21
+
22
+ ```ts
23
+ import {
24
+ Configuration,
25
+ OperationsApi,
26
+ } from '@gpuai/sdk';
27
+ import type { CancelOperationRequest } from '@gpuai/sdk';
28
+
29
+ async function example() {
30
+ console.log("🚀 Testing @gpuai/sdk SDK...");
31
+ const config = new Configuration({
32
+ // Configure HTTP bearer authorization: bearerAuth
33
+ accessToken: "YOUR BEARER TOKEN",
34
+ });
35
+ const api = new OperationsApi(config);
36
+
37
+ const body = {
38
+ // string
39
+ id: 38400000-8cf0-11bd-b23e-10b96e4ef00d,
40
+ } satisfies CancelOperationRequest;
41
+
42
+ try {
43
+ const data = await api.cancelOperation(body);
44
+ console.log(data);
45
+ } catch (error) {
46
+ console.error(error);
47
+ }
48
+ }
49
+
50
+ // Run the test
51
+ example().catch(console.error);
52
+ ```
53
+
54
+ ### Parameters
55
+
56
+
57
+ | Name | Type | Description | Notes |
58
+ |------------- | ------------- | ------------- | -------------|
59
+ | **id** | `string` | | [Defaults to `undefined`] |
60
+
61
+ ### Return type
62
+
63
+ [**Operation**](Operation.md)
64
+
65
+ ### Authorization
66
+
67
+ [bearerAuth](../README.md#bearerAuth)
68
+
69
+ ### HTTP request headers
70
+
71
+ - **Content-Type**: Not defined
72
+ - **Accept**: `application/json`, `application/problem+json`
73
+
74
+
75
+ ### HTTP response details
76
+ | Status code | Description | Response headers |
77
+ |-------------|-------------|------------------|
78
+ | **200** | The operation, &#x60;cancelled&#x60; unless it had already finished. | - |
79
+ | **404** | &#x60;not_found&#x60;. No operation with this id for this key. | - |
80
+ | **409** | &#x60;validation_failed&#x60;. The operation is not a launch, or the launch already created its instance. The detail names the instance to delete instead. | - |
81
+ | **429** | Rate limit exceeded (RFC 7807). Retry-After header indicates seconds to wait. | * Retry-After - Seconds the client should wait before retrying. <br> |
82
+ | **0** | Error response (RFC 7807) | - |
83
+
84
+ [[Back to top]](#) [[Back to API list]](../README.md#api-endpoints) [[Back to Model list]](../README.md#models) [[Back to README]](../README.md)
85
+
86
+
11
87
  ## getOperation
12
88
 
13
89
  > Operation getOperation(id)