Overview

The Terminal API provides persistent PTY-based terminals backed by allternit-mux. Each terminal session is a real shell process owned by the mux daemon, survives API restarts, and supports scrollback replay plus live streaming. This replaces older tmux-backed implementations by removing the tmux dependency and providing persistent session ownership.

Base URL

All endpoints require a valid Bearer token in the Authorization header. See Authentication for details. The API connects to allternit-mux over a Unix domain socket. By default the socket is at ~/.allternit/mux/mux.sock; override with ALLTERNIT_MUX_SOCKET.

Endpoints

Create terminal

Request body:
All fields are optional. Defaults: Response:

Send input

Request body:
Response:

Resize terminal

Request body:
Response:

Close terminal

Response:

Stream output

The response is a text/event-stream. The server first replays the full persistent scrollback, then subscribes to live pane.output events from the mux daemon. Ping events are emitted every 15 seconds when no output is available. Example event:

Error codes