> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tensorlake.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Sandbox PTY API Overview

> Create and manage interactive PTY sessions through the sandbox proxy.

The sandbox PTY API is exposed through each sandbox's management hostname, not `https://api.tensorlake.ai`.

```text theme={null}
https://<sandbox-id-or-name>.sandbox.tensorlake.ai
```

Use PTY sessions when you need an interactive terminal, shell, or full-screen TUI inside a sandbox.

<Note>
  Include `Authorization: Bearer $TENSORLAKE_API_KEY` on requests to the sandbox proxy. The WebSocket attach endpoint also requires the per-session PTY token returned from session creation.
</Note>

<CardGroup cols={2}>
  <Card title="Create PTY Session" href="/api-reference/v2/pty/create">
    Start a new PTY-backed interactive session.
  </Card>

  <Card title="List PTY Sessions" href="/api-reference/v2/pty/list">
    Enumerate the PTY sessions tracked by the sandbox daemon.
  </Card>

  <Card title="Get PTY Session" href="/api-reference/v2/pty/get">
    Inspect session metadata, terminal size, and liveness.
  </Card>

  <Card title="Resize PTY Session" href="/api-reference/v2/pty/resize">
    Change the terminal rows and columns for an active session.
  </Card>

  <Card title="Attach PTY WebSocket" href="/api-reference/v2/pty/websocket">
    Connect to a session over WebSocket and exchange terminal bytes.
  </Card>

  <Card title="Kill PTY Session" href="/api-reference/v2/pty/kill">
    Terminate a PTY session.
  </Card>
</CardGroup>
