Skip to main content
POST
/
v1
/
devboxes
/
{id}
/
enable_tunnel
JavaScript
import Runloop from '@runloop/api-client';

const client = new Runloop({
  bearerToken: process.env['RUNLOOP_API_KEY'], // This is the default and can be omitted
});

const tunnelView = await client.devboxes.enableTunnel('id');

console.log(tunnelView.auth_mode);
{
  "tunnel_key": "<string>",
  "auth_mode": "open",
  "create_time_ms": 123,
  "auth_token": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The Devbox ID.

Body

application/json

Configuration for creating a V2 tunnel. When specified at Devbox creation, a tunnel will be automatically provisioned.

auth_mode
enum<string> | null

Authentication mode for the tunnel. Defaults to 'public' if not specified.

Available options:
open,
authenticated

Response

OK

A V2 tunnel provides secure HTTP access to services running on a Devbox. Tunnels allow external clients to reach web servers, APIs, or other HTTP services running inside a Devbox without requiring direct network access. Each tunnel is uniquely identified by an encrypted tunnel_key and can be configured for either open (public) or authenticated access. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai

tunnel_key
string
required

The encrypted tunnel key used to construct the tunnel URL. URL format: https://{port}-{tunnel_key}.tunnel.runloop.{domain}

auth_mode
enum<string>
required

The authentication mode for the tunnel.

Available options:
open,
authenticated
create_time_ms
integer<int64>
required

Creation time of the tunnel (Unix timestamp milliseconds).

auth_token
string | null

Bearer token for tunnel authentication. Only present when auth_mode is 'authenticated'.