@runloop/api-client - v1.31.0
    Preparing search index...

    Class Devboxes

    Hierarchy

    • APIResource
      • Devboxes
    Index

    Constructors

    Properties

    _client: Runloop
    diskSnapshots: DiskSnapshots = ...
    logs: Logs = ...
    executions: Executions = ...

    Accessors

    Methods

    • Create a Devbox and begin the boot process. Standard Devboxes initially report the 'provisioning' state. FLEX Devboxes initially report the 'queued' state while waiting for infrastructure allocation, then transition to 'provisioning' once assigned to a node. The Devbox transitions to 'initializing' while the booted Devbox runs Runloop or user-defined setup scripts, then to 'running' when it is ready for use.

      Parameters

      Returns APIPromise<DevboxView>

    • Create a Devbox and begin the boot process. Standard Devboxes initially report the 'provisioning' state. FLEX Devboxes initially report the 'queued' state while waiting for infrastructure allocation, then transition to 'provisioning' once assigned to a node. The Devbox transitions to 'initializing' while the booted Devbox runs Runloop or user-defined setup scripts, then to 'running' when it is ready for use.

      Parameters

      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxView>

    • Updates the specified Devbox fields. Omitted fields are left unchanged. An empty name clears the name, and an empty metadata map clears the metadata.

      Parameters

      Returns APIPromise<DevboxView>

    • Updates the specified Devbox fields. Omitted fields are left unchanged. An empty name clears the name, and an empty metadata map clears the metadata.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxView>

    • Mint a token that lets a running Devbox call an external API through the Runloop agent gateway, using the credential in the supplied secret. The gateway applies the credential to proxied requests, so the real API key is never exposed to the Devbox.

      The token is bound to this Devbox and is only accepted for requests that originate from it. Nothing is stored on the Devbox: the token is returned to the caller and is not re-issued when the Devbox is resumed.

      Parameters

      Returns APIPromise<GatewayTokenView>

    • [Beta] Mint a token that lets a running Devbox reach an upstream MCP (Model Context Protocol) server through the Runloop MCP hub, using the credential in the supplied secret. Tool access is limited to the MCP config's allowed_tools, and the credential itself is never exposed to the Devbox.

      The token is bound to this Devbox and is only accepted for requests that originate from it. Nothing is stored on the Devbox: the token is returned to the caller and is not re-issued when the Devbox is resumed.

      Parameters

      Returns APIPromise<McpTokenView>

    • Create an ephemeral authenticated tunnel for terminal access to a running Devbox. This tunnel is not persisted on the Devbox and is generated fresh on each request. The returned auth_token should be passed as a Bearer token in the X-Runloop-Tunnel-Authorization header.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<PtyTunnelView>

    • Delete a previously taken disk snapshot of a Devbox.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<unknown>

    • Enable a V2 tunnel for an existing running Devbox. Tunnels provide encrypted URL-based access to the Devbox without exposing internal IDs. The tunnel URL format is: https://{port}-{tunnel_key}.tunnel.runloop.ai

      Each Devbox can have one tunnel.

      Parameters

      Returns APIPromise<TunnelView>

    • Enable a V2 tunnel for an existing running Devbox. Tunnels provide encrypted URL-based access to the Devbox without exposing internal IDs. The tunnel URL format is: https://{port}-{tunnel_key}.tunnel.runloop.ai

      Each Devbox can have one tunnel.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<TunnelView>

    • Send a 'Keep Alive' signal to a running Devbox that is configured to shutdown on idle so the idle time resets.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<unknown>

    • Read file contents from a file on a Devbox as a UTF-8. Note 'downloadFile' should be used for large files (greater than 100MB). Returns the file contents as a UTF-8 string.

      Parameters

      Returns APIPromise<string>

    • Remove an existing V2 tunnel from the Devbox.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<unknown>

    • Resume a suspended Devbox with the disk state captured as suspend time. Note that any previously running processes or daemons will need to be restarted using the Devbox shell tools.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxView>

    • Get resource usage metrics for a specific Devbox. Returns CPU, memory, and disk consumption calculated from the Devbox's lifecycle, excluding any suspended periods for CPU and memory. Disk usage includes the full elapsed time since storage is consumed even when suspended.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxResourceUsageView>

    • Shutdown a running Devbox. This will permanently stop the Devbox. If you want to save the state of the Devbox, you should take a snapshot before shutting down or should suspend the Devbox instead of shutting down. If the Devbox has any in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless force=true is specified.

      Parameters

      Returns APIPromise<DevboxView>

    • Shutdown a running Devbox. This will permanently stop the Devbox. If you want to save the state of the Devbox, you should take a snapshot before shutting down or should suspend the Devbox instead of shutting down. If the Devbox has any in-progress snapshots, the shutdown will be rejected with a 409 Conflict unless force=true is specified.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxView>

    • Suspend a running Devbox and create a disk snapshot to enable resuming the Devbox later with the same disk. Note this will not snapshot memory state such as running processes.

      Parameters

      • id: string
      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<DevboxView>

    • Upload file contents of any type (binary, text, etc) to a Devbox. Note this API is suitable for large files (larger than 100MB) and efficiently uploads files via multipart form data.

      Parameters

      Returns APIPromise<unknown>

    • Subscribe, via server-sent events, to pending infrastructure evictions for every Devbox in the account. On connect the stream emits one event per Devbox that currently has a pending eviction, then one event as each further eviction is scheduled. Best-effort and advisory: a Devbox stays running until its deadline, and delivery is not guaranteed.

      Parameters

      • Optionaloptions: RequestOptions<unknown>

      Returns APIPromise<Stream<DevboxEvictionEventView>>