---
title: "Enable a tunnel for a running Devbox."
method: POST
path: "/v1/devboxes/{id}/enable_tunnel"
tags: ["Devbox", "Devbox-NetworkTools"]
---

# Enable a tunnel for a running Devbox.

`POST /v1/devboxes/{id}/enable_tunnel`

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://&#123;port&#125;-&#123;tunnel_key&#125;.tunnel.runloop.ai

Each Devbox can have one tunnel.

## Path parameters

- `id` string, required

## Request body

- TunnelConfig — Configuration for creating a V2 tunnel. When specified at Devbox creation, a tunnel will be automatically provisioned.
  - `auth_mode` 'open' | 'authenticated'
  - `http_keep_alive` boolean, nullable — When true, HTTP traffic through the tunnel counts as activity for idle lifecycle policies, resetting the idle timer. Defaults to true if not specified.
  - `wake_on_http` boolean, nullable — When true, HTTP traffic to a suspended devbox will automatically trigger a resume. Defaults to false if not specified. Prefer lifecycle.resume_triggers.http on launch_parameters for new integrations. If both are set, lifecycle.resume_triggers.http takes precedence.

## Response `200`

OK

- TunnelView — 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. Authenticated tunnels should pass auth_token as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
  - `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` 'open' | 'authenticated', required
  - `auth_token` string, nullable — Bearer token for tunnel authentication. Only present when auth_mode is 'authenticated'. Pass as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.
  - `create_time_ms` integer, required — Creation time of the tunnel (Unix timestamp milliseconds).
  - `http_keep_alive` boolean, required — When true, HTTP traffic through the tunnel counts as activity for idle lifecycle policies, resetting the idle timer.
  - `wake_on_http` boolean, required — When true, HTTP traffic to a suspended devbox will automatically trigger a resume.

## Other responses

- `400` — Devbox is not running or already has a tunnel configured.
- `404` — Devbox not found.

---

[API](https://skmtc.net/runloopai/apis/runloop-api.md) · [All operations](https://skmtc.net/runloopai/apis/runloop-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/runloopai/runloop-api/versions/ef553a04de89/schema)
