---
title: "Create an ephemeral PTY tunnel for a running Devbox."
method: POST
path: "/v1/devboxes/{id}/create_pty_tunnel"
tags: ["Devbox", "Devbox-NetworkTools"]
---

# Create an ephemeral PTY tunnel for a running Devbox.

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

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.

## Path parameters

- `id` string, required

## Response `200`

OK

- PtyTunnelView — An ephemeral PTY tunnel providing authenticated terminal access to a Devbox. These tunnels are not stored on the Devbox and are generated fresh on each request. Usage: https://{port}-{tunnel_key}.tunnel.runloop.ai with 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_token` string, required — Bearer token for tunnel authentication. Always required for PTY tunnels. Pass as X-Runloop-Tunnel-Authorization: Bearer {auth_token}.

## Other responses

- `400` — Devbox is not currently running.
- `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)
