Skip to content

Commit 1807d59

Browse files
release: 1.6.0 (#704)
Co-authored-by: stainless-app[bot] <142633134+stainless-app[bot]@users.noreply.github.com>
1 parent 9d5abdc commit 1807d59

12 files changed

Lines changed: 116 additions & 7 deletions

File tree

.release-please-manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
".": "1.5.1"
2+
".": "1.6.0"
33
}

.stats.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 112
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b493cadf2e3b9658163a6bcf8f51e088dda169f12d68469c4441d17e889f5556.yml
3-
openapi_spec_hash: b27ec3822d88d10efa268f1681fddff3
4-
config_hash: 6c26299fd9ef01fb4713612a9a2ad17c
1+
configured_endpoints: 113
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-37187e72e61b850045924e6cb40207159ab794114add75a2bf36c87915326306.yml
3+
openapi_spec_hash: 33510c114bef0847855cdaf8f55c0774
4+
config_hash: 9f86425631c30497276e58b744dd3654

CHANGELOG.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,22 @@
11
# Changelog
22

3+
## 1.6.0 (2026-02-04)
4+
5+
Full Changelog: [v1.5.1...v1.6.0](https://github.com/runloopai/api-client-ts/compare/v1.5.1...v1.6.0)
6+
7+
### Features
8+
9+
* add api to query devbox usage ([#7296](https://github.com/runloopai/api-client-ts/issues/7296)) ([7c5fbee](https://github.com/runloopai/api-client-ts/commit/7c5fbee5859eb24604678ad4436414333cb9120f))
10+
* Add tunnel helpers to OO sdk ([#705](https://github.com/runloopai/api-client-ts/issues/705)) ([d510b53](https://github.com/runloopai/api-client-ts/commit/d510b53304d9fc8c506192c5a3cb078681013ab7))
11+
* **devbox:** adding gateway config to devbox ([#701](https://github.com/runloopai/api-client-ts/issues/701)) ([173fada](https://github.com/runloopai/api-client-ts/commit/173fadaf97a02e89138addf57bcf9f5e580a81b3))
12+
13+
14+
### Chores
15+
16+
* **client:** do not parse responses with empty content-length ([f797b28](https://github.com/runloopai/api-client-ts/commit/f797b28110f08f78867a4e9fb8d45eb2073c3247))
17+
* deprecate remove tunnel API ([#707](https://github.com/runloopai/api-client-ts/issues/707)) ([e2322e6](https://github.com/runloopai/api-client-ts/commit/e2322e693c17d395f373bc08fc931e32be891b29))
18+
* Mark legacy tunnel methods deprecated ([#706](https://github.com/runloopai/api-client-ts/issues/706)) ([56a26f9](https://github.com/runloopai/api-client-ts/commit/56a26f950e26d6f86baede3eddeb2282130f8d33))
19+
320
## 1.5.1 (2026-01-30)
421

522
Full Changelog: [v1.5.0...v1.5.1](https://github.com/runloopai/api-client-ts/compare/v1.5.0...v1.5.1)

api.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ Types:
109109
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxExecutionDetailView</a></code>
110110
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxKillExecutionRequest</a></code>
111111
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxListView</a></code>
112+
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxResourceUsageView</a></code>
112113
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxSendStdInRequest</a></code>
113114
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxSendStdInResult</a></code>
114115
- <code><a href="./src/resources/devboxes/devboxes.ts">DevboxSnapshotListView</a></code>
@@ -142,6 +143,7 @@ Methods:
142143
- <code title="post /v1/devboxes/{id}/read_file_contents">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">readFileContents</a>(id, { ...params }) -> string</code>
143144
- <code title="post /v1/devboxes/{id}/remove_tunnel">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">removeTunnel</a>(id, { ...params }) -> unknown</code>
144145
- <code title="post /v1/devboxes/{id}/resume">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">resume</a>(id) -> DevboxView</code>
146+
- <code title="get /v1/devboxes/{id}/usage">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">retrieveResourceUsage</a>(id) -> DevboxResourceUsageView</code>
145147
- <code title="post /v1/devboxes/{id}/shutdown">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">shutdown</a>(id) -> DevboxView</code>
146148
- <code title="post /v1/devboxes/{id}/snapshot_disk">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">snapshotDisk</a>(id, { ...params }) -> DevboxSnapshotView</code>
147149
- <code title="post /v1/devboxes/{id}/snapshot_disk_async">client.devboxes.<a href="./src/resources/devboxes/devboxes.ts">snapshotDiskAsync</a>(id, { ...params }) -> DevboxSnapshotView</code>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@runloop/api-client",
3-
"version": "1.5.1",
3+
"version": "1.6.0",
44
"description": "The official TypeScript library for the Runloop API",
55
"author": "Runloop <support@runloop.ai>",
66
"types": "dist/sdk.d.ts",

src/core.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ async function defaultParseResponse<T>(props: APIResponseProps): Promise<T> {
8484
const mediaType = contentType?.split(';')[0]?.trim();
8585
const isJSON = mediaType?.includes('application/json') || mediaType?.endsWith('+json');
8686
if (isJSON) {
87+
const contentLength = response.headers.get('content-length');
88+
if (contentLength === '0') {
89+
// if there is no content we can't do anything
90+
return undefined as T;
91+
}
92+
8793
const json = await response.json();
8894

8995
debug('response', response.status, response.url, response.headers, json);

src/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ import {
180180
DevboxReadFileContentsResponse,
181181
DevboxRemoveTunnelParams,
182182
DevboxRemoveTunnelResponse,
183+
DevboxResourceUsageView,
183184
DevboxSendStdInRequest,
184185
DevboxSendStdInResult,
185186
DevboxSnapshotDiskAsyncParams,
@@ -578,6 +579,7 @@ export declare namespace Runloop {
578579
type DevboxExecutionDetailView as DevboxExecutionDetailView,
579580
type DevboxKillExecutionRequest as DevboxKillExecutionRequest,
580581
type DevboxListView as DevboxListView,
582+
type DevboxResourceUsageView as DevboxResourceUsageView,
581583
type DevboxSendStdInRequest as DevboxSendStdInRequest,
582584
type DevboxSendStdInResult as DevboxSendStdInResult,
583585
type DevboxSnapshotListView as DevboxSnapshotListView,

src/resources/devboxes/devboxes.ts

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,16 @@ export class Devboxes extends APIResource {
437437
return this._client.post(`/v1/devboxes/${id}/resume`, options);
438438
}
439439

440+
/**
441+
* Get resource usage metrics for a specific Devbox. Returns CPU, memory, and disk
442+
* consumption calculated from the Devbox's lifecycle, excluding any suspended
443+
* periods for CPU and memory. Disk usage includes the full elapsed time since
444+
* storage is consumed even when suspended.
445+
*/
446+
retrieveResourceUsage(id: string, options?: Core.RequestOptions): Core.APIPromise<DevboxResourceUsageView> {
447+
return this._client.get(`/v1/devboxes/${id}/usage`, options);
448+
}
449+
440450
/**
441451
* Shutdown a running Devbox. This will permanently stop the Devbox. If you want to
442452
* save the state of the Devbox, you should take a snapshot before shutting down or
@@ -669,6 +679,57 @@ export interface DevboxListView {
669679
total_count: number;
670680
}
671681

682+
export interface DevboxResourceUsageView {
683+
/**
684+
* The devbox ID.
685+
*/
686+
id: string;
687+
688+
/**
689+
* Disk usage in GB-seconds (total_elapsed_seconds multiplied by disk size in GB).
690+
* Disk is billed for elapsed time since storage is consumed even when suspended.
691+
*/
692+
disk_gb_seconds: number;
693+
694+
/**
695+
* Memory usage in GB-seconds (total_active_seconds multiplied by memory in GB).
696+
*/
697+
memory_gb_seconds: number;
698+
699+
/**
700+
* The devbox creation time in milliseconds since epoch.
701+
*/
702+
start_time_ms: number;
703+
704+
/**
705+
* The current status of the devbox.
706+
*/
707+
status: string;
708+
709+
/**
710+
* Total time in seconds the devbox was actively running (excludes time spent
711+
* suspended).
712+
*/
713+
total_active_seconds: number;
714+
715+
/**
716+
* Total elapsed time in seconds from devbox creation to now (or end time if
717+
* terminated). Includes all time regardless of devbox state.
718+
*/
719+
total_elapsed_seconds: number;
720+
721+
/**
722+
* vCPU usage in vCPU-seconds (total_active_seconds multiplied by the number of
723+
* vCPUs).
724+
*/
725+
vcpu_seconds: number;
726+
727+
/**
728+
* The devbox end time in milliseconds since epoch, or null if still running.
729+
*/
730+
end_time_ms?: number | null;
731+
}
732+
672733
export interface DevboxSendStdInRequest {
673734
/**
674735
* Signal to send to std in of the running execution.
@@ -1380,6 +1441,7 @@ export declare namespace Devboxes {
13801441
type DevboxExecutionDetailView as DevboxExecutionDetailView,
13811442
type DevboxKillExecutionRequest as DevboxKillExecutionRequest,
13821443
type DevboxListView as DevboxListView,
1444+
type DevboxResourceUsageView as DevboxResourceUsageView,
13831445
type DevboxSendStdInRequest as DevboxSendStdInRequest,
13841446
type DevboxSendStdInResult as DevboxSendStdInResult,
13851447
type DevboxSnapshotListView as DevboxSnapshotListView,

src/resources/devboxes/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export {
2020
type DevboxExecutionDetailView,
2121
type DevboxKillExecutionRequest,
2222
type DevboxListView,
23+
type DevboxResourceUsageView,
2324
type DevboxSendStdInRequest,
2425
type DevboxSendStdInResult,
2526
type DevboxSnapshotListView,

src/resources/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ export {
6969
type DevboxExecutionDetailView,
7070
type DevboxKillExecutionRequest,
7171
type DevboxListView,
72+
type DevboxResourceUsageView,
7273
type DevboxSendStdInRequest,
7374
type DevboxSendStdInResult,
7475
type DevboxSnapshotListView,

0 commit comments

Comments
 (0)